chombo-discharge
Loading...
Searching...
No Matches
PetscHelmholtzSaturationChargeJumpBC Class Reference

The saturation charge condition D_p = 0 on the interface, on the side of one phase p, for PetscHelmholtzOp. More...

#include <CD_PetscHelmholtzSaturationChargeJumpBC.H>

Inheritance diagram for PetscHelmholtzSaturationChargeJumpBC:
Collaboration diagram for PetscHelmholtzSaturationChargeJumpBC:

Public Member Functions

 PetscHelmholtzSaturationChargeJumpBC ()=delete
 Disallowed default constructor.
 PetscHelmholtzSaturationChargeJumpBC (const phase::which_phase a_phase) noexcept
 Full constructor. Must subsequently set the order and the weight, and call define.
virtual ~PetscHelmholtzSaturationChargeJumpBC () noexcept
 Destructor.
virtual void clear () noexcept override
 Release the computed surface charge density, the stored stencils and the grids.
virtual void getInterfaceFluxStencil (Real &a_dataWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const IntVect &a_iv, const Real a_bCoefPhase0, const Real a_bCoefPhase1) const noexcept override
 Get the flux into one side of an interface cell, b_k * D_k, as a linear form.
virtual Real getJumpData (const int a_level, const DataIndex &a_din, const IntVect &a_iv, const EBAMRIVData &a_sigma) const noexcept override
 Get the jump data, which is zero: this closure has none.
virtual void updateJumpData (const Vec &a_phi, const MFAMRIVData &a_bCoefIrreg) noexcept override
 Compute the surface charge density from the solution, sigma = b_0 * D_0 + b_1 * D_1, into m_sigma.
virtual const EBAMRIVData & getSigma () const noexcept
 Get the surface charge density computed by the last call to updateJumpData.
Public Member Functions inherited from PetscHelmholtzJumpBC
 PetscHelmholtzJumpBC () noexcept
 Default constructor. Must subsequently set the order and the weight, and call define.
virtual ~PetscHelmholtzJumpBC () noexcept
 Destructor.
Public Member Functions inherited from PetscHelmholtzEBStencils
 PetscHelmholtzEBStencils () noexcept
 Default constructor. Must subsequently set the order and the weight, and call define.
virtual ~PetscHelmholtzEBStencils () noexcept
 Destructor.
 PetscHelmholtzEBStencils (const PetscHelmholtzEBStencils &a_other)=delete
 Disallowed copy constructor.
 PetscHelmholtzEBStencils (const PetscHelmholtzEBStencils &&a_other)=delete
 Disallowed move constructor.
PetscHelmholtzEBStencils & operator= (const PetscHelmholtzEBStencils &a_other)=delete
 Disallowed copy assignment operator.
PetscHelmholtzEBStencils & operator= (const PetscHelmholtzEBStencils &&a_other)=delete
 Disallowed move assignment operator.
virtual long long getNumCellsWithoutStencil () const noexcept
 Get the number of cut cells, summed over phases, levels and ranks, that have an EB face but no stencil.
virtual void setOrder (const int a_order) noexcept
 Set the order of the stencils.
virtual void setWeight (const int a_weight) noexcept
 Set the least-squares weighting.
virtual void define (const RefCountedPtr< PetscGrid > &a_petscGrid, const Vector< MFMultigridInterpolator > &a_interpolators, const RealVect &a_probLo, const Vector< Real > &a_dx) noexcept
 Define over the AMR hierarchy, and compute the one-sided normal derivative stencils of every cut cell.

Protected Attributes

phase::which_phase m_phase
 Phase on whose side the normal derivative is zero.
EBAMRIVData m_sigma
 The surface charge density computed from the solution by updateJumpData.
Protected Attributes inherited from PetscHelmholtzEBStencils
bool m_isDefined
 Is defined or not.
long long m_numCellsWithoutStencil
 Number of cut cells, summed over phases, levels and ranks, that have an EB face but no stencil.
bool m_verbose
 Verbose output or not.
int m_order
 Highest order of the stencils, or -1 if not set.
int m_weight
 Least-squares weighting, or -1 if not set.
RefCountedPtr< PetscGrid > m_petscGrid
 PETSc grid.
Vector< MFMultigridInterpolator > m_interpolators
 Coarse-fine ghost cell interpolators of both phases, on each level.
RealVect m_probLo
 Lower-left corner of the computational domain.
Vector< Real > m_dx
 Grid resolution on each level.
Vector< RefCountedPtr< LayoutData< BaseIVFAB< PetscStencil > > > > m_derivStencils [2]
 The stencils of the one-sided normal derivatives, over PETSc rows.
Vector< RefCountedPtr< LayoutData< BaseIVFAB< Real > > > > m_derivWeights [2]
 The weights w_B of the boundary value in the one-sided normal derivatives.

Additional Inherited Members

Protected Member Functions inherited from PetscHelmholtzEBStencils
virtual void getNormalDerivativeStencil (Real &a_boundaryWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept
 Get the stored one-sided normal derivative at the EB face of a cut cell.
virtual void computeNormalDerivativeStencil (Real &a_boundaryWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept
 Compute the one-sided normal derivative at the EB face of a cut cell.
virtual bool getLeastSquaresStencil (Real &a_boundaryWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const VofUtils::Neighborhood a_neighborhood, const int a_order) const noexcept
 Try to compute the one-sided normal derivative at the EB face of a cut cell, for one neighbourhood and one order.
virtual RealVect getBoundaryPosition (const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept
 Get the physical position of the centroid of the EB face of a cut cell.

Detailed Description

The saturation charge condition D_p = 0 on the interface, on the side of one phase p, for PetscHelmholtzOp.

The closure eliminates phi_B with phi_B = -sum_i w_p,i phi_p,i / w_B,p, so the flux into side p is zero, and the flux into the other side couples the rows of both phases. There is no jump data. The surface charge density is an output: updateJumpData computes it from the solution, sigma = b_0 * D_0 + b_1 * D_1, and keeps it in m_sigma, as MFHelmholtzSaturationChargeJumpBC does.

Constructor & Destructor Documentation

◆ PetscHelmholtzSaturationChargeJumpBC()

PetscHelmholtzSaturationChargeJumpBC::PetscHelmholtzSaturationChargeJumpBC ( const phase::which_phase a_phase)
noexcept

Full constructor. Must subsequently set the order and the weight, and call define.

Parameters
[in]a_phasePhase on whose side the normal derivative is zero

Member Function Documentation

◆ clear()

void PetscHelmholtzSaturationChargeJumpBC::clear ( )
overridevirtualnoexcept

Release the computed surface charge density, the stored stencils and the grids.

Reimplemented from PetscHelmholtzEBStencils.

◆ getInterfaceFluxStencil()

void PetscHelmholtzSaturationChargeJumpBC::getInterfaceFluxStencil ( Real & a_dataWeight,
PetscStencil & a_stencil,
const int a_phase,
const int a_level,
const DataIndex & a_din,
const IntVect & a_iv,
const Real a_bCoefPhase0,
const Real a_bCoefPhase1 ) const
overridevirtualnoexcept

Get the flux into one side of an interface cell, b_k * D_k, as a linear form.

Parameters
[out]a_dataWeightWeight w_g of the jump data, which is zero
[out]a_stencilStencil over PETSc rows of both phases
[in]a_phasePhase k of the side
[in]a_levelGrid level
[in]a_dinGrid index on the level
[in]a_ivInterface cell
[in]a_bCoefPhase0b-coefficient on the interface, on the side of phase 0
[in]a_bCoefPhase1b-coefficient on the interface, on the side of phase 1

Implements PetscHelmholtzJumpBC.

◆ getJumpData()

Real PetscHelmholtzSaturationChargeJumpBC::getJumpData ( const int a_level,
const DataIndex & a_din,
const IntVect & a_iv,
const EBAMRIVData & a_sigma ) const
overridevirtualnoexcept

Get the jump data, which is zero: this closure has none.

Parameters
[in]a_levelGrid level
[in]a_dinGrid index on the level
[in]a_ivInterface cell
[in]a_sigmaSurface charge density on the interface
Returns
Zero.

Implements PetscHelmholtzJumpBC.

◆ getSigma()

const EBAMRIVData & PetscHelmholtzSaturationChargeJumpBC::getSigma ( ) const
virtualnoexcept

Get the surface charge density computed by the last call to updateJumpData.

In the units of the jump condition, i.e. b * dphi/dn. Defined on the cut cells of the first phase, and zero on those that are not interface cells. Empty until updateJumpData has been called.

Returns
m_sigma

◆ updateJumpData()

void PetscHelmholtzSaturationChargeJumpBC::updateJumpData ( const Vec & a_phi,
const MFAMRIVData & a_bCoefIrreg )
overridevirtualnoexcept

Compute the surface charge density from the solution, sigma = b_0 * D_0 + b_1 * D_1, into m_sigma.

Parameters
[in]a_phiSolution, on the rows of the PETSc grid
[in]a_bCoefIrregb-coefficient on the EB faces

Implements PetscHelmholtzJumpBC.

Member Data Documentation

◆ m_sigma

EBAMRIVData PetscHelmholtzSaturationChargeJumpBC::m_sigma
protected

The surface charge density computed from the solution by updateJumpData.

Defined on the interface cells, per level.


The documentation for this class was generated from the following files: