DAResidualRhoSimpleFoam.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Child class for DARhoSimpleFoam
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAResidualRhoSimpleFoam_H
12 #define DAResidualRhoSimpleFoam_H
13 
14 #include "DAResidual.H"
15 #include "addToRunTimeSelectionTable.H"
16 #include "simpleControl.H"
17 #include "adjustPhi.H"
18 #include "thermodynamicConstants.H"
19 #include "pressureControl.H"
20 #include "constrainPressure.H"
21 
22 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
23 
24 namespace Foam
25 {
26 
27 /*---------------------------------------------------------------------------*\
28  Class DAResidualRhoSimpleFoam Declaration
29 \*---------------------------------------------------------------------------*/
30 
32  : public DAResidual
33 {
34 
35 protected:
37 
38  volVectorField& U_;
39  volVectorField URes_;
40 
41  volScalarField& p_;
42  volScalarField pRes_;
43 
44  volScalarField& T_;
45  volScalarField TRes_;
46 
47  surfaceScalarField& phi_;
48  surfaceScalarField phiRes_;
50 
52  volVectorField& fvSource_;
53 
55  volScalarField& fvSourceEnergy_;
56 
58  fv::options& fvOptions_;
59 
61  fluidThermo& thermo_;
62 
64 
65  volScalarField& he_;
66  volScalarField& rho_;
67  volScalarField& alphat_;
68  volScalarField& psi_;
70 
73 
75  simpleControl simple_;
76 
79 
82 
84 
85  scalar molWeight_;
86  scalar Cp_;
88 
90  label hasFvSource_ = 0;
91 
92 public:
93  TypeName("DARhoSimpleFoam");
94  // Constructors
95 
96  //- Construct from components
98  const word modelType,
99  const fvMesh& mesh,
100  const DAOption& daOption,
101  const DAModel& daModel,
102  const DAIndex& daIndex);
103 
104  //- Destructor
106  {
107  }
108 
109  // Members
110 
112  virtual void clear();
113 
115  virtual void calcResiduals(const dictionary& options);
116 
118  virtual void updateIntermediateVariables();
119 
121  virtual void correctBoundaryConditions();
122 };
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::DAResidualRhoSimpleFoam::hasFvSource_
label hasFvSource_
whether to have fvSource term
Definition: DAResidualRhoSimpleFoam.H:90
Foam::DAResidualRhoSimpleFoam::rho_
volScalarField & rho_
Definition: DAResidualRhoSimpleFoam.H:66
pressureControl
pressureControl & pressureControl
Definition: createRefsRhoSimpleC.H:12
Foam::DAResidualRhoSimpleFoam::p_
volScalarField & p_
Definition: DAResidualRhoSimpleFoam.H:41
Foam::DAResidualRhoSimpleFoam::molWeight_
scalar molWeight_
Definition: DAResidualRhoSimpleFoam.H:85
Foam::DAResidualRhoSimpleFoam::Cp_
scalar Cp_
Definition: DAResidualRhoSimpleFoam.H:86
Foam::DAOption
Definition: DAOption.H:29
Foam::DAResidualRhoSimpleFoam
Definition: DAResidualRhoSimpleFoam.H:31
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAResidualRhoSimpleFoam::TypeName
TypeName("DARhoSimpleFoam")
Foam::DAResidualRhoSimpleFoam::phi_
surfaceScalarField & phi_
Definition: DAResidualRhoSimpleFoam.H:47
Foam::DAResidualRhoSimpleFoam::MRF_
IOMRFZoneListDF & MRF_
Multiple Reference Frame.
Definition: DAResidualRhoSimpleFoam.H:81
Foam::DAResidualRhoSimpleFoam::fvOptions_
fv::options & fvOptions_
fvOptions term
Definition: DAResidualRhoSimpleFoam.H:58
DAResidual.H
Foam::DAResidualRhoSimpleFoam::URes_
volVectorField URes_
Definition: DAResidualRhoSimpleFoam.H:39
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAResidualRhoSimpleFoam::clear
virtual void clear()
clear the members
Definition: DAResidualRhoSimpleFoam.C:83
Foam::DAResidualRhoSimpleFoam::psi_
volScalarField & psi_
Definition: DAResidualRhoSimpleFoam.H:68
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAResidualRhoSimpleFoam::thermo_
fluidThermo & thermo_
thermophysical property
Definition: DAResidualRhoSimpleFoam.H:61
Foam::DAResidualRhoSimpleFoam::U_
volVectorField & U_
Definition: DAResidualRhoSimpleFoam.H:38
Foam::DAResidualRhoSimpleFoam::he_
volScalarField & he_
Definition: DAResidualRhoSimpleFoam.H:65
Foam::DAResidualRhoSimpleFoam::DAResidualRhoSimpleFoam
DAResidualRhoSimpleFoam(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
Definition: DAResidualRhoSimpleFoam.C:19
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAResidualRhoSimpleFoam::pressureControl_
pressureControl pressureControl_
pressureControl object to set ref pressure
Definition: DAResidualRhoSimpleFoam.H:78
Foam::DAResidualRhoSimpleFoam::alphat_
volScalarField & alphat_
Definition: DAResidualRhoSimpleFoam.H:67
Foam::IOMRFZoneListDF
Definition: IOMRFZoneListDF.H:49
Foam::DAResidualRhoSimpleFoam::~DAResidualRhoSimpleFoam
virtual ~DAResidualRhoSimpleFoam()
Definition: DAResidualRhoSimpleFoam.H:105
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DAResidualRhoSimpleFoam::fvSourceEnergy_
volScalarField & fvSourceEnergy_
fvSource term for the energy equation
Definition: DAResidualRhoSimpleFoam.H:55
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
Foam::DAResidualRhoSimpleFoam::T_
volScalarField & T_
Definition: DAResidualRhoSimpleFoam.H:44
Foam::DAResidualRhoSimpleFoam::correctBoundaryConditions
virtual void correctBoundaryConditions()
update the boundary condition for all the states in the selected solver
Definition: DAResidualRhoSimpleFoam.C:294
daModel
DAModel daModel(mesh, daOption)
daIndex
DAIndex daIndex(mesh, daOption, daModel)
Foam::DAResidualRhoSimpleFoam::phiRes_
surfaceScalarField phiRes_
Definition: DAResidualRhoSimpleFoam.H:48
Foam::DAResidualRhoSimpleFoam::daTurb_
DATurbulenceModel & daTurb_
DATurbulenceModel object.
Definition: DAResidualRhoSimpleFoam.H:72
Foam::DAResidualRhoSimpleFoam::updateIntermediateVariables
virtual void updateIntermediateVariables()
update any intermediate variables that are dependent on state variables and are used in calcResiduals
Definition: DAResidualRhoSimpleFoam.C:217
Foam::DAResidualRhoSimpleFoam::calcResiduals
virtual void calcResiduals(const dictionary &options)
compute residual
Definition: DAResidualRhoSimpleFoam.C:97
Foam::DAResidualRhoSimpleFoam::fvSource_
volVectorField & fvSource_
fvSource term
Definition: DAResidualRhoSimpleFoam.H:52
Foam::DAResidualRhoSimpleFoam::simple_
simpleControl simple_
simpleControl object which will be initialized in this class
Definition: DAResidualRhoSimpleFoam.H:75
Foam::DAResidualRhoSimpleFoam::TRes_
volScalarField TRes_
Definition: DAResidualRhoSimpleFoam.H:45
Foam::DAResidualRhoSimpleFoam::pRes_
volScalarField pRes_
Definition: DAResidualRhoSimpleFoam.H:42