Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification Needed on LES Extrapolation Warning and SGS Model Implementation #803

Open
JhonCordova opened this issue May 26, 2024 · 4 comments

Comments

@JhonCordova
Copy link
Contributor

Hello,

I am working with LES and I would like to know specifically what this message means: 'WARNING -- Need to implement LES extrap here, see diffusion,' which appears in the getLESTerm method defined in LES.cpp. Could you please provide me with more information?

void
PeleC::getLESTerm(
  amrex::Real time,
  amrex::Real dt,
  amrex::MultiFab& LESTerm,
  amrex::Real reflux_factor)
{
  BL_PROFILE("PeleC::getLESTerm()");

  if (!do_les) {
    LESTerm.setVal(0, 0, NVAR, LESTerm.nGrow());
    return;
  }

  if (verbose != 0) {
    amrex::Print() << "... Computing LES term at time " << time << std::endl;
  }

  switch (les_model) {

  case 0:
    getSmagorinskyLESTerm(time, dt, LESTerm, reflux_factor);
    break;

  case 1:
    getDynamicSmagorinskyLESTerm(time, dt, LESTerm, reflux_factor);
    break;

  default:
    amrex::Error("Invalid les_model number.");
    break;
  }

  amrex::Print()
    << "WARNING -- Need to implement LES extrap here, see diffusion"
    << std::endl;

  // Filter the SGS source term
  if (use_explicit_filter) {
    les_filter.apply_filter(LESTerm, filtered_les_source);
    LESTerm.define(
      grids, dmap, NVAR, filtered_les_source.nGrow(), amrex::MFInfo(),
      Factory());
    amrex::MultiFab::Copy(
      LESTerm, filtered_les_source, 0, 0, NVAR, filtered_les_source.nGrow());
  }
}

Additionally, I want to implement a one equation SGS model in LES. I have seen in the PeleC documentation, specifically in the equations section, that there are two advected quantities, Ak and Bk, that can be used. How can I enable their use in PeleC? How do I define them?

Thank you.

@marchdf
Copy link
Contributor

marchdf commented May 28, 2024

Hi, the warning in there refers to this: https://github.com/AMReX-Combustion/PeleC/blob/development/Source/Diffusion.cpp#L533 that may or may not be missing depending on that case. I think that (in most cases) we don't need it. And actually the diffusion source term doesn't have ghost cells. So my guess is that you can ignore it.

For the other question, @bperry65 has used them more recently and can help.

@baperry2
Copy link
Contributor

The capability to add additional transported variables is a bit convoluted unfortunately. Note AUX and ADV variables are essentially treated the same so it doesn't matter much which you use, and everything follows the same below regardless of which you use. This capability was most recently updated in #743, so you can check there for a bit more information, but not everything is documented. Here's a brief overview:

  • Define the number of additional variables at compile time by setting for example PELE_NUM_ADV = 2 in the GNUmakefile
  • You can define the additional variable names by redefining the set_adv_names member function of the ProblemSpecificFunctions class in prob.H
  • You can similarly define arbitrary source terms for the variables through the problem_modify_ext_sources function
  • Right now diffusion for ADV variables is not easily supported, might be possible to manually compute these as part of the problem_modify_ext_sources function but I'm not sure on that

@JhonCordova
Copy link
Contributor Author

Thank you for the answers; I'll review the references. Do you have any reference books that can help me gain a more detailed understanding of the numerical modeling described in the solver?

@baperry2
Copy link
Contributor

What aspect of the numerical modeling are you interested in references on? A lot of it builds on methods that have been built over time and documented in various papers, not sure if there is a good single textbook reference.

For example, for Godunov/PPM stuff, you could start with this JCP https://www.sciencedirect.com/science/article/pii/S0021999108001435, but it may also be helpful to work backward through its references and forward through works that cite it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants