CG  Version 25
Cgasf.h
Go to the documentation of this file.
1 #ifndef CGASF_H
2 #define CGASF_H
3 
4 #include "DomainSolver.h"
5 
6 
7 // CG equation-domain solver for the All-Speed Navier-Stokes Equations
8 
9 class Cgasf : public DomainSolver
10 {
11 public:
12 
13 Cgasf(CompositeGrid & cg, GenericGraphicsInterface *ps=NULL, Ogshow *show=NULL, const int & plotOption=1 );
14 
15 
16 virtual ~Cgasf();
17 
18 
19 virtual void
20 addAllSpeedImplicitForcing( realMappedGridFunction & u0, const real t, const real deltaT, int grid );
21 
22 virtual
23 void addForcing(realMappedGridFunction & dvdt, const realMappedGridFunction & u, int iparam[], real rparam[],
24  realMappedGridFunction & dvdtImplicit = Overture::nullRealMappedGridFunction(),
25  realMappedGridFunction *referenceFrameVelocity=NULL );
26 
27 virtual void
28 addForcingToPressureEquation( const int & grid,
29  MappedGrid & c,
30  realMappedGridFunction & f,
31  realMappedGridFunction & gridVelocity,
32  const real & t );
33 
34 virtual void
36  real & t,
37  real & dt0,
38  int & numberOfSubSteps,
39  const real & nextTimeToPrint );
40 
41 virtual int
43  const int & option =-1,
44  int grid_= -1,
45  GridFunction *puOld=NULL,
46  const real & dt =-1. );
47 virtual int
48 applyBoundaryConditions(const real & t, realMappedGridFunction & u,
49  realMappedGridFunction & gridVelocity,
50  const int & grid,
51  const int & option=-1,
52  realMappedGridFunction *puOld=NULL,
53  realMappedGridFunction *pGridVelocityOld=NULL,
54  const real & dt=-1.);
55 
56 virtual void
58 
59 // virtual int
60 // applyBoundaryConditionsForImplicitTimeStepping(realMappedGridFunction & rhs,
61 // realMappedGridFunction & uL,
62 // realMappedGridFunction & gridVelocity,
63 // real t,
64 // int scalarSystem,
65 // int grid );
66 
67 virtual int
68 buildTimeSteppingDialog(DialogData & dialog );
69 
70 // virtual void getUt( GridFunction & cgf,
71 // const real & t,
72 // RealCompositeGridFunction & ut,
73 // real tForce );
74 
75 virtual void
76 computeSource(const Index & I1,
77  const Index & I2,
78  const Index & I3,
79  const realArray & v,
80  const realArray & s1,
81  const realArray & s2,
82  const realArray & gam,
83  const realArray & cp,
84  const realArray & r );
85 
86 virtual void
87 formAllSpeedPressureEquation( GridFunction & gf0, real t, real deltaT,
88  const bool & formSteadyEquation =false );
89 
90 // virtual int
91 // formImplicitTimeSteppingMatrix(realMappedGridFunction & coeff,
92 // const real & dt0,
93 // int scalarSystem,
94 // realMappedGridFunction & uL,
95 // const int & grid );
96 
97 // Return the list of interface data needed by a given interface:
98 virtual int
99 getInterfaceDataOptions( GridFaceDescriptor & info, int & interfaceDataOptions ) const;
100 
101 virtual int
102 getUt(const realMappedGridFunction & v,
103  const realMappedGridFunction & gridVelocity,
104  realMappedGridFunction & dvdt,
105  int iparam[], real rparam[],
106  realMappedGridFunction & dvdtImplicit = Overture::nullRealMappedGridFunction(),
107  MappedGrid *pmg2=NULL,
108  const realMappedGridFunction *pGridVelocity2= NULL);
109 
110 
111 virtual void
112 getTimeSteppingEigenvalue(MappedGrid & mg,
113  realMappedGridFunction & u,
114  realMappedGridFunction & gridVelocity,
115  real & reLambda,
116  real & imLambda,
117  const int & grid);
118 virtual int
119 getTimeSteppingOption(const aString & answer,
120  DialogData & dialog );
121 
122 void
123 gridAccelerationBC(const int & grid,
124  const real & t0,
125  GridFunction & gf0,
126  realCompositeGridFunction & f0,
127  int side,
128  int axis );
129 // virtual void
130 // gridAccelerationBC(const int & grid,
131 // const real & t0,
132 // MappedGrid & c,
133 // realMappedGridFunction & u ,
134 // realMappedGridFunction & f ,
135 // realMappedGridFunction & gridVelocity ,
136 // realSerialArray & normal,
137 // const Index & I1,
138 // const Index & I2,
139 // const Index & I3,
140 // const Index & I1g,
141 // const Index & I2g,
142 // const Index & I3g,
143 // int side,
144 // int axis );
145 
146 virtual int
148 
149 virtual int
151  int interfaceDataOptions,
152  GridFaceDescriptor & info,
153  GridFaceDescriptor & gfd,
154  int gfIndex, real t );
155 
156 virtual real
157 maxMachNumber( realMappedGridFunction & u );
158 
159 virtual void
160 printTimeStepInfo( const int & step, const real & t, const real & cpuTime );
161 
162 virtual int
163 setupPde(aString & reactionName,bool restartChosen, IntegerArray & originalBoundaryCondition);
164 
165 virtual void
166 solveForAllSpeedPressure( real t, real deltaT, const real & dtRatio );
167 
168 virtual void
169 solveForTimeIndependentVariables( GridFunction & cgf, bool updateSolutionDependentEquations=false );
170 
171 virtual int
173 
174 // virtual int
175 // updateStateVariables(GridFunction & cgf);
176 
177 virtual int
178 updateToMatchGrid(CompositeGrid & cg);
179 
180 virtual int
182 
183 virtual int
184 setPlotTitle(const real &t, const real &dt);
185 
186 virtual void
187 saveShowFileComments( Ogshow &show );
188 virtual void writeParameterSummary( FILE * file );
189 
190 protected:
191 
192 std::vector<real> gridMachNumber;
193 
196 
197 private:
198 
199 
200 };
201 
202 #endif