46 _args = autoPtr<argList>
48 new argList(argc, argv)
51 if (!
_args->checkRootCase())
53 Foam::FatalError.exit();
56 argList& args =
_args();
59 _pimple = autoPtr<pimpleControl>
82 M_Assert(
method ==
"supremizer" ||
method ==
"PPE",
"The method must be set to supremizer or PPE in ITHACAdict");
86 "The BC method must be set to lift or penalty in ITHACAdict");
90 "The BC method can be set to yes or no");
92 ITHACAdict->lookupOrDefault<word>(
"timeDerivativeSchemeOrder",
"second");
95 "The time derivative approximation must be set to either first or second order scheme in ITHACAdict");
106 surfaceScalarField&
phi =
_phi();
108#include "initContinuityErrs.H"
111 volScalarField&
p =
_p();
112 volVectorField&
U =
_U();
113 IOMRFZoneList& MRF =
_MRF();
115 instantList Times =
runTime.times();
127 Vector<double> inl(0, 0, 0);
129 for (label j = 0; j < inl.size(); j++)
141 std::ofstream of(folder + name(
counter) +
"/" +
151#include "readTimeControls.H"
152#include "CourantNo.H"
153#include "setDeltaT.H"
156 Info <<
"Time = " <<
runTime.timeName() << nl << endl;
163 Vector<double> inl(0, 0, 0);
165 for (label j = 0; j < inl.size(); j++)
194 Info <<
"ExecutionTime = " <<
runTime.elapsedCpuTime() <<
" s"
195 <<
" ClockTime = " <<
runTime.elapsedClockTime() <<
" s"
211 for (label
i = 0;
i < mu_now.size();
i++)
#define M_Assert(Expr, Msg)
static ITHACAparameters * getInstance()
Gets an instance of ITHACAparameters, to be used if the instance is already existing.
bool checkWrite(Time &timeObject)
Function to check if the solution must be exported.
scalar startTime
Start Time (initial time to start storing the snapshots)
scalar writeEvery
Time step of the writing procedure.
scalar timeStep
Time step of the simulation.
scalar nextWrite
Auxiliary variable to store the next writing instant.
scalar finalTime
Final time (final time of the simulation and consequently of the acquisition of the snapshots)
Eigen::MatrixXi inletPatch
Matrix that contains informations about the inlet boundaries without specifing the direction Rows = N...
void writeMu(List< scalar > mu_now)
Write out a list of scalar corresponding to the parameters used in the truthSolve.
Eigen::MatrixXd mu_samples
Matrix of parameters to be used for PODI, where each row corresponds to a sample point....
label counter
Counter used for the output of the full order solutions.
void assignBC(volVectorField &s, label BC_ind, Vector< double > &value)
Assign Boundary Condition to a volVectorField.
bool offline
Boolean variable, it is 1 if the Offline phase has already been computed, else 0.
IOdictionary * ITHACAdict
dictionary to store input output infos
Eigen::MatrixXd mu
Row matrix of parameters.
autoPtr< argList > _args
argList
bool podex
Boolean variable, it is 1 if the POD has already been computed, else 0.
void truthSolve()
Perform a TruthSolve.
bool supex
Boolean variable to check the existence of the supremizer modes.
autoPtr< surfaceScalarField > _phi
Flux.
PtrList< volScalarField > Pfield
List of pointers used to form the pressure snapshots matrix.
autoPtr< fv::options > _fvOptions
fvOptions
autoPtr< Time > _runTime
Time.
PtrList< volVectorField > Ufield
List of pointers used to form the velocity snapshots matrix.
autoPtr< fvMesh > _mesh
Mesh.
autoPtr< singlePhaseTransportModel > _laminarTransport
Laminar transport (used by turbulence model)
autoPtr< IOMRFZoneList > _MRF
MRF variable.
autoPtr< volVectorField > _U
Velocity field.
word bcMethod
Boundary Method.
autoPtr< volScalarField > _p
Pressure field.
autoPtr< incompressible::turbulenceModel > turbulence
Turbulence model.
Eigen::MatrixXd timeBCoff
word timeDerivativeSchemeOrder
autoPtr< pimpleControl > _pimple
pimpleControl
unsteadyNS()
Construct Null.
word timedepbcMethod
Time-dependent Boundary Method.
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.
void exportMatrix(Eigen::Matrix< T, -1, dim > &matrix, word Name, word type, word folder)
Export the reduced matrices in numpy (type=python), matlab (type=matlab) and txt (type=eigen) format ...
bool check_pod()
Check if the POD data folder "./ITHACAoutput/POD" exists.
bool check_off()
Check if the offline data folder "./ITHACAoutput/Offline" exists.
bool check_sup()
Check if the supremizer folder exists.
singlePhaseTransportModel & laminarTransport
Header file of the unsteadyNS class.