chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
EBHelmholtzDomainBC Class Referenceabstract

Base class for passing domain boundary conditions into EBHelmholtzOp. More...

#include <CD_EBHelmholtzDomainBC.H>

Inheritance diagram for EBHelmholtzDomainBC:
Inheritance graph
[legend]

Public Member Functions

 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.
 
EBHelmholtzDomainBCoperator= (const EBHelmholtzDomainBC &a_other)=delete
 Disallowed - don't see why you would need it.
 
EBHelmholtzDomainBCoperator= (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.
 

Protected Member Functions

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 Protected Member Functions

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.
 

Protected Attributes

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 Protected Attributes

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.
 

Detailed Description

Base class for passing domain boundary conditions into EBHelmholtzOp.

Member Function Documentation

◆ define()

void EBHelmholtzDomainBC::define ( const Location::Cell  a_dataLocation,
const EBLevelGrid &  a_eblg,
const RealVect &  a_probLo,
const Real  a_dx 
)
virtual

Define function.

Parameters
[in]a_eblgLevel grids
[in]a_probLoLower-left corner of computational domain
[in]a_dxGrid resolution
Note
This sets the internals for the BC object. This is called by EBHelmholtzOp when it defines stencils.
Parameters
[in]a_dataLocationDescription

Reimplemented in EBHelmholtzElectrostaticDomainBC, and EBHelmholtzEddingtonSP1DomainBC.

◆ 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_ivGrid cell
[in]a_dirFace coordinate direction
[in]a_sideLo/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_dirCoordinate direction of the face.
[in]a_sideHigh 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

Get face flux. This is for regular cells.

Parameters
[in,out]a_faceFluxFace-centered flux.
[in]a_phiCell-centered data
[in]a_BcoefFace-centered B-coefficient
[in]a_dirCoordinate direction
[in]a_sideHigh or low side
[in]a_ditData index
[in]a_useHomogeneousHomogeneous physical BCs or not.
Note
a_faceFlux is defined in the first strip of interior cells on the (dir,side) edge of the domain.

Implemented in EBHelmholtzDirichletDomainBC, EBHelmholtzNeumannDomainBC, EBHelmholtzRobinDomainBC, EBHelmholtzElectrostaticDomainBC, and EBHelmholtzEddingtonSP1DomainBC.

◆ 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

Get face flux. This is for irregular cells.

Parameters
[in]a_vofGrid cell
[in]a_phiCell-centered data
[in]a_BcoefFace-centered B-coefficient
[in]a_dirCoordinate direction
[in]a_sideHigh or low side
[in]a_ditData index
[in]a_useHomogeneousHomogeneous physical BCs or not.
Returns
Face flux

Implemented in EBHelmholtzDirichletDomainBC, EBHelmholtzNeumannDomainBC, EBHelmholtzRobinDomainBC, EBHelmholtzElectrostaticDomainBC, and EBHelmholtzEddingtonSP1DomainBC.

◆ 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_fluxOn input, contains dphi/dn. On output, contains B*dphi/dn
[in]a_bcoHelmholtz B-coefficient
[in]a_dirCoordinate direction
[in]a_sideSide
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: