Go to the documentation of this file.
54 turbulencePtr_(nullptr),
55 daTurbulenceModelPtr_(nullptr),
56 daFvSourcePtr_(nullptr),
57 fvSourcePtr_(nullptr),
58 fvSourceEnergyPtr_(nullptr)
70 Info <<
"Initializing fields for DARhoPimpleFoam" << endl;
78 const word turbModelName(
81 "turbulenceProperties",
82 mesh.time().constant(),
95 if (
allOptions.subDict(
"fvSource").toc().size() != 0)
98 Info <<
"Initializing DASource" << endl;
99 word sourceName =
allOptions.subDict(
"fvSource").toc()[0];
100 word fvSourceType =
allOptions.subDict(
"fvSource").subDict(sourceName).getWord(
"type");
106 dictionary dvSubDict =
daOptionPtr_->getAllOptions().subDict(
"inputInfo");
107 forAll(dvSubDict.toc(), idxI)
109 word dvName = dvSubDict.toc()[idxI];
110 if (dvSubDict.subDict(dvName).getWord(
"type") ==
"volCoord")
130 Info <<
"\nStarting time loop\n"
133 label pimplePrintToScreen = 0;
136 label reduceIO =
daOptionPtr_->getAllOptions().subDict(
"unsteadyAdjoint").getLabel(
"reduceIO");
137 wordList additionalOutput;
140 daOptionPtr_->getAllOptions().subDict(
"unsteadyAdjoint").readEntry<wordList>(
"additionalOutput", additionalOutput);
143 scalar endTime =
runTime.endTime().value();
144 scalar deltaT =
runTime.deltaT().value();
145 label nInstances = round(endTime / deltaT);
148 label regModelFail = 0;
151 for (label iter = 1; iter <= nInstances; iter++)
162 Info <<
"Time = " <<
runTime.timeName() << nl << endl;
163 #include "CourantNo.H"
166 if (
pimple.nCorrPIMPLE() <= 1)
177 pimplePrintToScreen = 1;
181 pimplePrintToScreen = 0;
199 regModelFail += fail;
214 if (reduceIO && iter < nInstances)
226 if (regModelFail != 0)
label printToScreen_
whether to print primal information to the screen
autoPtr< DARegression > daRegressionPtr_
DARegression pointer.
autoPtr< DAModel > daModelPtr_
DAModel pointer.
autoPtr< DAIndex > daIndexPtr_
DAIndex pointer.
label primalFinalTimeIndex_
the final time index from the primal solve. for steady state cases it can converge before endTime
addToRunTimeSelectionTable(DAFunction, DAFunctionForce, dictionary)
autoPtr< DAOption > daOptionPtr_
DAOption pointer.
virtual label solvePrimal()
solve the primal equations
static autoPtr< DATurbulenceModel > New(const word modelType, const fvMesh &mesh, const DAOption &daOption)
label printIntervalUnsteady_
how frequent do you want to print the primal info default is every 100 steps
label isPrintTime(const Time &runTime, const label printInterval) const
label validateStates()
check if the state variables have valid values
static autoPtr< DAFvSource > New(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
label reduceIOWriteMesh_
whether to write mesh for the reduceIO
defineTypeNameAndDebug(DAFunction, 0)
const dictionary & allOptions
autoPtr< Time > runTimePtr_
runTime pointer
autoPtr< fvMesh > meshPtr_
fvMesh pointer
autoPtr< argList > argsPtr_
args pointer
autoPtr< DAFvSource > daFvSourcePtr_
DASource pointer.
virtual void initSolver()
initialize fields and variables
void updateInputFieldUnsteady()
assign the inputFieldUnsteady values to the OF field vars
autoPtr< DATurbulenceModel > daTurbulenceModelPtr_
DATurbulenceModel pointer.
void writeAdjStates(const label writeMesh, const wordList &additionalOutput)
write state variables that are NO_WRITE to disk
label hasFvSource_
whether to have fvSource term
void printElapsedTime(const Time &runTime, const label printToScreen)
DARhoPimpleFoam(char *argsAll, PyObject *pyOptions)
void calcAllFunctions(label print=0)
calculate the values of all objective functions and print them to screen