Mushy Layer  1.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PhysBCUtil Class Reference

Big class to encapsulate physical boundary conditions. More...

#include <PhysBCUtil.H>

Public Types

enum  VelBCType {
  bogusBC = -1, SolidWall, Inflow, Outflow,
  OutflowNormal, VelInflowOutflow, noShear, Symmetry,
  VelInflowPlume, OutflowPressureGrad, PressureHead, NUM_PHYS_BC_TYPES
}
 Different types of velocity boundary conditions. More...
 
enum  scalarBCType {
  Dirichlet, Neumann, InflowOutflow, OnlyInflow,
  Robin, VariableFlux, FixedTemperature, TemperatureFlux,
  TemperatureFluxRadiation, MixedBCTemperatureSalinity
}
 Different options for scalar boundary conditions. More...
 

Public Member Functions

 PhysBCUtil (MushyLayerParams a_params, Real a_dx)
 
virtual PhysBCUtilnewPhysBCUtil () const
 "virtual" constructor
 
virtual Tuple< BCHolder, SpaceDimtracingVelFuncBC () const
 Returns velocity BC for tracing (inviscid)
 
virtual Tuple< BCHolder, SpaceDimadvectionVelFuncBC (bool a_isViscous) const
 Returns edge-centered vel BC for edge-ctrd vel (single component)
 
virtual Tuple< BCHolder, SpaceDimfluxExtrapBC () const
 Currently unused.
 
virtual Tuple< BCHolder, SpaceDimuStarFuncBC (bool a_isViscous=false) const
 BC holder for $ \mathbf{u}^* $.
 
virtual Tuple< BCHolder, SpaceDimedgeVelFuncBC (bool a_isViscous=false, LevelData< FluxBox > *velocityBCVals=NULL) const
 BC holder for $ \mathbf{u} $ (edge centred)
 
virtual Tuple< BCHolder, SpaceDimporosityFaceBC () const
 BC holder for porosity $ \chi $, (edge centred)
 
virtual Tuple< BCHolder, SpaceDimpermeabilityFaceBC () const
 BCs for permeability $ \Pi $ (edge centred)
 
virtual Tuple< BCHolder, SpaceDimvelExtrapBC (Interval ghostInterval=Interval(0, 0)) const
 BC holder for velocity $ \mathbf{u} $ - extrapolation.
 
virtual BCHolder viscousRefluxBC (int a_dir, bool a_isViscous=false) const
 Returns single-component BC for viscous refluxing solves.
 
virtual PhysIBCadvectionVelIBC () const
 
bool isDefined ()
 Is object defined?
 
void Dx (const Real a_dx)
 Sets the cell spacing $ \Delta x $.
 
void convertBCType (const int a_implicitBC, const Real a_implicitVal, int &a_explicitBC, Real &a_explicitVal) const
 Convert to AdvectIBC BCs.
 
int convertBCType (const int a_implicitBC) const
 Handy to have a function of this form, too.
 
Real Dx () const
 Returns cell spacing.
 
void Time (const Real a_time)
 Sets time.
 
void updateTimeDependentBCs ()
 Update time dependent BCs (e.g. after changing the time)
 
Real Time () const
 Returns current time.
 
void setAdvVel (LevelData< FluxBox > *a_advVel)
 Set pointer to advection velocity.
 
LevelData< FluxBox > * getAdvVel ()
 Get pointer to advection velocity.
 
virtual BCHolder LevelPressureFuncBC () const
 BC holder for pressure $ P $. More...
 
virtual BCHolder gradESyncFuncBC () const
 BC holder for synchronisation correction. More...
 
virtual BCHolder gradPiFuncBC () const
 BC holder for $ \nabla \Pi $.
 
virtual BCHolder extrapFuncBC () const
 Extrap BCs on all domain boundaries.
 
virtual BCHolder FreestreamCorrFuncBC () const
 BC holder for freestream correction. More...
 
virtual BCHolder SyncProjFuncBC () const
 BC holder for synchronisation projection. More...
 
virtual BCHolder gradMacPressureFuncBC () const
 BC holder for $ \nabla P $ in the MAC projection. More...
 
virtual BCHolder gradELambdaFuncBC () const
 BC holder for freestream preservation correction $ \nabla e_\lambda $. More...
 
virtual BCHolder velFuncBC (int a_dir, bool a_viscous, Interval interval=Interval(0, 0)) const
 returns single-component BC for viscous solves More...
 
virtual BCHolder extrapolationFuncBC (int a_order=0) const
 returns single-component BC More...
 
virtual BCHolder BasicGradPressureFuncBC () const
 BC holder for $ \nabla P $. More...
 
virtual BCHolder streamFunctionBC () const
 BCs for streamfunction.
 
virtual BCHolder BasicPressureFuncBC (bool a_isHomogeneous) const
 BC holder for pressure. More...
 
virtual BCHolder ThetaLFuncBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 BC holder for liquid concentration, $ \Theta_l $.
 
virtual BCHolder TracerBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL, Real a_boundaryVal=1.0) const
 
virtual BCHolder BasicthetaFuncBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 BC holder for temperature, $ \theta $.
 
virtual BCHolder BasicPorosityFuncBC (bool a_homogeneous=false) const
 BC holder for porosity, $ \chi $ (cell centred)
 
virtual BCHolder BasicPorosityFaceFuncBC (int a_comp, bool a_homogeneous=false) const
 BC holder for porosity, $ \chi $ (edge centred)
 
virtual BCHolder BasicPermeabilityFuncBC (bool a_homogeneous=false) const
 BC holder for permeability, $ \Pi $.
 
virtual BCHolder BasicPermeabilityFaceFuncBC (int a_comp, bool a_homogeneous=false) const
 BC holder for permeability, $ \Pi $ (edge centred)
 
virtual BCHolder BasicEnthalpyFuncBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 BC holder for enthalpy.
 
virtual BCHolder BasicLiquidusBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 Boundary conditions for calculating the liquidus.
 
virtual BCHolder BasicEutecticBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 Boundary conditions for calculating the eutectic.
 
virtual BCHolder BasicSolidusBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 Boundary conditions for calculating the solidus.
 
virtual BCHolder BasicScalarFuncBC (Real a_topVal, Real a_bottomVal, Real a_plumeVal, bool a_homogeneous=false) const
 BC holder for some generic scalar.
 
virtual BCHolder ThetaFuncBC (bool a_homogeneous=false, LevelData< FluxBox > *a_advVel=NULL) const
 BC holder for bulk concentration $ \Theta $.
 
virtual BCHolder lambdaBC (bool a_homogeneous=false, bool a_scaleWithPorosity=false) const
 BC holder for $ \lambda $ (for finding freestream preservation errors)
 
virtual BCHolder noFluxBC () const
 BCs for no flux boundaries.
 
virtual PhysIBCscalarTraceIBC (RealVect bcValLo, RealVect bcValHi, IntVect bcTypeLo, IntVect bcTypeHi, Real a_bcPlumeVal=0.0, Vector< Real > a_plumeBounds=Vector< Real >(0)) const
 Initial and Boundary Conditions for advecting scalars. More...
 
virtual PhysIBCscalarTraceHC_IBC () const
 For multi component enthalpy-salinity solve.
 
virtual PhysIBCscalarTraceH_IBC () const
 Boundary conditions for Enthalpy during advection solves.
 
virtual PhysIBCscalarTraceC_IBC () const
 Boundary conditions for Bulk Concentration during advection solves.
 
virtual PhysIBCscalarTrace_IBC (Vector< int > a_bcTypeHi, Vector< int > a_bcTypeLo, RealVect a_bcValHi, RealVect a_bcValLo, Real a_plumeInflow) const
 Generic boundary conditions for Bulk Concentration during advection solves.
 
void applyFrameAdvectionBC (IntVect &bcTypeHi, IntVect &bcTypeLo) const
 Apply frame advection BCs if appropriate.
 
virtual PhysIBCscalarTraceTSl_IBC () const
 For multi component enthalpy-salinity solve.
 
virtual BCHolder temperatureLiquidSalinityBC (bool a_homogeneous=false) const
 BC for object with two components: temperature and liquid salinity.
 
virtual BCHolder enthalpySalinityBC (bool a_homogeneous=false) const
 BC for object with two components: enthalpy and bulk salinity.
 
virtual BCHolder extrapVelFuncBC (int a_comp, Interval ghostInterval=Interval(0, 0)) const
 Apply extrapolation BCs to velocity.
 

Public Attributes

MushyLayerParams m_params
 Physical parameters for the system.
 

Protected Member Functions

virtual BCHolder basicECVelFuncBC (bool a_isHomogeneous, bool a_isViscous, int a_comp, const Interval &a_interval, LevelData< FluxBox > *a_velocityBCVals=NULL) const
 BCHolder for edge centred velocity.
 
virtual BCHolder basicCCVelFuncBC (bool a_isHomogeneous, bool a_isViscous, int a_velComponent, const Interval &a_interval) const
 returns a BCHolder for cell-centered velocity
 
virtual BCHolder extrapVelFuncInterior (bool a_isHomogeneous, int a_comp, const Interval &a_interval, int n_ghost) const
 Apply extrapolation BCs to velocity (interior ghost cells)
 
virtual void setBCs ()
 interact with ParmParse to set physical BC types
 

Protected Attributes

Tuple< int, SpaceDimm_loBC
 contains the enumerated values for the lo-end BC
 
Tuple< int, SpaceDimm_hiBC
 contains the enumerated values for the hi-end BC
 

Detailed Description

Big class to encapsulate physical boundary conditions.

Member Enumeration Documentation

◆ scalarBCType

Different options for scalar boundary conditions.

Enumerator
Dirichlet 

Fix value at boundary.

Neumann 

Fix gradient at boundary.

InflowOutflow 

Separate conditions for inflow and outflow regions.

Where there's inflow - dirichlet, where there's outflow - zero normal gradient

OnlyInflow 

Allow inflow but no outflow.

For e.g. a plume forced into the domain. Enforce dirichlet BCs everywhere, but with a different value for inflow vs outflow regions

Robin 

Robin.

Not implemented yet

VariableFlux 

Variable flux.

Flux which varies along the boundary

FixedTemperature 

Fixed temperature.

This is a special case for the heat equation, where we apply BCs to enthalpy and need to compute the boundary from the interior porosity and specified temperature

TemperatureFlux 

Temperature Flux.

BCs for enthalpy. Assume bulk concentration $ C_g $ in the ghost cell is equal to it's value in the interior of the domain (i.e. assume a no normal flux condition) then iteratively estimate the enthalpy $ H_g $ such that $ \frac{T_g(H_g,C_g) - T_{interior} }{\Delta x}= F $, in order to satisfy the temperature flux condition. Finally, set the enthalpy ghost value to $ H_g $.

$ a \frac{dT}{dz} - F_0 - b(T - T_{ref}) $

Only do this for $z>0.75$, otherwise, no flux.

TemperatureFluxRadiation 

Temperature flux + radiation.

MixedBCTemperatureSalinity 

Mixed BC for temperature/salinity.

BCs to apply to temperature $ \theta $ and liquid salinity $ \Theta_l $ fields

$ a \frac{d \theta}{dz} - F_0 - b(\theta - \theta_{ref}) = 0 $

The temperature ghost values are given by

$ \theta_g = \left( \frac{a}{\Delta x} - \frac{b}{2} \right)^{-1} \left[ \theta_i \left( \frac{a}{\Delta x} + \frac{b}{2} \right) + F_0 - b \theta_r \right] $

where $ \theta_i $ is the value on the interior side of the boundary.

The liquid salinity is given by $(\Theta_l)_g = - \theta_g$ if $0 < \chi < 1$, and $ (\Theta_l)_g = (\Theta_l)_i $ otherwise.

◆ VelBCType

Different types of velocity boundary conditions.

SolidWall - no normal flow, no transverse flow is viscous Inflow - Outflow - OutflowNormal - normal component has zero gradient at boundary, transverse component = 0 VelInflowOutflow - noShear - Symmetry -

Constructor & Destructor Documentation

◆ PhysBCUtil()

PhysBCUtil::PhysBCUtil ( MushyLayerParams  a_params,
Real  a_dx 
)

this will access the ParmParse database using the physBC prefix and use it to define the physical BC types (hi and lo) in each direction. The BC type "custom" will imply that the BC is a somewhat nonstandard one, but that the derived class will know what to do with it.

Member Function Documentation

◆ advectionVelIBC()

PhysIBC * PhysBCUtil::advectionVelIBC ( ) const
virtual

Returns a BC object compatible with AMRGodunov advection infrastructure. For use in the PatchGodunov stuff.

◆ BasicGradPressureFuncBC()

BCHolder PhysBCUtil::BasicGradPressureFuncBC ( ) const
virtual

BC holder for $ \nabla P $.

Extrapolation BCs on all boundaries

◆ BasicPressureFuncBC()

BCHolder PhysBCUtil::BasicPressureFuncBC ( bool  a_isHomogeneous) const
virtual

BC holder for pressure.

For subcycled code.

◆ extrapolationFuncBC()

BCHolder PhysBCUtil::extrapolationFuncBC ( int  a_order = 0) const
virtual

returns single-component BC

Be very careful with this function - it fills CF ghost cells.

Applies BCs to component in the Interval(a_dir, a_dir)returns multi-component BC for applying to fields which have been calculated Not for use when computing fields - use velFuncBC() for solves. 0th order extrapolation, also fills interior ghost cells

◆ FreestreamCorrFuncBC()

BCHolder PhysBCUtil::FreestreamCorrFuncBC ( ) const
virtual

BC holder for freestream correction.

No normal gradient, $ \mathbf{n} \cdot \nabla \phi = 0 $

◆ gradELambdaFuncBC()

BCHolder PhysBCUtil::gradELambdaFuncBC ( ) const
virtual

BC holder for freestream preservation correction $ \nabla e_\lambda $.

Same as for $ \nabla P $ in general

◆ gradESyncFuncBC()

BCHolder PhysBCUtil::gradESyncFuncBC ( ) const
virtual

BC holder for synchronisation correction.

Just use same BC as $ \nabla P $

◆ gradMacPressureFuncBC()

BCHolder PhysBCUtil::gradMacPressureFuncBC ( ) const
virtual

BC holder for $ \nabla P $ in the MAC projection.

Same as for $ \nabla P $ in general

◆ LevelPressureFuncBC()

BCHolder PhysBCUtil::LevelPressureFuncBC ( ) const
virtual

BC holder for pressure $ P $.

For subcycled code.

◆ scalarTraceIBC()

PhysIBC * PhysBCUtil::scalarTraceIBC ( RealVect  bcValLo,
RealVect  bcValHi,
IntVect  bcTypeLo,
IntVect  bcTypeHi,
Real  a_bcPlumeVal = 0.0,
Vector< Real a_plumeBounds = Vector<Real>(0) 
) const
virtual

Initial and Boundary Conditions for advecting scalars.

this is a BC object used in the PatchGodunov stuff

◆ SyncProjFuncBC()

BCHolder PhysBCUtil::SyncProjFuncBC ( ) const
virtual

BC holder for synchronisation projection.

Same BCs as for pressure

◆ velFuncBC()

BCHolder PhysBCUtil::velFuncBC ( int  a_dir,
bool  a_viscous,
Interval  interval = Interval(0,0) 
) const
virtual

returns single-component BC for viscous solves

Applies BCs to the component in the Interval(0,0)


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