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

Functor material properties #18395

Merged
merged 83 commits into from
Oct 12, 2021
Merged

Commits on Oct 1, 2021

  1. Configuration menu
    Copy the full SHA
    a9902f7 View commit details
    Browse the repository at this point in the history
  2. Remove block insertion check

    This check was immediately triggered because we add three material
    objects per material in the input file, e.g. volumetric, face, and
    neighbor face materials. Without the check we are vulnerable to user
    error such as defining two materials in the input file that define the
    same functor property on a given block. Maybe the best remedy in the
    future is to have distinct `FunctorMaterials` that don't get added in
    triplicate because there is no functional reason for that in a system
    where we are evaluating material properties on the fly as opposed to
    having references to triplicate storage
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    23b8fd7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d1e8c09 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    797df91 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    26fc5a9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a049ee8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f994f88 View commit details
    Browse the repository at this point in the history
  8. Create and define the FunctorInterface

    GenericFunctors inherit from FunctorInterface and these
    are the building block for constant functors and material
    property functors. Variables also inherit from FunctorInterface.
    
    This commit also adds the FaceInfo operator() overload to
    the FunctorInterface. This overload takes FaceInfo, Limiter,
    and bool element_is_upwind arguments as a tuple to allow
    unambiguous creation of face values. Corresponding to this
    addition we have created a new getInternalFaceValue overload
    in MooseVariableFV that uses cell values, gradient, and the limiter
    to compute the face value
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    8ca8366 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    54ce2f8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a688488 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e1570b4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2c59dc6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d0ba4cf View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    bb61c49 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    6e089eb View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    e6e49f8 View commit details
    Browse the repository at this point in the history
  17. Query cache in getExtrapolatedBoundaryFaceValue

    With this query we avoid potentially unnecessary gradient
    computations for two term and we make the assertion in
    one term make sense
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    8ae451c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    49d10e1 View commit details
    Browse the repository at this point in the history
  19. Changes/additions to Limiter API

    - Limiter now takes phi_upwind, phi_downwind, grad_phi_upwind, and
      dCD arguments. The gradient argument is a pointer which allows
      the user to not supply it when it's expensive and when the limiter
      is constant. non-constant Limiters now have to manually call
      Moose::FV::rF themselves
    - constant() is a new API that a user can call to determine whether
      they need to supply a gradient (and maybe there will be other
      uses as well)
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    d445330 View commit details
    Browse the repository at this point in the history
  20. Adapt (P)INSFV to functor props

    It's perhaps worth mentioning by now that the current functor
    implementation forces a paradigm in which 'interpolated' face
    quantities are formed by composing atomic interpolated face quantities,
    e.g. interp(u*v) becomes interp(u)*interp(v). I imagine we will
    have some debate about whether this is satisfactory. My current
    data point is that this change does not impact the order of
    approximation error has demonstrated by continued passing of ins
    and pins mms tests
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    df24c14 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    bf6034b View commit details
    Browse the repository at this point in the history
  22. Create PINSFV and PWCNSFV analogs of PCNSFVStrongBC

    But leverage functors to greatly simplify code
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    1bf65cf View commit details
    Browse the repository at this point in the history
  23. Make sure to query interpCoeffs for boundary faces

    This prevents incorrectly adding to the Rhie-Chow element coefficient
    when doing upwind interpolation and when on a boundary face where the
    adjoining element is downwind with respect to the face velocity
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    b5a0439 View commit details
    Browse the repository at this point in the history
  24. Add no-diffusion PINSFV 1D MMS tests

    New tests:
    - Traditional INSFVInletVelocityBC and INSFVOutletPressureBC
    - new PINSFVStrongBC which is an FVFluxBC that leverages functors
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    72165e1 View commit details
    Browse the repository at this point in the history
  25. Working wcnsfv natural convection example

    It was actually working before but when there are large variations
    in density then the velocity distribution is asymmetric which is unlike
    the Boussinesq benchmarks that I'm used to looking at (which kind of
    makes sense... Boussinesq is only supposed to be applied when density
    variations relatively small). So instead of generating Rayleigh numbers
    by varying delta T (and consequently delta rho), I generate Rayleigh
    numbers based on changing L (e.g. xmax and ymax)
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    2e571e2 View commit details
    Browse the repository at this point in the history
  26. Restore aggregate interpolation in FVMatAdvection

    This removes the previous exodiff. This also adds a new overload
    of operator() that combines an element, face, and subdomain ID. For
    variables we check whether we have dofs on the element, and if not
    we create a ghost value using the element across (using the face)
    and any Dirichlet information. We use the subdomain ID for ghosted
    material properties
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    a1faa73 View commit details
    Browse the repository at this point in the history
  27. Allow functor property creation from getFunctorMaterialProperty

    We don't want the ability to create functor materials to depend on
    material ordering in the input file. Consequently if a consumer
    material is before a producer, we must allow the consumer material
    to be able to create the functor property instance that will then
    be setup by the declarer
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    a896d93 View commit details
    Browse the repository at this point in the history
  28. Restore aggregate interpolations in NS objects

    Includes
    - advection objects
    - PINSFVMomentumDiffusion
    
    This also required regolding the wcnsfv test since instead
    of using atomic interpolations, like was used when the gold
    file was initially produced, we now use the aggregated
    interpolations
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    84562bd View commit details
    Browse the repository at this point in the history
  29. Add two qp-based functor overloads

    1. Just takes a single qp. For a variable this just returns the
       elemental moose variable data (element_data->adSln()) indexed at qp
    2. The other overload takes a pair with the first of the pair
       corresponding to the element type (element, neighbor, or lower)
       and the second of the pair corresponding to the qp
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    bcdcd18 View commit details
    Browse the repository at this point in the history
  30. Adapt (P)INSFV to functor props, part 2

    Some details for this commit:
    - Add makeElemAndFace method to FVFluxBC
    - Update NS postprocessors to use functor properties
    - Update inputs to use functor properties
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    7c52535 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    79ae545 View commit details
    Browse the repository at this point in the history
  32. Add pwcnsfv mms test

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    d9e7765 View commit details
    Browse the repository at this point in the history
  33. Remove PWCNSFVStrongBC

    In brief trials, I have not been able to get the energy equation
    to converge at the correct rate. It's actually fully possible that I
    simply had not refined the mesh enough yet. But anyway this current
    feature branch is not about Euler/Navier-Stokes; it's about introducing
    functor properties and solving the mass and momentum equations in a
    weakly compressible context is enough of a physics demonstration of
    the usefulness of functor properties. Incorporating a weakly compressible
    energy equation can be a part of a feature branch more focused
    on the `navier_stokes` module
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    6550f20 View commit details
    Browse the repository at this point in the history
  34. Documentation

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    e095777 View commit details
    Browse the repository at this point in the history
  35. Apply suggestions from code review

    Co-authored-by: Guillaume Giudicelli <guillaume.giudicelli@gmail.com>
    lindsayad and GiudGiud committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    16a9bd5 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    59db6dd View commit details
    Browse the repository at this point in the history
  37. Remove GenericFunctor

    - Port all of its code back into FunctorMaterialProperty
    - Make MaterialPropertyInterface::getFunctorMaterialProperty return a
      FunctorInterface as opposed to a FunctorMaterialProperty. This allows
      returning a ConstantFunctor for default material properties
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    257d146 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    6bf472d View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    fb693f9 View commit details
    Browse the repository at this point in the history
  40. Add caching to functor properties

    - Implemented for quadrature point evaluations on elements
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    3ba76fc View commit details
    Browse the repository at this point in the history
  41. No reason to link libmesh libs into gtest

    In fact this can be quite disastrous. We do not build gtest with
    METHODS, so whatever METHOD is first used to build the gtest library
    will determine the libmesh library that gets linked. And then when
    linking our unit test executable and using any METHOD other than the
    METHOD initially used when linking gtest, you'll run into hideous errors
    like double frees
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    c8edc01 View commit details
    Browse the repository at this point in the history
  42. Address Robert review

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    9040131 View commit details
    Browse the repository at this point in the history
  43. Address Guillaume navier-stokes portion review

    Co-authored-by: Guillaume Giudicelli <guillaume.giudicelli@gmail.com>
    
    temp
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    6a84446 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    a253ebf View commit details
    Browse the repository at this point in the history
  45. Add time argument to functors

    For now I chose to go with an unsigned int for the time argument.
    It corresponds to the solution state. This can be used to query
    for old and older variable values and can also be easily used
    to determine Real time values by querying `FEProblemBase` (e.g.
    `time()` or `timeOld()` methods)
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    aaa62bb View commit details
    Browse the repository at this point in the history
  46. Add quadrature rule to QpArg

    This allows us to create physical quadrature point locations
    on-the-fly in `Function::evaluate(QpArg)` such that we can call
    `Function::value` with `Point` arguments. This could also allow
    us in the future to generate variable values at QpArg locations
    on-the-fly if we wanted to remove the pre-suppostion that the
    user has correctly init'd the variable before calls to `evaluate`
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    6ace575 View commit details
    Browse the repository at this point in the history
  47. Demonstrate use of Functions as functors

    GenericFunctionFunctorMaterial takes an input of function names and then
    evalutes functor material properties by calling through to the same
    functor interfaces on the function objects.
    
    Another important change in this commit is that we moved inheritance
    of `FunctorInterface` down into `MooseVariableField` which allows use
    of `MooseVariableFE` as a functor. Moving this down required adding
    some more template syntax into the variable classes since we now have
    to support more than just the `Real` instantiation of `MooseVariableFields`.
    
    This commit also changed the coefficient in `FVDiffusion` to be a
    functor instead of a regular material property which necessitated some
    changes in navier_stokes, ray_tracing, and quite a few moose tests. Some
    of the more notable additional changes required to make all tests pass:
    
    - FVPropValPerSubdomainMaterial is now a FunctorMaterial. This actually
      greatly simplified the code since we've baked specificity into our
      residual object functor material property requests, e.g. it's always
      clear what subdomain ID we're requesting the material property for
    - Made our two framework level `FVInterfaceKernel` objects use functor
      material properties. This necessitated adding `elemFace` and `neighborFace`
      protected methods to `FVInterfaceKernel`
    
    There were also two tests that were `RunException` tests before with
    regular material properties that now fun fine with functor properties.
    These two tests now show that we allow the following two new concepts:
    
    - Neighboring subdomain materials can define properties of the same name
      even when the material block restriction doesn't match the physics
      block restriction. This should make production physics inputs like we run
      in Pronghorn much simpler
    - material properties using in finite volume calculations can depend on
      material properties that are computed in functor materials that couple
      in finite element variables. This is different because we cannot ghost
      regular materials that coupled in finite element variables. Now there is
      still this restriction: a ghosted material property evaluation cannot
      depend on a finite element variable (indeed we cannot even yet call a
      finite element variable with "finite volume-esque" geometric arguments)
      but this could potentially be changed in the future
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    c0df195 View commit details
    Browse the repository at this point in the history
  48. Apply suggestions from code review

    Co-authored-by: Guillaume Giudicelli <guillaume.giudicelli@gmail.com>
    lindsayad and GiudGiud committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    58eb930 View commit details
    Browse the repository at this point in the history
  49. Elucidate meaning of ElemFromFaceArg

    People should think of this geometric argument as corresponding to the
    location in space of the element centroid (created from the face info)
    or the neighbor centroid (created from the face info). People *should
    not* think of this argument as corresponding to the location of the face
    just with inifinitesimal positioning on the elem or neighbor side
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    c4c2550 View commit details
    Browse the repository at this point in the history
  50. Overhaul FaceArg functor overload

    A comment that Guillaume made really made me think about the design of
    this overload. It needed to be revamped to really take sidedness into
    account. So now the SubdomainID argument has been changed to be a
    std::pair<SubdomainID, SubdomainID>. This qualitative change now makes
    it conceptually sound in my mind to call the ElemFromFaceArg overload in
    FunctorMaterialProperty when the FaceArg overload is called. And then we
    can do a macroscopic interpolation between the results which is an
    ability that others clamored for in the beginning
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    9ce8e6c View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    0691fe7 View commit details
    Browse the repository at this point in the history
  52. Add ElemSideQpArg overload

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    83d4b4e View commit details
    Browse the repository at this point in the history
  53. Resize qp cache all at once with qrule->n_points()

    Do this instead of incrementally resizing by one
    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    40a83c6 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    a5b0280 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    226eb28 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    ed7d970 View commit details
    Browse the repository at this point in the history
  57. shorten caching tests

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    ec79f69 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    f9d9e90 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    d54ef7a View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    9217f42 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    7bbd2a0 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    543e805 View commit details
    Browse the repository at this point in the history
  63. Update NS to getFunctor

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    5095d90 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    422fad9 View commit details
    Browse the repository at this point in the history
  65. Create FunctionTempl

    lindsayad committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    0050797 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    dd6fd5f View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    a762e32 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    4df5341 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    060e2af View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2021

  1. more documentation

    lindsayad committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    0bc54be View commit details
    Browse the repository at this point in the history
  2. Get rid of NonMathFVUtils

    lindsayad committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    66557dd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2778094 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    433a4bc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b9a921d View commit details
    Browse the repository at this point in the history
  6. Apply suggestions from code review

    Co-authored-by: Guillaume Giudicelli <guillaume.giudicelli@gmail.com>
    lindsayad and GiudGiud committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    eef4a49 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6fe4847 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d4d9c0f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6bfd4e6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c7f3cab View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9584906 View commit details
    Browse the repository at this point in the history
  12. Delete momentum_name code-path from incompressible friction object

    Also clean-up documentation to reflect that fully compressible only
    works with a momentum parameter and incompressible only works with a
    density parameter and superficial velocity variable set
    lindsayad committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    2566c29 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2021

  1. Further stratification of (P)INSFV and (P)CNSFV

    Removing standalone NSFV and PNSFV for gravity and friction
    lindsayad committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    e5c5bfe View commit details
    Browse the repository at this point in the history
  2. Test swapping out of functor material property types

    This revealed what should not have been a surprise: deleting an
    object makes any reference access to that object bad access. So
    now I use the letter and envelope idiom to allow changing out of
    the underlying functor material property type
    lindsayad committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    0653f11 View commit details
    Browse the repository at this point in the history