DAPimpleDyMFoam.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Child class for DAPimpleDyMFoam
8 
9  This class is modified from OpenFOAM's source code
10  applications/solvers/incompressible/pimpleFoam
11 
12  OpenFOAM: The Open Source CFD Toolbox
13 
14  Copyright (C): 2011-2016 OpenFOAM Foundation
15 
16  OpenFOAM License:
17 
18  OpenFOAM is free software: you can redistribute it and/or modify it
19  under the terms of the GNU General Public License as published by
20  the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
24  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26  for more details.
27 
28  You should have received a copy of the GNU General Public License
29  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef DAPimpleDyMFoam_H
34 #define DAPimpleDyMFoam_H
35 
36 #include "DASolver.H"
37 #include "addToRunTimeSelectionTable.H"
38 #include "singlePhaseTransportModel.H"
39 #include "turbulentTransportModel.H"
40 #include "pimpleControlDF.H"
41 #include "DAFvSource.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class DAPimpleDyMFoam Declaration
50 \*---------------------------------------------------------------------------*/
51 
53  : public DASolver
54 {
55 
56 protected:
58  autoPtr<pimpleControlDF> pimplePtr_;
59 
61  autoPtr<volScalarField> pPtr_;
62 
64  autoPtr<volVectorField> UPtr_;
65 
67  autoPtr<surfaceScalarField> phiPtr_;
68 
70  autoPtr<singlePhaseTransportModel> laminarTransportPtr_;
71 
73  autoPtr<incompressible::turbulenceModel> turbulencePtr_;
74 
76  autoPtr<DATurbulenceModel> daTurbulenceModelPtr_;
77 
79  autoPtr<DAFvSource> daFvSourcePtr_;
80 
82  autoPtr<volVectorField> fvSourcePtr_;
83 
85  label hasFvSource_ = 0;
86 
88  scalar cumulativeContErr_ = 0.0;
89 
91  label pRefCell_ = 0;
92 
94  scalar pRefValue_ = 0.0;
95 
97  label IOInterval_ = 1;
98 
101 
103  autoPtr<dimensionedScalar> PrPtr_;
104 
106  autoPtr<dimensionedScalar> PrtPtr_;
107 
109  autoPtr<volScalarField> TPtr_;
110 
112  autoPtr<volScalarField> alphatPtr_;
113 
114  autoPtr<surfaceVectorField> UfPtr_;
115 
117  label hasTField_;
118 
119  bool correctPhi = true;
120 
121  bool checkMeshCourantNo = false;
122 
124 
125 public:
126  TypeName("DAPimpleDyMFoam");
127  // Constructors
128 
129  //- Construct from components
131  char* argsAll,
132  PyObject* pyOptions);
133 
134  //- Destructor
136  {
137  }
138 
140  virtual void initSolver();
141 
143  virtual label solvePrimal();
144 
146  void correctUfPimpleDyM(
147  surfaceVectorField& Uf,
148  const volVectorField& U,
149  const surfaceScalarField& phi);
150 
152  void correctUphiBCsDF(
153  volVectorField& U,
154  surfaceScalarField& phi);
155 
157  void CorrectPhiDF(
158  volVectorField& U,
159  surfaceScalarField& phi,
160  const volScalarField& p,
161  const dimensionedScalar& rAUf,
163 };
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
Foam::DAPimpleDyMFoam::PrPtr_
autoPtr< dimensionedScalar > PrPtr_
Prandtl number pointer.
Definition: DAPimpleDyMFoam.H:103
U
volVectorField & U
Definition: createRefsPimpleDyM.H:7
pimple
pimpleControlDF & pimple
Definition: createRefsPimpleDyM.H:5
Foam::DAPimpleDyMFoam::UfPtr_
autoPtr< surfaceVectorField > UfPtr_
Definition: DAPimpleDyMFoam.H:114
Foam::DAPimpleDyMFoam::cumulativeContErr_
scalar cumulativeContErr_
continuity error
Definition: DAPimpleDyMFoam.H:88
Foam::DAPimpleDyMFoam::TypeName
TypeName("DAPimpleDyMFoam")
Foam::DAPimpleDyMFoam::turbulencePtr_
autoPtr< incompressible::turbulenceModel > turbulencePtr_
turbulence pointer
Definition: DAPimpleDyMFoam.H:73
Foam::pimpleControlDF
Definition: pimpleControlDF.H:51
Foam::DAPimpleDyMFoam::pimplePtr_
autoPtr< pimpleControlDF > pimplePtr_
pimple pointer
Definition: DAPimpleDyMFoam.H:58
Foam::DAPimpleDyMFoam::laminarTransportPtr_
autoPtr< singlePhaseTransportModel > laminarTransportPtr_
laminar transport properties pointer
Definition: DAPimpleDyMFoam.H:70
Foam::DASolver
Definition: DASolver.H:54
Foam::DAPimpleDyMFoam::correctUphiBCsDF
void correctUphiBCsDF(volVectorField &U, surfaceScalarField &phi)
custom correctUphiBCs for DAFoam
Definition: DAPimpleDyMFoam.C:299
Foam::DAPimpleDyMFoam::pPtr_
autoPtr< volScalarField > pPtr_
pressure field pointer
Definition: DAPimpleDyMFoam.H:61
Foam::DAPimpleDyMFoam::checkMeshCourantNo
bool checkMeshCourantNo
Definition: DAPimpleDyMFoam.H:121
Foam::DAPimpleDyMFoam::correctPhi
bool correctPhi
Definition: DAPimpleDyMFoam.H:119
DAFvSource.H
Foam::DAPimpleDyMFoam::phiPtr_
autoPtr< surfaceScalarField > phiPtr_
surface flux field pointer
Definition: DAPimpleDyMFoam.H:67
Foam::DAPimpleDyMFoam::IOInterval_
label IOInterval_
the primal IO interval
Definition: DAPimpleDyMFoam.H:97
Foam::DAPimpleDyMFoam::UPtr_
autoPtr< volVectorField > UPtr_
velocity field pointer
Definition: DAPimpleDyMFoam.H:64
Foam::DAPimpleDyMFoam::moveMeshOuterCorrectors
bool moveMeshOuterCorrectors
Definition: DAPimpleDyMFoam.H:123
Foam::DAPimpleDyMFoam::CorrectPhiDF
void CorrectPhiDF(volVectorField &U, surfaceScalarField &phi, const volScalarField &p, const dimensionedScalar &rAUf, pimpleControlDF &pimple)
custom CorrectPhi for DAFoam
Definition: DAPimpleDyMFoam.C:331
Foam::DAPimpleDyMFoam::pRefValue_
scalar pRefValue_
pressure reference value
Definition: DAPimpleDyMFoam.H:94
Foam::DAPimpleDyMFoam::daFvSourcePtr_
autoPtr< DAFvSource > daFvSourcePtr_
DASource pointer.
Definition: DAPimpleDyMFoam.H:79
p
volScalarField & p
Definition: createRefsPimpleDyM.H:6
Foam::DAPimpleDyMFoam::daTurbulenceModelPtr_
autoPtr< DATurbulenceModel > daTurbulenceModelPtr_
DATurbulenceModel pointer.
Definition: DAPimpleDyMFoam.H:76
Foam::DAPimpleDyMFoam::hasFvSource_
label hasFvSource_
whether to have fvSource term
Definition: DAPimpleDyMFoam.H:85
Foam::DAPimpleDyMFoam::initSolver
virtual void initSolver()
initialize fields and variables
Definition: DAPimpleDyMFoam.C:65
pimpleControlDF.H
Foam::DAPimpleDyMFoam::solvePrimal
virtual label solvePrimal()
solve the primal equations
Definition: DAPimpleDyMFoam.C:118
phi
surfaceScalarField & phi
Definition: createRefsPimpleDyM.H:8
Foam
Definition: checkGeometry.C:32
Foam::DAPimpleDyMFoam::correctUfPimpleDyM
void correctUfPimpleDyM(surfaceVectorField &Uf, const volVectorField &U, const surfaceScalarField &phi)
custom CorrectUf function for DAFoam
Definition: DAPimpleDyMFoam.C:284
Foam::DAPimpleDyMFoam::pRefCell_
label pRefCell_
pressure referefence cell id
Definition: DAPimpleDyMFoam.H:91
Foam::DAPimpleDyMFoam::DAPimpleDyMFoam
DAPimpleDyMFoam(char *argsAll, PyObject *pyOptions)
Definition: DAPimpleDyMFoam.C:41
Foam::DAPimpleDyMFoam::hasTField_
label hasTField_
whether to have the temperature field
Definition: DAPimpleDyMFoam.H:117
Foam::DAPimpleDyMFoam::fvSourcePtr_
autoPtr< volVectorField > fvSourcePtr_
fvSource term
Definition: DAPimpleDyMFoam.H:82
Foam::DAPimpleDyMFoam::reduceIOWriteMesh_
label reduceIOWriteMesh_
whether to write mesh for the reduceIO
Definition: DAPimpleDyMFoam.H:100
Uf
surfaceVectorField & Uf
Definition: createRefsPimpleDyM.H:15
Foam::DAPimpleDyMFoam::TPtr_
autoPtr< volScalarField > TPtr_
temperature field pointer
Definition: DAPimpleDyMFoam.H:109
Foam::DAPimpleDyMFoam::alphatPtr_
autoPtr< volScalarField > alphatPtr_
thermal diffusivity field pointer
Definition: DAPimpleDyMFoam.H:112
Foam::DAPimpleDyMFoam::~DAPimpleDyMFoam
virtual ~DAPimpleDyMFoam()
Definition: DAPimpleDyMFoam.H:135
DASolver.H
Foam::DAPimpleDyMFoam::PrtPtr_
autoPtr< dimensionedScalar > PrtPtr_
Turbulence Prandtl pointer.
Definition: DAPimpleDyMFoam.H:106
Foam::DAPimpleDyMFoam
Definition: DAPimpleDyMFoam.H:52