42 explicit tutorial04(
int argc,
char* argv[])
51 Vector<double> inl(1, 0, 0);
52 List<scalar> mu_now(1);
62 for (label i = 0; i <
mu.cols(); i++)
76int main(
int argc,
char* argv[])
83 int NmodesUout = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesUout", 15);
84 int NmodesPout = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesPout", 15);
85 int NmodesSUPout = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesSUPout", 15);
86 int NmodesUproj = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesUproj", 10);
87 int NmodesPproj = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesPproj", 10);
88 int NmodesSUPproj = para->ITHACAdict->lookupOrDefault<
int>(
"NmodesSUPproj", 10);
94 example.setParameters();
96 example.mu_range(0, 0) = 0.005;
97 example.mu_range(0, 1) = 0.005;
101 example.inletIndex.resize(1, 2);
102 example.inletIndex(0, 0) = 0;
103 example.inletIndex(0, 1) = 0;
105 example.startTime = 60;
106 example.finalTime = 70;
107 example.timeStep = 0.01;
108 example.writeEvery = 0.1;
110 example.offlineSolve();
113 if (example.bcMethod ==
"lift")
120 example.computeLift(example.Ufield, example.liftfield, example.Uomfield);
123 example.podex, 0, 0, NmodesUout);
125 example.podex, 0, 0, NmodesPout);
131 example.podex, 0, 0, NmodesUout);
133 example.podex, 0, 0, NmodesPout);
137 if (example.method ==
"supremizer")
139 example.solvesupremizer();
141 example.podex, example.supex, 1, NmodesSUPout);
142 example.projectSUP(
"./Matrices", NmodesUproj, NmodesPproj, NmodesSUPproj);
144 else if (example.method ==
"PPE")
146 example.projectPPE(
"./Matrices", NmodesUproj, NmodesPproj);
153 reduced.finalTime = 70;
155 reduced.storeEvery = 0.005;
156 reduced.exportEvery = 0.1;
158 Eigen::MatrixXd vel_now(1, 1);
162 if (example.bcMethod ==
"penalty")
164 reduced.tauU = Eigen::MatrixXd::Zero(1, 1);
165 reduced.tauU(0, 0) = 1e-1;
169 if (example.method ==
"supremizer")
171 reduced.solveOnline_sup(vel_now, 1);
173 else if (example.method ==
"PPE")
175 reduced.solveOnline_PPE(vel_now, 1);
179 reduced.reconstruct(
true,
180 "./ITHACAoutput/Reconstruction" + example.method +
"/");
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.
Class where it is implemented a reduced problem for the unsteady Navier-stokes problem.
void assignIF(T &s, G &value)
Assign internal field condition.
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 getModes(PtrList< GeometricField< Type, PatchField, GeoMesh > > &snapshots, PtrList< GeometricField< Type, PatchField, GeoMesh > > &modes, word fieldName, bool podex, bool supex, bool sup, label nmodes, bool correctBC)
Computes the bases or reads them for a field.
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.
void normalizeFields(PtrList< GeometricField< Type, fvPatchField, volMesh > > &fields)
Normalize list of Geometric fields.
Header file of the unsteadyNS class.