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"
104 #ifdef CODI_AD_REVERSE
105 using Position =
typename codi::RealReverse::Tape::Position;
107 Position adjResStart_;
109 Position gradPStart_;
111 Position pEqnFluxStart_;
112 Position pEqnFluxEnd_;
113 Position divPhiStart_;
115 Position fluxUStart_;
131 PyObject* pyOptions);
155 const volVectorField& mySource,
160 const volScalarField& mySource,
165 volVectorField& URes,
166 volScalarField& pRes,
167 surfaceScalarField& phiRes);
173 volVectorField& UField,
174 volScalarField& pField,
175 surfaceScalarField& phiField,
176 volScalarField& nuTildaField);
179 volVectorField& URes,
180 volScalarField& pRes,
181 surfaceScalarField& phiRes,
182 volScalarField& nuTildaRes,
184 volVectorField& UPsi,
185 volScalarField& pPsi,
186 surfaceScalarField& phiPsi,
187 volScalarField& nuTildaPsi,
188 volVectorField& adjURes,
189 volScalarField& adjPRes,
190 surfaceScalarField& adjPhiRes,
191 volScalarField& adjNuTildaRes,
194 scalar
L2norm(
const volScalarField& v);
196 vector
L2norm(
const volVectorField&
U);
198 scalar
L2norm(
const surfaceScalarField& Phi);
200 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 runFPAdj(const Vec xvVec, const Vec wVec, Vec dFdW, Vec psi)
solve the adjoint equation using the fixed-point iteration method
autoPtr< volVectorField > fvSourcePtr_
fvSource term
autoPtr< DATurbulenceModel > daTurbulenceModelPtr_
DATurbulenceModel pointer.
volVectorField pseudoU("pseudoU", U)
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< DAFvSource > daFvSourcePtr_
DASource pointer.
scalar cumulativeContErr_
continuity error
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
virtual label solvePrimal(const Vec xvVec, Vec wVec)
solve the primal equations
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< IOMRFZoneListDF > MRFPtr_
MRF pointer.
const volScalarField & psi