4#include "singlePhaseTransportModel.H"
5#include "turbulentTransportModel.H"
6#include "simpleControl.H"
7#include "pisoControl.H"
11#include "ITHACAforces.H"
16#include "primitiveFields.H"
17#include "FieldFields.H"
18#include "scalarMatrices.H"
19#include "SortableList.H"
20#include "volFieldsFwd.H"
22#include "forceCoeffs.H"
42 msrProblem(
int argc,
char* argv[]);
47 autoPtr<Time> _runTime;
51 mutable autoPtr<fvMesh> _mesh;
55 autoPtr<volVectorField> _U;
56 autoPtr<surfaceScalarField> _phi;
57 autoPtr<singlePhaseTransportModel> _laminarTransport;
58 autoPtr<incompressible::turbulenceModel> turbulence;
59 autoPtr<IOMRFZoneList> _MRF;
60 autoPtr<volScalarField> _p;
63 autoPtr<dimensionedScalar> _nu;
64 autoPtr<dimensionedScalar> _Pr;
65 autoPtr<dimensionedScalar> _Prt;
66 autoPtr<dimensionedScalar> _rhoRef;
67 autoPtr<volScalarField> _v;
68 autoPtr<dimensionedScalar> _CpRef;
69 autoPtr<dimensionedScalar> _Tref;
70 autoPtr<dimensionedScalar> _TrefXS;
71 autoPtr<volScalarField> _TXS;
73 autoPtr<volScalarField>
_p0;
74 autoPtr<volVectorField> _U0;
75 autoPtr<surfaceScalarField> _phi0;
76 autoPtr<volScalarField> _flux0;
77 autoPtr<volScalarField> _prec10;
78 autoPtr<volScalarField> _prec20;
79 autoPtr<volScalarField> _prec30;
80 autoPtr<volScalarField> _prec40;
81 autoPtr<volScalarField> _prec50;
82 autoPtr<volScalarField> _prec60;
83 autoPtr<volScalarField> _prec70;
84 autoPtr<volScalarField> _prec80;
85 autoPtr<volScalarField> _T0;
86 autoPtr<volScalarField> _dec10;
87 autoPtr<volScalarField> _dec20;
88 autoPtr<volScalarField> _dec30;
89 autoPtr<dimensionedScalar> _K0;
90 autoPtr<volScalarField> _v0;
91 autoPtr<volScalarField> _NSF0;
92 autoPtr<volScalarField> _A0;
93 autoPtr<volScalarField> _D0;
94 autoPtr<volScalarField> _SP0;
95 autoPtr<volScalarField> _TXS0;
100 autoPtr<dimensionedScalar> _Keff;
101 autoPtr<dimensionedScalar> _IV1;
102 autoPtr<dimensionedScalar> _D1_0;
103 autoPtr<volScalarField> _D;
104 autoPtr<dimensionedScalar> _alfa_D1;
105 autoPtr<dimensionedScalar> _A1_0;
106 autoPtr<volScalarField> _A;
107 autoPtr<dimensionedScalar> _alfa_A1;
108 autoPtr<dimensionedScalar> _NSF1_0;
109 autoPtr<volScalarField> _NSF;
110 autoPtr<dimensionedScalar> _alfa_NSF1;
111 autoPtr<dimensionedScalar> _SP1_0;
112 autoPtr<volScalarField> _SP;
113 autoPtr<dimensionedScalar> _alfa_SP1;
114 autoPtr<dimensionedScalar> _lam1;
115 autoPtr<dimensionedScalar> _lam2;
116 autoPtr<dimensionedScalar> _lam3;
117 autoPtr<dimensionedScalar> _lam4;
118 autoPtr<dimensionedScalar> _lam5;
119 autoPtr<dimensionedScalar> _lam6;
120 autoPtr<dimensionedScalar> _lam7;
121 autoPtr<dimensionedScalar> _lam8;
122 autoPtr<dimensionedScalar> _beta1;
123 autoPtr<dimensionedScalar> _beta2;
124 autoPtr<dimensionedScalar> _beta3;
125 autoPtr<dimensionedScalar> _beta4;
126 autoPtr<dimensionedScalar> _beta5;
127 autoPtr<dimensionedScalar> _beta6;
128 autoPtr<dimensionedScalar> _beta7;
129 autoPtr<dimensionedScalar> _beta8;
130 autoPtr<dimensionedScalar> _betaTot;
131 autoPtr<volScalarField> _flux;
132 autoPtr<dimensionedScalar> _decLam1;
133 autoPtr<dimensionedScalar> _decLam2;
134 autoPtr<dimensionedScalar> _decLam3;
135 autoPtr<dimensionedScalar> _decBeta1;
136 autoPtr<dimensionedScalar> _decBeta2;
137 autoPtr<dimensionedScalar> _decBeta3;
138 autoPtr<dimensionedScalar> _decbetaTot;
139 autoPtr<dimensionedScalar> _betaTE;
140 autoPtr<volScalarField> _prec1;
141 autoPtr<volScalarField> _prec2;
142 autoPtr<volScalarField> _prec3;
143 autoPtr<volScalarField> _prec4;
144 autoPtr<volScalarField> _prec5;
145 autoPtr<volScalarField> _prec6;
146 autoPtr<volScalarField> _prec7;
147 autoPtr<volScalarField> _prec8;
148 autoPtr<dimensionedScalar> _Sc;
149 autoPtr<dimensionedScalar> _Sct;
150 autoPtr<volScalarField> _alphat;
151 autoPtr<volScalarField> _difft;
159 autoPtr<volScalarField> _T;
160 autoPtr<volScalarField> _logT;
161 autoPtr<volScalarField> _dec1;
162 autoPtr<volScalarField> _dec2;
163 autoPtr<volScalarField> _dec3;
503 Eigen::VectorXi NPrecmodes;
504 Eigen::VectorXi NDecmodes;
523 bool homboolT =
false;
530 std::vector<SPLINTER::DataTable*> SAMPLES_v;
532 std::vector<SPLINTER::DataTable*> SAMPLES_D;
534 std::vector<SPLINTER::DataTable*> SAMPLES_NSF;
536 std::vector<SPLINTER::DataTable*> SAMPLES_A;
538 std::vector<SPLINTER::DataTable*> SAMPLES_SP;
540 std::vector<SPLINTER::DataTable*> SAMPLES_TXS;
542 std::vector<SPLINTER::RBFSpline*> rbfsplines_v;
544 std::vector<SPLINTER::RBFSpline*> rbfsplines_D;
546 std::vector<SPLINTER::RBFSpline*> rbfsplines_NSF;
548 std::vector<SPLINTER::RBFSpline*> rbfsplines_A;
550 std::vector<SPLINTER::RBFSpline*> rbfsplines_SP;
552 std::vector<SPLINTER::RBFSpline*> rbfsplines_TXS;
617 Eigen::VectorXi Nprecmodes, label NTmodes, Eigen::VectorXi Ndecmodes,
625 Eigen::MatrixXd pressure_gradient_term(label
NUmodes, label NPmodes);
626 List < Eigen::MatrixXd > convective_term(label
NUmodes, label NPmodes);
627 Eigen::MatrixXd mass_term(label
NUmodes, label NPmodes);
631 List < Eigen::MatrixXd > div_momentum(label
NUmodes, label NPmodes);
632 Eigen::MatrixXd laplacian_pressure(label NPmodes);
633 Eigen::MatrixXd pressure_BC1(label
NUmodes, label NPmodes);
634 List < Eigen::MatrixXd > pressure_BC2(label
NUmodes, label NPmodes);
635 Eigen::MatrixXd pressure_BC3(label
NUmodes, label NPmodes);
638 List<Eigen::MatrixXd>
laplacian_flux(label NFluxmodes, label NCmodes);
639 Eigen::MatrixXd mass_flux(label NFluxmodes);
640 List<Eigen::MatrixXd> prod_flux(label NFluxmodes, label NCmodes);
641 List<Eigen::MatrixXd> abs_flux(label NFluxmodes, label NCmodes);
642 Eigen::MatrixXd prec_source(label NFluxmodes, label NPrecmodes, label family);
647 Eigen::MatrixXd prec_mass(label NPrecmodes, label family);
648 Eigen::MatrixXd laplacian_prec(label NPrecmodes, label family);
649 List<Eigen::MatrixXd> flux_source(label NFluxmodes, label NPrecmodes,
650 label NCmodes, label family);
655 Eigen::MatrixXd dec_mass(label NDecmodes, label decgroup);
656 Eigen::MatrixXd laplacian_dec(label NDecmodes, label decgroup);
657 List<Eigen::MatrixXd> dec_fluxsource(label NFluxmodes, label NDecmodes,
658 label NCmodes, label decgroup);
661 Eigen::MatrixXd
mass_temp(label NTmodes);
662 List<Eigen::MatrixXd> temp_stream(label
NUmodes, label NTmodes);
663 Eigen::MatrixXd laplacian_temp(label NTmodes);
664 List<Eigen::MatrixXd> temp_heatsource(label NTmodes, label NDecmodes,
665 label NCmodes, label decgroup);
666 List<Eigen::MatrixXd> temp_XSfluxsource(label NTmodes, label NFluxmodes,
687 PtrList<volScalarField>
choose_group(
string field, label ith);
Header file of the ITHACAPOD class.
Header file of the ITHACAstream class, it contains the implementation of several methods for input ou...
Class for the definition of some general parameters, the parameters must be defined from the file ITH...
List< Eigen::MatrixXd > stream_term(label NUmodes, label NPrecmodes, label family)
precursor eq. methods:
Eigen::MatrixXd MP7_matrix
precursor mass term-7
Eigen::MatrixXd MD1_matrix
decay heat mass term-1
void homogenizeT()
Method to compute the homogenized temperature field, it also sets homboolT=true.
List< Eigen::MatrixXd > ST5_matrix
precursor stream term-5
PtrList< volScalarField > Prec6field
List of pointers used to form the prec6 snapshots matrix.
List< Eigen::MatrixXd > THS2_matrix
temperature decay heat source term-2
Eigen::MatrixXd LP3_matrix
precursor laplacian term-3
List< Eigen::MatrixXd > SD1_matrix
decay heat stream term-1
Eigen::MatrixXd BC1_matrix
PPE BC1.
PtrList< volScalarField > NSFmodes
List of pointers used to form the NSF snapshosts matrix.
PtrList< volScalarField > Prec5modes
List of pointers used to form the prec1 modes.
List< Eigen::MatrixXd > PF_matrix
production flux
PtrList< volScalarField > choose_group(string field, label ith)
method to choose one field among precs & decs field can be "prec" or "dec" only if field==prec then i...
void savegroupMatrix(string nome, label n, word folder, M matrice)
method to save matrices for precs and decs M can be an Eigen::MatrixXd or List<Eigen::MatrixXd> nome ...
PtrList< volScalarField > Prec4modes
List of pointers used to form the prec1 modes.
List< Eigen::MatrixXd > FS3_matrix
precursor flux source term-3
List< Eigen::MatrixXd > BC2_matrix
PPE BC2.
List< Eigen::MatrixXd > ST7_matrix
precursor stream term-7
PtrList< volScalarField > Prec8field
List of pointers used to form the prec8 snapshots matrix.
List< Eigen::MatrixXd > FS1_matrix
precursor flux source term-1
PtrList< volScalarField > Prec1modes
List of pointers used to form the prec1 modes.
List< Eigen::MatrixXd > TXS_matrix
temperature flux source term TXS
List< Eigen::MatrixXd > LF_matrix
laplacian_flux
PtrList< volScalarField > Pmodes
List of pointers used to form the pressure modes.
label NUmodes
Number of modes adopted during Galerkin projection.
Eigen::MatrixXd MP1_matrix
precursor mass term-1
List< Eigen::MatrixXd > ST8_matrix
precursor stream term-8
PtrList< volVectorField > Uomfield
List of pointers used to form the homogeneous velocity snapshots.
List< Eigen::MatrixXd > ST4_matrix
precursor stream term-4
PtrList< volScalarField > Prec7modes
List of pointers used to form the prec1 modes.
PtrList< volScalarField > vFields
List of pointers used to form the v snapshosts matrix.
Eigen::MatrixXd PS3_matrix
prec_source 3
PtrList< volScalarField > Tmodes
List of pointers used to form the temperature modes.
label precinIndex
indexes of inlet and outlet to adopt for precursors boundary conditions
Eigen::MatrixXd K_matrix
Gradient of pressure matrix.
List< Eigen::MatrixXd > G_matrix
Divergence of momentum PPE.
List< Eigen::MatrixXd > AF_matrix
absorption flux
Eigen::MatrixXd MP2_matrix
precursor mass term-2
List< Eigen::MatrixXd > FS2_matrix
precursor flux source term-2
Eigen::MatrixXd LP8_matrix
precursor laplacian term-8
Eigen::MatrixXd PS6_matrix
prec_source 6
PtrList< volScalarField > Prec8modes
List of pointers used to form the prec1 modes.
List< Eigen::MatrixXd > FS4_matrix
precursor flux source term-4
PtrList< volScalarField > Fluxfield
List of pointers used to form the flux snapshots matrix.
Eigen::MatrixXd BC3_matrix
PPE BC3.
Eigen::MatrixXd LP4_matrix
precursor laplacian term-4
Eigen::MatrixXd LP7_matrix
precursor laplacian term-7
Eigen::MatrixXd TM_matrix
temperature mass term
List< Eigen::MatrixXd > SD3_matrix
decay heat stream term-3
PtrList< volScalarField > Prec2modes
List of pointers used to form the prec1 modes.
Eigen::MatrixXd LP6_matrix
precursor laplacian term-6
List< Eigen::MatrixXd > TS_matrix
temperature stream term
Eigen::MatrixXd MF_matrix
mass flux
PtrList< volScalarField > Prec4field
List of pointers used to form the prec4 snapshots matrix.
Eigen::MatrixXd MP3_matrix
precursor mass term-3
PtrList< volScalarField > DFields
List of pointers used to form the D snapshosts matrix.
Eigen::MatrixXd D_matrix
Laplacian term PPE.
List< Eigen::MatrixXd > DFS2_matrix
decay heat flux source term-2
void change_viscosity(double mu)
method to change the viscosity in UEqn
List< Eigen::MatrixXd > laplacian_flux(label NFluxmodes, label NCmodes)
diffusion eq. methods:
PtrList< volScalarField > AFields
List of pointers used to form the A snapshosts matrix.
Eigen::MatrixXd PS7_matrix
prec_source 7
List< Eigen::MatrixXd > FS7_matrix
precursor flux source term-7
List< Eigen::MatrixXd > ST6_matrix
precursor stream term-6
void readMSRfields()
Method to read all the fieds of the MSR problem in the offline folder, it also reads mu_samples matri...
Eigen::MatrixXd LP1_matrix
precursor laplacian term-1
PtrList< volScalarField > Dec1modes
List of pointers used to form the dec1 modes.
List< Eigen::MatrixXd > THS1_matrix
temperature decay heat source term-1
PtrList< volScalarField > Dec3field
List of pointers used to form the dec3 snapshots matrix.
List< Eigen::MatrixXd > ST1_matrix
precursor stream term-1
void liftSolve()
Perform a lift solve for the velocity field.
Eigen::MatrixXd LT_matrix
temperature laplacian term
PtrList< volScalarField > Prec6modes
List of pointers used to form the prec1 modes.
void liftSolveT()
Perform a lift solve for the temperature.
List< Eigen::MatrixXd > FS6_matrix
precursor flux source term-6
Eigen::MatrixXd mass_temp(label NTmodes)
temperature eq. methods
PtrList< volScalarField > vmodes
List of pointers used to form the v modes.
Eigen::MatrixXd P_matrix
Div of velocity.
scalar cumulativeContErr
continuity error
autoPtr< fv::options > _fvOptions
fvOptions
scalar tolerance
Tolerance for the residual of the stationary problems, there is the same tolerance for velocity and p...
PtrList< volScalarField > Dec1field
List of pointers used to form the dec1 snapshots matrix.
scalar maxIter
Number of maximum iterations to be done for the computation of the truth solution.
PtrList< volScalarField > TXSmodes
List of pointers used to form the SP snapshosts matrix.
Eigen::MatrixXd divergence_term(label NUmodes, label NPmodes)
continuity eq. methods:
Eigen::MatrixXd LD1_matrix
decay heat laplacian term-1
List< Eigen::MatrixXd > SD2_matrix
decay heat stream term-2
autoPtr< simpleControl > _simple
simpleControl
Eigen::MatrixXd MP5_matrix
precursor mass term-5
PtrList< volScalarField > PowerDensfield
List of pointers used to form the powerDens snapshots matrix.
PtrList< volScalarField > Prec3modes
List of pointers used to form the prec1 modes.
Eigen::MatrixXd LP2_matrix
precursor laplacian term-2
autoPtr< volScalarField > _p0
Initial fields (for restart purposes).
Eigen::MatrixXd diffusive_term(label NUmodes, label NPmodes)
sub-functions needed by projectPPE
bool homboolU
boolean variables to check if the homogenization of U and T is performed (true) or not (false)
Eigen::MatrixXd LD2_matrix
decay heat laplacian term-2
PtrList< volScalarField > Prec7field
List of pointers used to form the prec7 snapshots matrix.
Eigen::MatrixXd PS8_matrix
prec_source 8
Eigen::MatrixXd MP8_matrix
precursor mass term-8
Eigen::MatrixXd MD2_matrix
decay heat mass term-2
PtrList< volScalarField > liftfieldT
List of pointers used to form the list of lifting functions.
PtrList< volScalarField > Dec2modes
List of pointers used to form the dec2 modes.
void restart()
method to set all fields back to values in 0 folder
PtrList< volVectorField > liftfield
List of pointers used to form the list of lifting functions.
Eigen::MatrixXd PS4_matrix
prec_source 4
PtrList< volScalarField > Pfield
List of pointers used to form the pressure snapshots matrix.
Eigen::MatrixXd MP6_matrix
precursor mass term-6
PtrList< volScalarField > NSFFields
List of pointers used to form the NSF snapshosts matrix.
PtrList< volScalarField > Prec3field
List of pointers used to form the prec3 snapshots matrix.
PtrList< volVectorField > Umodes
List of pointers used to form the velocity modes.
PtrList< volScalarField > Dec3modes
List of pointers used to form the dec3 modes.
PtrList< volScalarField > Tfield
List of pointers used to form the temperature snapshots matrix.
Eigen::MatrixXd B_matrix
Diffusion term.
PtrList< volScalarField > Tomfield
List of pointers used to form the homogeneous velocity snapshots.
PtrList< volVectorField > Ufield
List of pointers used to form the velocity snapshots matrix.
PtrList< volScalarField > Prec1field
List of pointers used to form the prec1 snapshots matrix.
Eigen::MatrixXd M_matrix
Mass Matrix.
Eigen::MatrixXd MP4_matrix
precursor mass term-4
PtrList< volScalarField > SPmodes
List of pointers used to form the SP snapshosts matrix.
List< Eigen::MatrixXd > ST2_matrix
precursor stream term-2
List< Eigen::MatrixXd > FS8_matrix
precursor flux source term-8
PtrList< volScalarField > SPFields
List of pointers used to form the SP snapshosts matrix.
void msrcoeff(label &NC)
method to apply RBF interpolation procedure NC is the number of modes to adopt for construncting the ...
Eigen::MatrixXd PS1_matrix
prec_source 1
List< Eigen::MatrixXd > DFS1_matrix
decay heat flux source term-1
List< Eigen::MatrixXd > DFS3_matrix
decay heat flux source term-3
void homogenizeU()
Method to compute the homogenized velocity field, it also sets homboolU=true.
List< Eigen::MatrixXd > stream_dec(label NUmodes, label NDecmodes, label decgroup)
decay heat eq. methods:
List< Eigen::MatrixXd > FS5_matrix
precursor flux source term-5
void projectPPE(fileName folder, label NUmodes, label NPmodes, label NFluxmodes, Eigen::VectorXi Nprecmodes, label NTmodes, Eigen::VectorXi Ndecmodes, label NCmodes)
Project using the Poisson Equation for pressure.
List< Eigen::MatrixXd > THS3_matrix
temperature decay heat source term-3
PtrList< volScalarField > Dec2field
List of pointers used to form the dec2 snapshots matrix.
PtrList< volScalarField > Prec5field
List of pointers used to form the prec5 snapshots matrix.
Eigen::MatrixXd LD3_matrix
decay heat laplacian term-3
bool precInBool
boolean variable to decide if apply prec inlet BC
List< Eigen::MatrixXd > C_matrix
Non linear term.
PtrList< volScalarField > TXSFields
List of pointers used to form the SP snapshosts matrix.
Eigen::MatrixXd LP5_matrix
precursor laplacian term-5
void msrgetModesEVD()
Method to compute the modes for all the fields in the MSR problem, if hombool==false the velocity mod...
Eigen::MatrixXd MD3_matrix
decay heat mass term-3
PtrList< volScalarField > Amodes
List of pointers used to form the A snapshosts matrix.
Eigen::MatrixXd PS2_matrix
prec_source 2
PtrList< volScalarField > Fluxmodes
List of pointers used to form the flux modes.
PtrList< volScalarField > Prec2field
List of pointers used to form the prec2 snapshots matrix.
PtrList< volScalarField > Dmodes
List of pointers used to form the D modes.
void msrgetModesSVD()
Method to compute the modes for all the fields in the MSR problem, if hombool==false the velocity mod...
Eigen::MatrixXd bc_prec
matrix to store the values of precursors BC inlet conditions
List< Eigen::MatrixXd > ST3_matrix
precursor stream term-3
Eigen::MatrixXd PS5_matrix
prec_source 5
reductionProblem()
Construct Null.
Eigen::MatrixXd mu
Row matrix of parameters.
void truthSolve()
Perform a TruthSolve.
Header file of the reductionProblem class.