Base class for passing domain boundary conditions into EBHelmholtzOp.
More...
#include <CD_EBHelmholtzDomainBC.H>
|
|
| EBHelmholtzDomainBC () |
| | Constructor.
|
| |
|
virtual | ~EBHelmholtzDomainBC () |
| | Destructor.
|
| |
|
| EBHelmholtzDomainBC (const EBHelmholtzDomainBC &a_other)=delete |
| | Disallowed – don't see why you would need it.
|
| |
|
| EBHelmholtzDomainBC (const EBHelmholtzDomainBC &&a_other)=delete |
| | Disallowed – don't see why you would need it.
|
| |
|
EBHelmholtzDomainBC & | operator= (const EBHelmholtzDomainBC &a_other)=delete |
| | Disallowed - don't see why you would need it.
|
| |
|
EBHelmholtzDomainBC & | operator= (const EBHelmholtzDomainBC &&a_other)=delete |
| | Disallowed - don't see why you would need it.
|
| |
| virtual void | define (const Location::Cell a_dataLocation, const EBLevelGrid &a_eblg, const RealVect &a_probLo, const Real a_dx) |
| | Define function.
|
| |
| virtual void | getFaceFlux (BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const BaseFab< Real > &a_Bcoef, const int &a_dir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const bool a_useHomogeneous) const =0 |
| | Get face flux. This is for regular cells.
|
| |
| virtual Real | getFaceFlux (const VolIndex &a_vof, const EBCellFAB &a_phi, const EBFaceFAB &a_Bcoef, const int &a_dir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const bool a_useHomogeneous) const =0 |
| | Get face flux. This is for irregular cells.
|
| |
| virtual Real | getDiagWeight (const int a_dir, const Side::LoHiSide a_side) const =0 |
| | Diagonal-weight multiplier for this boundary face's contribution to the relaxation diagonal.
|
| |
|
| RealVect | getBoundaryPosition (const IntVect &a_iv, const int &a_dir, const Side::LoHiSide &a_side) const |
| | Returns the cell-centered position at the boundary.
|
| |
|
| static void | multiplyByBcoef (BaseFab< Real > &a_flux, const BaseFab< Real > &a_bco, const int a_dir, const Side::LoHiSide a_side) |
| | Utility function which multiplies the flux (or actually, dphi/dn) by the B-coefficient. This is used by the implementation classes when they compute the regular flux at the domain edges/faces.
|
| |
|
|
Location::Cell | m_dataLocation |
| | Data centering.
|
| |
|
Real | m_dx |
| | Grid resolution.
|
| |
|
RealVect | m_probLo |
| | Lower-left corner of computational domain.
|
| |
|
EBLevelGrid | m_eblg |
| | Level grid.
|
| |
|
|
static constexpr int | m_comp = 0 |
| | Component that everything is defined for. Always have m_comp = 0.
|
| |
|
static constexpr int | m_nComp = 1 |
| | Number of components. Always have m_nComp = 1.
|
| |
Base class for passing domain boundary conditions into EBHelmholtzOp.
◆ define()
| void EBHelmholtzDomainBC::define |
( |
const Location::Cell |
a_dataLocation, |
|
|
const EBLevelGrid & |
a_eblg, |
|
|
const RealVect & |
a_probLo, |
|
|
const Real |
a_dx |
|
) |
| |
|
virtual |
◆ getBoundaryPosition()
| RealVect EBHelmholtzDomainBC::getBoundaryPosition |
( |
const IntVect & |
a_iv, |
|
|
const int & |
a_dir, |
|
|
const Side::LoHiSide & |
a_side |
|
) |
| const |
|
inlineprotected |
Returns the cell-centered position at the boundary.
- Parameters
-
| [in] | a_iv | Grid cell |
| [in] | a_dir | Face coordinate direction |
| [in] | a_side | Lo/Hi side |
- Returns
- Boundary position
◆ getDiagWeight()
| virtual Real EBHelmholtzDomainBC::getDiagWeight |
( |
const int |
a_dir, |
|
|
const Side::LoHiSide |
a_side |
|
) |
| const |
|
pure virtual |
Diagonal-weight multiplier for this boundary face's contribution to the relaxation diagonal.
EBHelmholtzOp::computeDiagWeight builds the relaxation diagonal (m_betaDiagWeight) by taking the interior stencil diagonal and, for each domain-boundary face, subtracting this weight times the area-fraction-weighted face B-coefficient, i.e. betaWeight -= getDiagWeight() * sum(areaFrac * B/dx^2). This weight is therefore the coefficient with which the boundary cell's own value phi_i enters the discretized boundary flux returned by getFaceFlux() – it is how strongly the boundary flux feeds back onto the diagonal. It is dimensionless and MUST be kept consistent with this subclass's getFaceFlux() discretization: the two encode the same boundary stencil, so if that discretization changes (e.g. a higher-order or centroid-based flux) this value must change with it.
How to choose it: read off the coefficient of phi_i in getFaceFlux(). For the shipped discretizations:
- Dirichlet -> 2. The boundary value sits half a cell from the cell centre, so the one-sided difference (phi_b - phi_i)/(dx/2) carries a factor of 2 on phi_i.
- Neumann -> 0. The flux is prescribed independently of phi_i, so it does not feed the diagonal.
This is pure virtual on purpose: every concrete domain BC must state its diagonal contribution explicitly, so a new BC cannot silently inherit a wrong value. Note this only affects the relaxation (smoother) diagonal, not the operator apply, so an inconsistent value degrades convergence rather than changing the converged solution.
- Parameters
-
| [in] | a_dir | Coordinate direction of the face. |
| [in] | a_side | High or low side. |
- Returns
- Multiplier applied to B·area/dx² when building the diagonal relaxation weight.
Implemented in EBHelmholtzElectrostaticDomainBC, EBHelmholtzDirichletDomainBC, EBHelmholtzNeumannDomainBC, EBHelmholtzRobinDomainBC, and EBHelmholtzEddingtonSP1DomainBC.
◆ getFaceFlux() [1/2]
| virtual void EBHelmholtzDomainBC::getFaceFlux |
( |
BaseFab< Real > & |
a_faceFlux, |
|
|
const BaseFab< Real > & |
a_phi, |
|
|
const BaseFab< Real > & |
a_Bcoef, |
|
|
const int & |
a_dir, |
|
|
const Side::LoHiSide & |
a_side, |
|
|
const DataIndex & |
a_dit, |
|
|
const bool |
a_useHomogeneous |
|
) |
| const |
|
pure virtual |
◆ getFaceFlux() [2/2]
| virtual Real EBHelmholtzDomainBC::getFaceFlux |
( |
const VolIndex & |
a_vof, |
|
|
const EBCellFAB & |
a_phi, |
|
|
const EBFaceFAB & |
a_Bcoef, |
|
|
const int & |
a_dir, |
|
|
const Side::LoHiSide & |
a_side, |
|
|
const DataIndex & |
a_dit, |
|
|
const bool |
a_useHomogeneous |
|
) |
| const |
|
pure virtual |
◆ multiplyByBcoef()
| void EBHelmholtzDomainBC::multiplyByBcoef |
( |
BaseFab< Real > & |
a_flux, |
|
|
const BaseFab< Real > & |
a_bco, |
|
|
const int |
a_dir, |
|
|
const Side::LoHiSide |
a_side |
|
) |
| |
|
staticprotected |
Utility function which multiplies the flux (or actually, dphi/dn) by the B-coefficient. This is used by the implementation classes when they compute the regular flux at the domain edges/faces.
- Parameters
-
| [in,out] | a_flux | On input, contains dphi/dn. On output, contains B*dphi/dn |
| [in] | a_bco | Helmholtz B-coefficient |
| [in] | a_dir | Coordinate direction |
| [in] | a_side | Side |
- Note
- This routine is weird because the flux data holder in the BC classes lives on the cell centers next to the domain face/edge. So we need to shift the box over when we multiply. Because both Dirichlet, Neumann, and the Robin Bcs need to do this, I'm putting this routine in the parent class.
The documentation for this class was generated from the following files: