DAResidualSimpleFoam.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 DASimpleFoam
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAResidualSimpleFoam_H
12 #define DAResidualSimpleFoam_H
13 
14 #include "DAResidual.H"
15 #include "addToRunTimeSelectionTable.H"
16 #include "simpleControl.H"
17 #include "adjustPhi.H"
18 #include "constrainPressure.H"
19 
20 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
21 
22 namespace Foam
23 {
24 
25 /*---------------------------------------------------------------------------*\
26  Class DAResidualSimpleFoam Declaration
27 \*---------------------------------------------------------------------------*/
28 
30  : public DAResidual
31 {
32 protected:
34 
35  volVectorField& U_;
36  volVectorField URes_;
37 
38  volScalarField& p_;
39  volScalarField pRes_;
40 
41  surfaceScalarField& phi_;
42  surfaceScalarField phiRes_;
44 
46  volScalarField& alphaPorosity_;
47 
49  volVectorField& fvSource_;
50 
52  fv::options& fvOptions_;
53 
56 
58  simpleControl simple_;
59 
62 
64  label hasFvSource_ = 0;
65 
66 public:
67  TypeName("DASimpleFoam");
68  // Constructors
69 
70  //- Construct from components
72  const word modelType,
73  const fvMesh& mesh,
74  const DAOption& daOption,
75  const DAModel& daModel,
76  const DAIndex& daIndex);
77 
78  //- Destructor
80  {
81  }
82 
83  // Members
84 
86  virtual void clear();
87 
89  virtual void calcResiduals(const dictionary& options);
90 
92  virtual void updateIntermediateVariables();
93 
95  virtual void correctBoundaryConditions();
96 };
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #endif
105 
106 // ************************************************************************* //
Foam::DAResidualSimpleFoam::~DAResidualSimpleFoam
virtual ~DAResidualSimpleFoam()
Definition: DAResidualSimpleFoam.H:79
Foam::DAResidualSimpleFoam::calcResiduals
virtual void calcResiduals(const dictionary &options)
compute residual
Definition: DAResidualSimpleFoam.C:72
Foam::DAResidualSimpleFoam::alphaPorosity_
volScalarField & alphaPorosity_
alpha porosity term
Definition: DAResidualSimpleFoam.H:46
Foam::DAResidualSimpleFoam::updateIntermediateVariables
virtual void updateIntermediateVariables()
update any intermediate variables that are dependent on state variables and are used in calcResiduals
Definition: DAResidualSimpleFoam.C:174
Foam::DAResidualSimpleFoam::p_
volScalarField & p_
Definition: DAResidualSimpleFoam.H:38
Foam::DAResidualSimpleFoam::TypeName
TypeName("DASimpleFoam")
Foam::DAOption
Definition: DAOption.H:29
Foam::DAResidualSimpleFoam::correctBoundaryConditions
virtual void correctBoundaryConditions()
update the boundary condition for all the states in the selected solver
Definition: DAResidualSimpleFoam.C:185
Foam::DAResidualSimpleFoam::hasFvSource_
label hasFvSource_
whether to have fvSource term
Definition: DAResidualSimpleFoam.H:64
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAResidualSimpleFoam::URes_
volVectorField URes_
Definition: DAResidualSimpleFoam.H:36
Foam::DAResidualSimpleFoam::fvSource_
volVectorField & fvSource_
fvSource term
Definition: DAResidualSimpleFoam.H:49
Foam::DAResidualSimpleFoam::simple_
simpleControl simple_
simpleControl object which will be initialized in this class
Definition: DAResidualSimpleFoam.H:58
DAResidual.H
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAResidualSimpleFoam::DAResidualSimpleFoam
DAResidualSimpleFoam(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
Definition: DAResidualSimpleFoam.C:19
Foam::DAResidualSimpleFoam::MRF_
IOMRFZoneListDF & MRF_
Multiple Reference Frame.
Definition: DAResidualSimpleFoam.H:61
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::IOMRFZoneListDF
Definition: IOMRFZoneListDF.H:49
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DAResidualSimpleFoam
Definition: DAResidualSimpleFoam.H:29
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
daModel
DAModel daModel(mesh, daOption)
Foam::DAResidualSimpleFoam::clear
virtual void clear()
clear the members
Definition: DAResidualSimpleFoam.C:59
Foam::DAResidualSimpleFoam::daTurb_
DATurbulenceModel & daTurb_
DATurbulenceModel object.
Definition: DAResidualSimpleFoam.H:55
daIndex
DAIndex daIndex(mesh, daOption, daModel)
Foam::DAResidualSimpleFoam::phiRes_
surfaceScalarField phiRes_
Definition: DAResidualSimpleFoam.H:42
Foam::DAResidualSimpleFoam::U_
volVectorField & U_
Definition: DAResidualSimpleFoam.H:35
Foam::DAResidualSimpleFoam::fvOptions_
fv::options & fvOptions_
fvOptions term
Definition: DAResidualSimpleFoam.H:52
Foam::DAResidualSimpleFoam::phi_
surfaceScalarField & phi_
Definition: DAResidualSimpleFoam.H:41
Foam::DAResidualSimpleFoam::pRes_
volScalarField pRes_
Definition: DAResidualSimpleFoam.H:39