Loading...
Searching...
No Matches
reducedUnsteadyNST Class Reference

Class where it is implemented a reduced problem for the unsteady Navier-stokes weakly coupled with the energy equation problem. More...

#include <ReducedUnsteadyNST.H>

Inheritance diagram for reducedUnsteadyNST:
reducedUnsteadyNS reducedSteadyNS reducedProblem ReducedUnsteadyNSTTurb

Public Member Functions

 reducedUnsteadyNST ()
 Construct Null.
 
 reducedUnsteadyNST (unsteadyNST &problem)
 Construct Null.
 
 ~reducedUnsteadyNST ()
 
void solveOnline_sup (Eigen::MatrixXd &vel_now, Eigen::MatrixXd &temp_now, int startSnap=0)
 Method to perform an online solve using a supremizer stabilisation method.
 
void reconstruct_sup (fileName folder="./ITHACAOutput/online_rec", int printevery=1)
 Method to reconstruct a solution from an online solve with a supremizer stabilisation technique.
 
void reconstruct_supt (fileName folder="./ITHACAOutput/online_rec", int printevery=1)
 Method to reconstruct a solution from an online solve with a supremizer stabilisation technique for temperature field.
 
- Public Member Functions inherited from reducedUnsteadyNS
 reducedUnsteadyNS ()
 Construct Null.
 
 reducedUnsteadyNS (unsteadyNS &problem)
 Construct Null.
 
 ~reducedUnsteadyNS ()
 
Eigen::MatrixXd penalty_PPE (Eigen::MatrixXd &vel_now, Eigen::MatrixXd &tauIter, int startSnap=0)
 Method to determine the penalty factors iteratively.
 
Eigen::MatrixXd penalty_sup (Eigen::MatrixXd &vel_now, Eigen::MatrixXd &tauIter, int startSnap=0)
 Method to determine the penalty factors iteratively.
 
void solveOnline_PPE (Eigen::MatrixXd vel_now, int startSnap=0)
 Method to perform an online solve using a PPE stabilisation method.
 
void solveOnline_sup (Eigen::MatrixXd vel_now, int startSnap=0)
 Method to perform an online solve using a supremizer stabilisation method.
 
void reconstruct (bool exportFields=false, fileName folder="./online_rec")
 Method to reconstruct the solutions from an online solve with a supremizer stabilisation technique.
 
Eigen::MatrixXd setOnlineVelocity (Eigen::MatrixXd vel)
 Sets the online velocity.
 
- Public Member Functions inherited from reducedSteadyNS
 reducedSteadyNS ()
 Construct Null.
 
 reducedSteadyNS (steadyNS &problem)
 Construct Null.
 
 ~reducedSteadyNS ()
 
void solveOnline_PPE (Eigen::MatrixXd vel_now)
 Method to perform an online solve using a PPE stabilisation method.
 
void solveOnline_sup (Eigen::MatrixXd vel_now)
 Method to perform an online solve using a supremizer stabilisation method.
 
void reconstruct_PPE (fileName folder="./ITHACAoutput/online_rec", int printevery=1)
 Method to reconstruct a solution from an online solve with a PPE stabilisation technique.
 
void reconstruct (bool exportFields=false, fileName folder="./ITHACAoutput/online_rec", int printevery=1)
 Method to reconstruct the solutions from an online solve.
 
void reconstructLiftAndDrag (steadyNS &problem, fileName folder)
 Method to compute the reduced order forces.
 
double inf_sup_constant ()
 Method to evaluate the online inf-sup constant.
 
Eigen::MatrixXd setOnlineVelocity (Eigen::MatrixXd vel)
 Sets the online velocity.
 
- Public Member Functions inherited from reducedProblem
 reducedProblem ()
 Construct Null.
 
virtual ~reducedProblem ()
 
 reducedProblem (reductionProblem &problem)
 Construct with reduced Problem.
 
virtual void solveOnline ()
 Virtual Method to perform and online Solve.
 

Public Attributes

Eigen::MatrixXd B_matrix
 Diffusion Term.
 
Eigen::MatrixXd Y_matrix
 Laplacian Term for temperature trasnport equation.
 
Eigen::MatrixXd MT_matrix
 Mass Matrix Term for temperature.
 
Eigen::MatrixXd M_matrix
 Mass Matrix Term.
 
Eigen::MatrixXd K_matrix
 Gradient of pressure.
 
List< Eigen::MatrixXd > S_matrix
 Turbulent thermal term.
 
List< Eigen::MatrixXd > C_matrix
 Convective Term.
 
List< Eigen::MatrixXd > Q_matrix
 Convective Term for temperature transport equation.
 
Eigen::MatrixXd P_matrix
 Divergence of velocity.
 
Eigen::MatrixXd D_matrix
 Laplacian of pressure.
 
List< Eigen::MatrixXd > G_matrix
 Divergence of momentum.
 
List< Eigen::MatrixXd > online_solutiont
 List of Eigen matrices to store the online solution for temperature equation.
 
PtrList< volScalarField > Tmodes
 List of pointers to store the modes for temperature.
 
PtrList< volScalarField > Tsnapshots
 List of pointers to store the snapshots for temperature.
 
newton_unsteadyNST_sup newton_object_sup
 Functor object to call the non linear solver sup. approach for velocity case.
 
newton_unsteadyNST_sup_t newton_object_sup_t
 Functor object to call the non linear solver sup. approach for temperature case.
 
PtrList< volScalarField > T_rec
 Reconstructed temperature field.
 
int Nphi_t
 Number of temperature modes.
 
PtrList< volScalarField > TREC
 Reconstructed temperature field.
 
int N_BC_t
 Number of parametrized boundary conditions related to temperature field.
 
scalar time
 Scalar to store the current time.
 
scalar dt
 Scalar to store the time increment.
 
Eigen::VectorXd z_old
 Vector to store the previous temperature solution during the Newton procedure.
 
Eigen::VectorXd z
 Vector to store the temperature solution during the Newton procedure.
 
scalar DT
 DT.
 
scalar finalTime
 Scalar to store the final time if the online simulation.
 
scalar tstart
 Scalar to store the final time if the online simulation.
 
unsteadyNSTproblem
 pointer to the FOM problem
 
- Public Attributes inherited from reducedUnsteadyNS
newton_unsteadyNS_sup newton_object_sup
 Function object to call the non linear solver sup approach.
 
newton_unsteadyNS_PPE newton_object_PPE
 Function object to call the non linear solver PPE approach.
 
scalar time
 Scalar to store the current time.
 
double dt
 Scalar to store the time increment.
 
scalar finalTime
 Scalar to store the final time if the online simulation.
 
scalar tstart
 Scalar to store the initial time if the online simulation.
 
double storeEvery
 A variable for storing the reduced coefficients.
 
double exportEvery
 A variable for exporting the fields.
 
bool startFromZero = false
 A variable for starting solving the reduced system from zero or not.
 
int timeStepPenalty = 1
 Number of timesteps calculated for the iterative penalty method.
 
Eigen::MatrixXd tauIter
 Penalty Factor determined with iterative solver.
 
scalar maxIterPenalty
 Maximum number of iterations to be done for the computation of the penalty factor.
 
scalar tolerancePenalty
 Tolerance for the residual of the boundary values, there is the same tolerance for velocity and temperature.
 
unsteadyNSproblem
 Pointer to the FOM problem.
 
- Public Attributes inherited from reducedSteadyNS
ITHACAparameterspara
 parameters to be read from the ITHACAdict file
 
Eigen::MatrixXd vel_now
 Online inlet velocity vector.
 
Eigen::MatrixXd fTau
 Reduced matrix for tangent forces.
 
Eigen::MatrixXd fN
 Reduced matrix for normal forces.
 
Eigen::VectorXd y_old
 Vector to store the previous solution during the Newton procedure.
 
Eigen::VectorXd y
 Vector to store the solution during the Newton procedure.
 
scalar nu
 Reduced viscosity in case of parametrized viscosity.
 
List< Eigen::MatrixXd > online_solution
 List of Eigen matrices to store the online solution.
 
PtrList< volVectorField > Umodes
 List of pointers to store the modes for velocity.
 
PtrList< volScalarField > Pmodes
 List of pointers to store the modes for pressure.
 
PtrList< volVectorField > Usnapshots
 List of pointers to store the snapshots for velocity.
 
PtrList< volScalarField > Psnapshots
 List of pointers to store the snapshots for pressure.
 
PtrList< volScalarField > PREC
 Reconstructed pressure field.
 
PtrList< volVectorField > UREC
 Recontructed velocity field.
 
PtrList< volScalarField > pRecFields
 Reconstructed pressure fields list.
 
PtrList< volVectorField > uRecFields
 Recontructed velocity fields list.
 
newton_steadyNS newton_object
 Newton object used to solve the non linear problem.
 
steadyNSproblem
 Pointer to the FOM problem.
 
int Nphi_u
 Number of velocity modes.
 
int Nphi_p
 Number of pressure modes.
 
int Nphi_sup
 Number of supremizer modes.
 
int N_BC
 Number of parametrized boundary conditions.
 
int count_online_solve = 1
 Counter to count the online solutions.
 
Eigen::MatrixXd tauU
 Penalty Factor.
 
- Public Attributes inherited from reducedProblem
scalar nu
 Viscosity.
 
reductionProblemproblem
 Pointer to FOAM problem.
 

Additional Inherited Members

- Static Public Member Functions inherited from reducedProblem
static Eigen::MatrixXd solveLinearSys (List< Eigen::MatrixXd > LinSys, Eigen::MatrixXd x, Eigen::VectorXd &residual, const Eigen::MatrixXd &bc=Eigen::MatrixXd::Zero(0, 0), const std::string solverType="fullPivLu")
 Linear system solver for the online problem.
 
static Eigen::MatrixXd solveLinearSys (List< Eigen::MatrixXd > LinSys, Eigen::MatrixXd x, Eigen::VectorXd &residual, const std::string solverType)
 Linear system solver for the online problem.
 

Detailed Description

Class where it is implemented a reduced problem for the unsteady Navier-stokes weakly coupled with the energy equation problem.

In this class are implemented the methods to solve a reduced version of the non-stationary Navier-stokes and energy equations. This class must be used together with the unsteadyNST class

Definition at line 106 of file ReducedUnsteadyNST.H.

Constructor & Destructor Documentation

◆ reducedUnsteadyNST() [1/2]

reducedUnsteadyNST::reducedUnsteadyNST ( )

Construct Null.

Definition at line 42 of file ReducedUnsteadyNST.C.

◆ reducedUnsteadyNST() [2/2]

reducedUnsteadyNST::reducedUnsteadyNST ( unsteadyNST & problem)
explicit

Construct Null.

Parameters
[in]problema full order unsteadyNS problem
[in]tipoType of pressure stabilisation method you want to use "SUP" for supremizer, "PPE" for pressure Poisson equation.

Definition at line 46 of file ReducedUnsteadyNST.C.

◆ ~reducedUnsteadyNST()

reducedUnsteadyNST::~reducedUnsteadyNST ( )
inline

Definition at line 121 of file ReducedUnsteadyNST.H.

Member Function Documentation

◆ reconstruct_sup()

void reducedUnsteadyNST::reconstruct_sup ( fileName folder = "./ITHACAOutput/online_rec",
int printevery = 1 )

Method to reconstruct a solution from an online solve with a supremizer stabilisation technique.

stabilisation method

Parameters
[in]folderThe folder where you want to store the results (default is "./ITHACAOutput/online_rec").
[in]printeveryVariable to recover only every printevery online solutions default is 1.

Definition at line 363 of file ReducedUnsteadyNST.C.

◆ reconstruct_supt()

void reducedUnsteadyNST::reconstruct_supt ( fileName folder = "./ITHACAOutput/online_rec",
int printevery = 1 )

Method to reconstruct a solution from an online solve with a supremizer stabilisation technique for temperature field.

stabilisation method

Parameters
[in]folderThe folder where you want to store the results (default is "./ITHACAOutput/online_rec").
[in]printeveryVariable to recover only every printevery online solutions default is 1.

Definition at line 405 of file ReducedUnsteadyNST.C.

◆ solveOnline_sup()

void reducedUnsteadyNST::solveOnline_sup ( Eigen::MatrixXd & vel_now,
Eigen::MatrixXd & temp_now,
int startSnap = 0 )

Method to perform an online solve using a supremizer stabilisation method.

Parameters
[in]vel_nowThe vector of online velocity. It is defined in with an Eigen::MatrixXd and must have one col and as many rows as the number of parametrized boundary conditions.
[in]temp_nowThe scalar of online temperature. It is defined in with an Eigen::MatrixXd and must have one col and as many rows as the number of parametrized boundary conditions.
[in]startSnapThe first snapshot taken from the offline snapshots and used to get the reduced initial condition.

Definition at line 194 of file ReducedUnsteadyNST.C.

Member Data Documentation

◆ B_matrix

Eigen::MatrixXd reducedUnsteadyNST::B_matrix

Diffusion Term.

Definition at line 124 of file ReducedUnsteadyNST.H.

◆ C_matrix

List<Eigen::MatrixXd> reducedUnsteadyNST::C_matrix

Convective Term.

Definition at line 142 of file ReducedUnsteadyNST.H.

◆ D_matrix

Eigen::MatrixXd reducedUnsteadyNST::D_matrix

Laplacian of pressure.

Definition at line 151 of file ReducedUnsteadyNST.H.

◆ DT

scalar reducedUnsteadyNST::DT

DT.

Definition at line 196 of file ReducedUnsteadyNST.H.

◆ dt

scalar reducedUnsteadyNST::dt

Scalar to store the time increment.

Definition at line 187 of file ReducedUnsteadyNST.H.

◆ finalTime

scalar reducedUnsteadyNST::finalTime

Scalar to store the final time if the online simulation.

Definition at line 199 of file ReducedUnsteadyNST.H.

◆ G_matrix

List<Eigen::MatrixXd> reducedUnsteadyNST::G_matrix

Divergence of momentum.

Definition at line 154 of file ReducedUnsteadyNST.H.

◆ K_matrix

Eigen::MatrixXd reducedUnsteadyNST::K_matrix

Gradient of pressure.

Definition at line 136 of file ReducedUnsteadyNST.H.

◆ M_matrix

Eigen::MatrixXd reducedUnsteadyNST::M_matrix

Mass Matrix Term.

Definition at line 133 of file ReducedUnsteadyNST.H.

◆ MT_matrix

Eigen::MatrixXd reducedUnsteadyNST::MT_matrix

Mass Matrix Term for temperature.

Definition at line 130 of file ReducedUnsteadyNST.H.

◆ N_BC_t

int reducedUnsteadyNST::N_BC_t

Number of parametrized boundary conditions related to temperature field.

Definition at line 181 of file ReducedUnsteadyNST.H.

◆ newton_object_sup

newton_unsteadyNST_sup reducedUnsteadyNST::newton_object_sup

Functor object to call the non linear solver sup. approach for velocity case.

Definition at line 166 of file ReducedUnsteadyNST.H.

◆ newton_object_sup_t

newton_unsteadyNST_sup_t reducedUnsteadyNST::newton_object_sup_t

Functor object to call the non linear solver sup. approach for temperature case.

Definition at line 169 of file ReducedUnsteadyNST.H.

◆ Nphi_t

int reducedUnsteadyNST::Nphi_t

Number of temperature modes.

Definition at line 175 of file ReducedUnsteadyNST.H.

◆ online_solutiont

List< Eigen::MatrixXd> reducedUnsteadyNST::online_solutiont

List of Eigen matrices to store the online solution for temperature equation.

Definition at line 157 of file ReducedUnsteadyNST.H.

◆ P_matrix

Eigen::MatrixXd reducedUnsteadyNST::P_matrix

Divergence of velocity.

Definition at line 148 of file ReducedUnsteadyNST.H.

◆ problem

unsteadyNST* reducedUnsteadyNST::problem

pointer to the FOM problem

Definition at line 205 of file ReducedUnsteadyNST.H.

◆ Q_matrix

List<Eigen::MatrixXd> reducedUnsteadyNST::Q_matrix

Convective Term for temperature transport equation.

Definition at line 145 of file ReducedUnsteadyNST.H.

◆ S_matrix

List<Eigen::MatrixXd> reducedUnsteadyNST::S_matrix

Turbulent thermal term.

Definition at line 139 of file ReducedUnsteadyNST.H.

◆ T_rec

PtrList<volScalarField> reducedUnsteadyNST::T_rec

Reconstructed temperature field.

Definition at line 172 of file ReducedUnsteadyNST.H.

◆ time

scalar reducedUnsteadyNST::time

Scalar to store the current time.

Definition at line 184 of file ReducedUnsteadyNST.H.

◆ Tmodes

PtrList<volScalarField> reducedUnsteadyNST::Tmodes

List of pointers to store the modes for temperature.

Definition at line 160 of file ReducedUnsteadyNST.H.

◆ TREC

PtrList<volScalarField> reducedUnsteadyNST::TREC

Reconstructed temperature field.

Definition at line 178 of file ReducedUnsteadyNST.H.

◆ Tsnapshots

PtrList<volScalarField> reducedUnsteadyNST::Tsnapshots

List of pointers to store the snapshots for temperature.

Definition at line 163 of file ReducedUnsteadyNST.H.

◆ tstart

scalar reducedUnsteadyNST::tstart

Scalar to store the final time if the online simulation.

Definition at line 202 of file ReducedUnsteadyNST.H.

◆ Y_matrix

Eigen::MatrixXd reducedUnsteadyNST::Y_matrix

Laplacian Term for temperature trasnport equation.

Definition at line 127 of file ReducedUnsteadyNST.H.

◆ z

Eigen::VectorXd reducedUnsteadyNST::z

Vector to store the temperature solution during the Newton procedure.

Definition at line 193 of file ReducedUnsteadyNST.H.

◆ z_old

Eigen::VectorXd reducedUnsteadyNST::z_old

Vector to store the previous temperature solution during the Newton procedure.

Definition at line 190 of file ReducedUnsteadyNST.H.


The documentation for this class was generated from the following files: