Skip to content

Commit

Permalink
Switch to regular functors for FVFunctorDirichletBC while we do not s…
Browse files Browse the repository at this point in the history
…upport AD-Dirichlet fully

refs #21374
  • Loading branch information
GiudGiud committed Jun 22, 2022
1 parent 1bd5fad commit 69ac1c1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion framework/doc/content/source/fvbcs/FVFunctorDirichletBC.md
Expand Up @@ -3,10 +3,16 @@
## Description

`FVFunctorDirichletBC` will specify the value of a field at the boundary.
The value will be determined by a `Functor`
The value will be determined by a `Functor`.

!alert note
This boundary condition will only accept regular functors. ADFunctors (such as variables) must be
converted to regular functors using a [FunctorADConverter.md].

## Example Syntax

In this example the functor, a constant value of 10, is defined using a [GenericFunctorMaterial.md].

!listing test/tests/fvbcs/fv_functor_dirichlet/fv_functor_dirichlet.i block=Materials

!listing test/tests/fvbcs/fv_functor_dirichlet/fv_functor_dirichlet.i block=FVBCs
Expand Down
2 changes: 1 addition & 1 deletion framework/include/fvbcs/FVFunctorDirichletBC.h
Expand Up @@ -22,5 +22,5 @@ class FVFunctorDirichletBC : public FVDirichletBCBase

private:
/// The value for this BC
const Moose::Functor<ADReal> & _functor;
const Moose::Functor<Real> & _functor;
};
4 changes: 2 additions & 2 deletions framework/src/fvbcs/FVFunctorDirichletBC.C
Expand Up @@ -22,12 +22,12 @@ FVFunctorDirichletBC::validParams()
}

FVFunctorDirichletBC::FVFunctorDirichletBC(const InputParameters & parameters)
: FVDirichletBCBase(parameters), _functor(getFunctor<ADReal>("functor"))
: FVDirichletBCBase(parameters), _functor(getFunctor<Real>("functor"))
{
}

Real
FVFunctorDirichletBC::boundaryValue(const FaceInfo & fi) const
{
return MetaPhysicL::raw_value(_functor(singleSidedFaceArg(&fi)));
return _functor(singleSidedFaceArg(&fi));
}
Expand Up @@ -38,7 +38,7 @@

[Materials]
[bc_value]
type = ADGenericFunctorMaterial
type = GenericFunctorMaterial
prop_names = bc_value
prop_values = 10
[]
Expand Down

0 comments on commit 69ac1c1

Please sign in to comment.