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

Electrode boundary conditions on the EB faces for PetscHelmholtzOp, taken from ElectrostaticEbBc. More...

#include <CD_PetscHelmholtzElectrostaticEBBC.H>

Inheritance diagram for PetscHelmholtzElectrostaticEBBC:
Collaboration diagram for PetscHelmholtzElectrostaticEBBC:

Public Member Functions

 PetscHelmholtzElectrostaticEBBC ()=delete
 Disallowed default constructor.
 PetscHelmholtzElectrostaticEBBC (const ElectrostaticEbBc &a_electrostaticBCs) noexcept
 Full constructor. Must subsequently set the order and the weight, and call define.
virtual ~PetscHelmholtzElectrostaticEBBC () noexcept
 Destructor.
virtual Real getBoundaryData (const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept override
 Get the boundary data, i.e. the potential of the closest electrode.
Public Member Functions inherited from PetscHelmholtzDirichletEBBC
 PetscHelmholtzDirichletEBBC () noexcept
 Default constructor. Must subsequently set the value, the order and the weight, and call define.
virtual ~PetscHelmholtzDirichletEBBC () noexcept
 Destructor.
virtual void setValue (const Real a_value) noexcept
 Set a constant value on the EB.
virtual void setValue (const std::function< Real(const RealVect &a_pos)> &a_value) noexcept
 Set a spatially varying value on the EB.
virtual void getEBFluxStencil (Real &a_boundaryWeight, PetscStencil &a_stencil, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof) const noexcept override
 Get the flux through the EB face of a cut cell, without the b-coefficient and the face area.
Public Member Functions inherited from PetscHelmholtzEBBC
 PetscHelmholtzEBBC () noexcept
 Default constructor. Must subsequently set the order and the weight, and call define.
virtual ~PetscHelmholtzEBBC () 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 clear () noexcept
 Release the stored stencils, the grids and the interpolators, so that the object can be defined again, e.g. after a regrid.
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 Member Functions

virtual Real getElectrodePotential (const RealVect &a_pos) const noexcept
 Get the potential of the electrode closest to a position.
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.

Protected Attributes

ElectrostaticEbBc m_electrostaticBCs
 Electrode boundary conditions.
Protected Attributes inherited from PetscHelmholtzDirichletEBBC
bool m_useConstant
 Use the constant value or not.
bool m_useFunction
 Use the spatially varying value or not.
Real m_constantValue
 Constant value on the EB.
std::function< Real(const RealVect &a_pos)> m_functionValue
 Spatially varying value on the EB.
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.

Detailed Description

Electrode boundary conditions on the EB faces for PetscHelmholtzOp, taken from ElectrostaticEbBc.

This is a Dirichlet condition whose value on an EB face is the potential of the closest electrode, as in MFHelmholtzElectrostaticEBBC. The electrode potentials capture the time by reference, so time-dependent potentials enter through the right-hand side.

Constructor & Destructor Documentation

◆ PetscHelmholtzElectrostaticEBBC()

PetscHelmholtzElectrostaticEBBC::PetscHelmholtzElectrostaticEBBC ( const ElectrostaticEbBc & a_electrostaticBCs)
noexcept

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

Parameters
[in]a_electrostaticBCsElectrode boundary conditions

Member Function Documentation

◆ getBoundaryData()

Real PetscHelmholtzElectrostaticEBBC::getBoundaryData ( const int a_phase,
const int a_level,
const DataIndex & a_din,
const VolIndex & a_vof ) const
overridevirtualnoexcept

Get the boundary data, i.e. the potential of the closest electrode.

Parameters
[in]a_phasePhase
[in]a_levelGrid level
[in]a_dinGrid index on the level
[in]a_vofCut cell
Returns
The potential of the closest electrode, at the EB face centroid.

Reimplemented from PetscHelmholtzDirichletEBBC.

◆ getElectrodePotential()

Real PetscHelmholtzElectrostaticEBBC::getElectrodePotential ( const RealVect & a_pos) const
protectedvirtualnoexcept

Get the potential of the electrode closest to a position.

Parameters
[in]a_posPosition
Returns
The potential of the closest electrode.

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