Go to the documentation of this file.
51 pressureControlPtr_(nullptr),
52 turbulencePtr_(nullptr),
53 daTurbulenceModelPtr_(nullptr),
54 initialMass_(dimensionedScalar(
"initialMass", dimensionSet(1, 0, 0, 0, 0, 0, 0), 0.0))
66 Info <<
"Initializing fields for DARhoSimpleCFoam" << endl;
99 daOptionPtr_->setOption<word>(
"runStatus",
"solvePrimal");
104 Info <<
"\nStarting time loop\n"
122 word divUScheme =
"div(phi,U)";
123 if (
daOptionPtr_->getSubDictOption<label>(
"runLowOrderPrimal4PC",
"active"))
125 if (
daOptionPtr_->getSubDictOption<label>(
"runLowOrderPrimal4PC",
"isPC"))
127 Info <<
"Using low order div scheme for primal solution .... " << endl;
128 divUScheme =
"div(pc)";
133 label printInterval =
daOptionPtr_->getOption<label>(
"printInterval");
134 label printToScreen = 0;
142 Info <<
"Time = " <<
runTime.timeName() << nl << endl;
161 Info <<
"ExecutionTime = " <<
runTime.elapsedCpuTime() <<
" s"
162 <<
" ClockTime = " <<
runTime.elapsedClockTime() <<
" s"
void writeFailedMesh()
write the failed mesh to disk
label loop(Time &runTime)
return whether to loop the primal solution, similar to runTime::loop() except we don't do file IO
autoPtr< DACheckMesh > daCheckMeshPtr_
DACheckMesh object pointer.
virtual label solvePrimal(const Vec xvVec, Vec wVec)
solve the primal equations
autoPtr< DATurbulenceModel > daTurbulenceModelPtr_
DATurbulenceModel pointer.
autoPtr< DAOption > daOptionPtr_
DAOption pointer.
void calcPrimalResidualStatistics(const word mode, const label writeRes=0)
calculate the norms of all residuals and print to screen
label isPrintTime(const Time &runTime, const label printInterval) const
autoPtr< DALinearEqn > daLinearEqnPtr_
DALinearEqn pointer.
void setDAObjFuncList()
initialize DASolver::daObjFuncPtrList_ one needs to call this before calling printAllObjFuncs
void printAllObjFuncs()
calculate the values of all objective functions and print them to screen
DARhoSimpleCFoam(char *argsAll, PyObject *pyOptions)
scalar primalMinRes_
the maximal residual for primal solution
autoPtr< Time > runTimePtr_
runTime pointer
autoPtr< fvMesh > meshPtr_
fvMesh pointer
defineTypeNameAndDebug(DAFvSource, 0)
addToRunTimeSelectionTable(DAFvSource, DAFvSourceActuatorDisk, dictionary)
autoPtr< argList > argsPtr_
args pointer
void ofField2StateVec(Vec stateVec) const
set the state vector based on the latest fields in OpenFOAM
label checkMesh() const
check the mesh quality and return meshOK
label checkResidualTol()
check whether the min residual in primal satisfy the prescribed tolerance
virtual void initSolver()
initialize fields and variables
void pointVec2OFMesh(const Vec xvVec) const
assign the points in fvMesh of OpenFOAM based on the point vector