43 explicit tutorial14(
int argc,
char* argv[])
56 List<scalar> mu_now(1);
65 for (label i = 0; i <
mu.cols(); i++)
78int main(
int argc,
char* argv[])
86 double dtDMD = readScalar(para->ITHACAdict->lookup(
"dtDMD"));
87 double finalTimeDMD = readScalar(para->ITHACAdict->lookup(
"finalTimeDMD"));
88 double startTimeDMD = readScalar(para->ITHACAdict->lookup(
"startTimeDMD"));
89 int numberOfModesDMD = readInt(para->ITHACAdict->lookup(
"numberOfModesDMD"));
90 bool exactDMD = readBool(para->ITHACAdict->lookup(
"exactDMD"));
91 bool exportDMDModes = readBool(para->ITHACAdict->lookup(
"exportDMDModes"));
92 word exportFolder = string(para->ITHACAdict->lookup(
"exportFolder"));
98 example.setParameters();
100 example.mu_range(0, 0) = 0.01;
101 example.mu_range(0, 1) = 0.01;
103 example.genEquiPar();
105 example.startTime = 60;
106 example.finalTime = 85;
107 example.timeStep = 0.01;
108 example.writeEvery = 0.1;
110 example.offlineSolve();
112 word exportFieldNameU = example.Ufield[0].name() +
"_" + name(numberOfModesDMD);
113 ITHACADMDvolVector DMDv(example.Ufield, example.writeEvery);
114 DMDv.getModes(numberOfModesDMD, exactDMD, exportDMDModes);
115 DMDv.getDynamics(startTimeDMD, finalTimeDMD, dtDMD);
116 DMDv.reconstruct(exportFolder, exportFieldNameU);
118 word exportFieldNameP = example.Pfield[0].name() +
"_" + name(numberOfModesDMD);
119 ITHACADMDvolScalar DMDp(example.Pfield, example.writeEvery);
120 DMDp.getModes(numberOfModesDMD, exactDMD, exportDMDModes);
121 DMDp.getDynamics(startTimeDMD, finalTimeDMD, dtDMD);
122 DMDp.reconstruct(exportFolder, exportFieldNameP);
Header file of the ITHACADMD class.
Header file of the ITHACAPOD class.
Header file of the ITHACAstream class, it contains the implementation of several methods for input ou...
Header file of the reducedUnsteadyNS class.
Class for the definition of some general parameters, the parameters must be defined from the file ITH...
static ITHACAparameters * getInstance()
Gets an instance of ITHACAparameters, to be used if the instance is already existing.
bool offline
Boolean variable, it is 1 if the Offline phase has already been computed, else 0.
Eigen::MatrixXd mu
Row matrix of parameters.
void truthSolve()
Perform a TruthSolve.
void change_viscosity(double mu)
Function to change the viscosity.
PtrList< volScalarField > Pfield
List of pointers used to form the pressure snapshots matrix.
PtrList< volVectorField > Ufield
List of pointers used to form the velocity snapshots matrix.
autoPtr< volVectorField > _U
Velocity field.
autoPtr< volScalarField > _p
Pressure field.
unsteadyNS()
Construct Null.
void read_fields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, word Name, fileName casename, int first_snap, int n_snap)
Function to read a list of fields from the name of the field and casename.
Header file of the unsteadyNS class.