Go to the documentation of this file.
33 #ifndef DASimpleFoam_H
34 #define DASimpleFoam_H
37 #include "addToRunTimeSelectionTable.H"
38 #include "singlePhaseTransportModel.H"
39 #include "turbulentTransportModel.H"
40 #include "simpleControl.H"
118 using Position =
typename codi::RealReverse::Tape::Position;
120 Position adjResStart_;
122 Position gradPStart_;
124 Position pEqnFluxStart_;
125 Position pEqnFluxEnd_;
126 Position divPhiStart_;
128 Position fluxUStart_;
144 PyObject* pyOptions);
164 const volVectorField& mySource,
169 const volScalarField& mySource,
174 volVectorField& URes,
175 volScalarField& pRes,
176 surfaceScalarField& phiRes);
182 volVectorField& UField,
183 volScalarField& pField,
184 surfaceScalarField& phiField,
185 volScalarField& nuTildaField);
188 volVectorField& URes,
189 volScalarField& pRes,
190 surfaceScalarField& phiRes,
191 volScalarField& nuTildaRes,
193 volVectorField& UPsi,
194 volScalarField& pPsi,
195 surfaceScalarField& phiPsi,
196 volScalarField& nuTildaPsi,
197 volVectorField& adjURes,
198 volScalarField& adjPRes,
199 surfaceScalarField& adjPhiRes,
200 volScalarField& adjNuTildaRes,
203 scalar
L2norm(
const volScalarField& v);
205 vector
L2norm(
const volVectorField&
U);
207 scalar
L2norm(
const surfaceScalarField& Phi);
209 void swap(List<scalar>& a, List<scalar>& b);
autoPtr< surfaceScalarField > phiPtr_
surface flux field pointer
DASimpleFoam(char *argsAll, PyObject *pyOptions)
scalar relaxUEqn_
fvSolution parameters for fixed-point adjoint
void swap(List< scalar > &a, List< scalar > &b)
label pRefCell_
pressure referefence cell id
volScalarField pseudoP("pseudoP", p)
void invTranProdUEqn(const volVectorField &mySource, volVectorField &pseudoU)
Inverse transpose product, MU^(-T)
virtual label solvePrimal()
solve the primal equations
autoPtr< volVectorField > fvSourcePtr_
fvSource term
autoPtr< DATurbulenceModel > daTurbulenceModelPtr_
DATurbulenceModel pointer.
volVectorField pseudoU("pseudoU", U)
label hasTField_
whether to have the temperature field
autoPtr< dimensionedScalar > PrPtr_
Prandtl number pointer.
autoPtr< volScalarField > alphaPorosityPtr_
alpha porosity
autoPtr< singlePhaseTransportModel > laminarTransportPtr_
laminar transport properties pointer
label hasFvSource_
whether to have fvSource term
virtual void initSolver()
initialize fields and variables
autoPtr< volScalarField > TPtr_
temperature field pointer
autoPtr< DAFvSource > daFvSourcePtr_
DASource pointer.
scalar cumulativeContErr_
continuity error
autoPtr< dimensionedScalar > PrtPtr_
Turbulence Prandtl pointer.
virtual label runFPAdj(Vec dFdW, Vec psi)
solve the adjoint equation using the fixed-point iteration method
autoPtr< incompressible::turbulenceModel > turbulencePtr_
turbulence pointer
scalar L2norm(const volScalarField &v)
void calcLduResiduals(volVectorField &URes, volScalarField &pRes, surfaceScalarField &phiRes)
calculate all the flow residuals except for the turbulence one
autoPtr< volScalarField > pPtr_
pressure field pointer
void invTranProdPEqn(const volScalarField &mySource, volScalarField &pseudoP)
Inverse transpose product, Mp^(-T)
autoPtr< simpleControl > simplePtr_
simple pointer
void vec2Fields(const word mode, Vec cVec, volVectorField &UField, volScalarField &pField, surfaceScalarField &phiField, volScalarField &nuTildaField)
assign coupled petsc vec to fields or vice versa
void calcAdjointResidual(volVectorField &URes, volScalarField &pRes, surfaceScalarField &phiRes, volScalarField &nuTildaRes, Vec dFdW, volVectorField &UPsi, volScalarField &pPsi, surfaceScalarField &phiPsi, volScalarField &nuTildaPsi, volVectorField &adjURes, volScalarField &adjPRes, surfaceScalarField &adjPhiRes, volScalarField &adjNuTildaRes, label &cnt)
autoPtr< volVectorField > UPtr_
velocity field pointer
scalar pRefValue_
pressure reference value
autoPtr< volScalarField > alphatPtr_
thermal diffusivity field pointer
autoPtr< IOMRFZoneListDF > MRFPtr_
MRF pointer.
const volScalarField & psi