chombo-discharge
Loading...
Searching...
No Matches
CD_EBHelmholtzEBBC.H
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7/*
8 @file CD_EBHelmholtzEBBC.H
9 @brief Declaration of a base boundary condition class for EB boundary conditions in EBHelmholtzOp
10 @author Robert Marskar
11*/
12
13#ifndef CD_EBHELMHOLTZEBBC_H
14#define CD_EBHELMHOLTZEBBC_H
15
16// Chombo includes
17#include <EBLevelGrid.H>
18#include <RefCountedPtr.H>
19#include <LevelData.H>
20#include <BaseIVFAB.H>
21
22// Our includes
23#include <CD_Location.H>
24#include <CD_NamespaceHeader.H>
25
30{
31public:
35 using AmrMask = RefCountedPtr<LevelData<BaseFab<bool>>>;
36
41
45 virtual ~EBHelmholtzEBBC();
46
50 EBHelmholtzEBBC(const EBHelmholtzEBBC& a_other) = delete;
51
56 operator=(const EBHelmholtzEBBC& a_other) = delete;
57
68 void
69 define(const Location::Cell a_dataLocation,
70 const EBLevelGrid& a_eblg,
71 const AmrMask& a_validCells,
72 const RealVect& a_probLo,
73 const Real& a_dx,
74 const int a_ghostCF);
75
86 virtual void
87 applyEBFlux(VoFIterator& a_vofit,
88 EBCellFAB& a_Lphi,
89 const EBCellFAB& a_phi,
90 const BaseIVFAB<Real>& a_Bcoef,
91 const DataIndex& a_dit,
92 const Real& a_beta,
93 const bool& a_homogeneousPhysBC) const = 0;
94
103 const LayoutData<BaseIVFAB<VoFStencil>>&
104 getGradPhiStencils() const;
105
106protected:
110 constexpr static int m_comp = 0;
111
115 constexpr static int m_nComp = 1;
116
121
126
130 Real m_dx;
131
135 RealVect m_probLo;
136
140 EBLevelGrid m_eblg;
141
145 RefCountedPtr<LevelData<BaseFab<bool>>> m_validCells;
146
150 LayoutData<BaseIVFAB<VoFStencil>> m_gradPhiStencils;
151
155 virtual void
156 define() = 0;
157
166 inline bool
167 isStencilValidCF(const VoFStencil& a_stencil, const DataIndex& a_dit) const;
168
175 inline RealVect
176 getBoundaryPosition(const VolIndex& a_vof, const DataIndex& a_dit) const;
177
184 inline Real
185 applyStencil(const VoFStencil& a_stencil, const EBCellFAB& a_phi) const;
186};
187
188#include <CD_NamespaceFooter.H>
189
190#include <CD_EBHelmholtzEBBCImplem.H>
191
192#endif
Declaration of cell positions.
Base class for passing EB boundary conditions into EBHelmholtzOp.
Definition CD_EBHelmholtzEBBC.H:30
Real applyStencil(const VoFStencil &a_stencil, const EBCellFAB &a_phi) const
Apply stencil to data holder and return result.
Definition CD_EBHelmholtzEBBCImplem.H:38
RefCountedPtr< LevelData< BaseFab< bool > > > AmrMask
Alias to cut down on typing.
Definition CD_EBHelmholtzEBBC.H:35
const LayoutData< BaseIVFAB< VoFStencil > > & getGradPhiStencils() const
Get the stencil for computing the finite-volume approximation to kappa*Div(F).
Definition CD_EBHelmholtzEBBC.cpp:58
EBLevelGrid m_eblg
Level grid.
Definition CD_EBHelmholtzEBBC.H:140
Location::Cell m_dataLocation
Data centering.
Definition CD_EBHelmholtzEBBC.H:120
int m_ghostCF
Number of ghost cells that were filled across CF interface.
Definition CD_EBHelmholtzEBBC.H:125
RealVect getBoundaryPosition(const VolIndex &a_vof, const DataIndex &a_dit) const
Returns physical position at the boundary.
Definition CD_EBHelmholtzEBBCImplem.H:24
RefCountedPtr< LevelData< BaseFab< bool > > > m_validCells
Valid grid cells.
Definition CD_EBHelmholtzEBBC.H:145
static constexpr int m_nComp
Number of components. Always have m_nComp = 1.
Definition CD_EBHelmholtzEBBC.H:115
EBHelmholtzEBBC(const EBHelmholtzEBBC &a_other)=delete
Disallowed – don't see why you would need it.
LayoutData< BaseIVFAB< VoFStencil > > m_gradPhiStencils
Stencils for computing the flux on a single level. This is a single-level object.
Definition CD_EBHelmholtzEBBC.H:150
RealVect m_probLo
Lower-left corner of computational domain.
Definition CD_EBHelmholtzEBBC.H:135
virtual void define()=0
User define function.
bool isStencilValidCF(const VoFStencil &a_stencil, const DataIndex &a_dit) const
Check if stencil is valid.
Definition CD_EBHelmholtzEBBCImplem.H:51
EBHelmholtzEBBC & operator=(const EBHelmholtzEBBC &a_other)=delete
Disallowed - don't see why you would need it.
virtual void applyEBFlux(VoFIterator &a_vofit, EBCellFAB &a_Lphi, const EBCellFAB &a_phi, const BaseIVFAB< Real > &a_Bcoef, const DataIndex &a_dit, const Real &a_beta, const bool &a_homogeneousPhysBC) const =0
Apply the EB flux. This is the version that is called by EBHelmholtzOp.
static constexpr int m_comp
Component that everything is defined for. Always have m_comp = 0.
Definition CD_EBHelmholtzEBBC.H:110
EBHelmholtzEBBC()
Default constructor.
Definition CD_EBHelmholtzEBBC.cpp:24
Real m_dx
Grid resolution.
Definition CD_EBHelmholtzEBBC.H:130
virtual ~EBHelmholtzEBBC()
Destructor.
Definition CD_EBHelmholtzEBBC.cpp:29
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31