Chombo + EB + MF  3.2
WaveIBC.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _WAVEIBC_H_
12 #define _WAVEIBC_H_
13 
14 #include <iostream>
15 
16 #include "LevelData.H"
17 #include "FArrayBox.H"
18 #include "Vector.H"
19 #include "RealVect.H"
20 #include "AMRIO.H"
21 #include "PhysIBC.H"
22 
23 #include "SolidBCF_F.H"
24 
25 #include "NamespaceHeader.H"
26 
27 /// Example of a sinusoidal plane wave plus a constant density
28 /**
29  Parameters:
30  a_smallPressure - Lower limit for pressure (returned)
31  a_gamma - Gamma for polytropic, gamma-law gas
32  a_ambientDensity - Ambient density add to the plane-wave
33  a_deltaDensity - Mean of the plane-wave
34  a_pressure - If 0, use isentropic pressure
35  if 1, use the constant pressure of 1.0
36  a_waveNumber - The wave number of the plane-wave
37  a_velocity - Initial velocity of the gas
38  a_center - Position of a maximum of the plane-wave
39  a_artvisc - Artificial viscosity coefficient
40  */
41 class WaveIBC: public PhysIBC
42 {
43 public:
44  /// Null constructor
45  /**
46  */
47  WaveIBC();
48 
49  /// Constructor which defines parameters used by Fortran routines
50  /**
51  */
52  WaveIBC(Real& a_smallPressure,
53  const Real& a_gamma,
54  const Real& a_ambientDensity,
55  const Real& a_deltaDensity,
56  const int& a_pressure,
57  const IntVect& a_waveNumber,
58  const RealVect& a_center,
59  const RealVect& a_velocity,
60  const Real& a_artvisc);
61 
62  /// Destructor
63  /**
64  */
65  virtual ~WaveIBC();
66 
67  /// Sets parameters in a common block used by Fortran routines
68  /**
69  */
70  void setFortranCommon(Real& a_smallPressure,
71  const Real& a_gamma,
72  const Real& a_ambientDensity,
73  const Real& a_deltaDensity,
74  const int& a_pressure,
75  const IntVect& a_waveNumber,
76  const RealVect& a_center,
77  const RealVect& a_velocity,
78  const Real& a_artvisc);
79 
80  /// Factory method - this object is its own factory
81  /**
82  Return a pointer to a new PhysIBC object with m_isDefined = false (i.e.,
83  its define() must be called before it is used) and m_isFortranCommonSet
84  set to value of m_isFortranCommonset in the current (factory) object.
85  */
87 
88  /// Set up initial conditions
89  /**
90  */
92 
93  /// Set boundary primitive values.
94  /**
95  */
96  void primBC(FArrayBox& a_WGdnv,
97  const FArrayBox& a_Wextrap,
98  const FArrayBox& a_W,
99  const int& a_dir,
100  const Side::LoHiSide& a_side,
101  const Real& a_time);
102 
103  /// Set boundary slopes
104  /**
105  The boundary slopes in a_dW are already set to one sided difference
106  approximations. If this function doesn't change them they will be
107  used for the slopes at the boundaries.
108  */
109  void setBdrySlopes(FArrayBox& a_dW,
110  const FArrayBox& a_W,
111  const int& a_dir,
112  const Real& a_time);
113 
114  /// Adjust boundary fluxes to account for artificial viscosity
115  /**
116  */
117  void artViscBC(FArrayBox& a_F,
118  const FArrayBox& a_U,
119  const FArrayBox& a_divVel,
120  const int& a_dir,
121  const Real& a_time);
122 
123 
124 protected:
125  // True if the Fortran common block has been set
127 };
128 
129 #include "NamespaceFooter.H"
130 
131 #endif
bool m_isFortranCommonSet
Definition: WaveIBC.H:126
void initialize(LevelData< FArrayBox > &a_U)
Set up initial conditions.
Example of a sinusoidal plane wave plus a constant density.
Definition: WaveIBC.H:41
void primBC(FArrayBox &a_WGdnv, const FArrayBox &a_Wextrap, const FArrayBox &a_W, const int &a_dir, const Side::LoHiSide &a_side, const Real &a_time)
Set boundary primitive values.
void setBdrySlopes(FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Real &a_time)
Set boundary slopes.
virtual ~WaveIBC()
Destructor.
double Real
Definition: REAL.H:33
WaveIBC()
Null constructor.
void artViscBC(FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const int &a_dir, const Real &a_time)
Adjust boundary fluxes to account for artificial viscosity.
LoHiSide
Definition: LoHiSide.H:27
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
PhysIBC * new_physIBC()
Factory method - this object is its own factory.
void setFortranCommon(Real &a_smallPressure, const Real &a_gamma, const Real &a_ambientDensity, const Real &a_deltaDensity, const int &a_pressure, const IntVect &a_waveNumber, const RealVect &a_center, const RealVect &a_velocity, const Real &a_artvisc)
Sets parameters in a common block used by Fortran routines.
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
Physical/domain initial and boundary conditions.
Definition: PhysIBC.H:33