Loading...
Searching...
No Matches
HyperReducedCompressibleUnSteadyNS Class Reference

Class where it is implemented a reduced problem for the UnSteady RhoPimple problem. More...

#include <HyperReducedCompressibleUnSteadyNS.H>

Inheritance diagram for HyperReducedCompressibleUnSteadyNS:
ReducedCompressibleSteadyNS ReducedSteadyNSTurb reducedSteadyNS reducedProblem

Public Member Functions

 HyperReducedCompressibleUnSteadyNS ()
 Construct Null.
 HyperReducedCompressibleUnSteadyNS (CompressibleUnSteadyRhoPimple &problem)
 Construct Null.
void SolveHyperReducedSys (int NmodesUproj, int NmodesPproj, int NmodesEproj, fileName folder="./ITHACAoutput/Online/")
 Method to perform an online solve using a PPE stabilisation method.
void setOnlineVelocity (Eigen::MatrixXd vel)
 It checks if the number of imposed boundary conditions is correct and set the inlet velocity equal to the given one.
void projectReducedOperators (int NmodesUproj, int NmodesPproj, int NmodesEproj)
 It assembles the reduced oeprators using the modes.
std::tuple< Eigen::MatrixXd, Eigen::VectorXd > HyperReducedSys (Eigen::SparseMatrix< double > &S, Eigen::VectorXd &se, List< label > &MagicPoints, Eigen::MatrixXd &Modes)
 It assembles the reduced oeprators using the modes.
bool checkWrite (Time &timeObject)
 Method to check and write solutions.
Public Member Functions inherited from ReducedCompressibleSteadyNS
 ReducedCompressibleSteadyNS ()
 Construct Null.
 ReducedCompressibleSteadyNS (CompressibleSteadyNS &problem)
 Construct Null.
void solveOnlineCompressible (scalar mu_now, int NmodesUproj, int NmodesPproj, int NmodesEproj)
 Method to perform an online solve using a PPE stabilisation method.
void setOnlineVelocity (Eigen::MatrixXd vel)
 It checks if the number of imposed boundary conditions is correct and set the inlet velocity equal to the given one.
void projectReducedOperators (int NmodesUproj, int NmodesPproj, int NmodesEproj)
 It assembles the reduced oeprators using the modes.
Public Member Functions inherited from ReducedSteadyNSTurb
 ReducedSteadyNSTurb ()
 Construct Null.
 ReducedSteadyNSTurb (SteadyNSTurb &problem)
 Construct Null.
void solveOnlineSUP (Eigen::MatrixXd velNow)
 Method to perform an online solve using a supremizer stabilisation method.
void solveOnlinePPE (Eigen::MatrixXd velNow)
 Method to perform an online solve using a PPE stabilisation method.
void reconstruct (bool exportFields=false, fileName folder="./ITHACAoutput/online_rec", int printevery=1)
 Method to reconstruct the solutions from an online solve.
Eigen::MatrixXd setOnlineVelocity (Eigen::MatrixXd vel)
 Sets the online velocity.
Public Member Functions inherited from reducedSteadyNS
 reducedSteadyNS ()
 Construct Null.
 reducedSteadyNS (steadyNS &problem)
 Construct Null.
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.
 reducedProblem (reductionProblem &problem)
 Construct with reduced Problem.
virtual void solveOnline ()
 Virtual Method to perform and online Solve.

Public Attributes

volVectorModes Umodes
 velocity modes.
volScalarModes Emodes
volScalarModes Pmodes
scalar startTime = 0.0
scalar finalTime = 0.0
scalar timeStep = 0.0
scalar writeEvery = timeStep
scalar nextWrite = 0.0
PtrList< volScalarField > Pfield
 List to save the solutions.
PtrList< volScalarField > Efield
PtrList< volVectorField > Ufield
volScalarModes nutModes
CompressibleUnSteadyRhoPimpleproblem
 Full problem.
Eigen::MatrixXd vel_now
 Imposed boundary conditions.
int counter = 0
 Counter.
Eigen::MatrixXd projGradModP
 Projected gradient of the pressure modes.
Public Attributes inherited from ReducedCompressibleSteadyNS
volVectorModes ULmodes
 Lifted velocity modes.
CompressibleSteadyNSproblem
 Full problem.
Eigen::MatrixXd vel_now
 Imposed boundary conditions.
int counter = 0
 Counter.
Eigen::MatrixXd projGradModP
 Projected gradient of the pressure modes.
Public Attributes inherited from ReducedSteadyNSTurb
PtrList< volScalarField > nutFields
 List of snapshots for the solution for eddy viscosity.
PtrList< volScalarField > nutModes
 List of POD modes for eddy viscosity.
Eigen::MatrixXd rbfCoeffMat
 The matrix of the eddy viscosity RBF interoplated coefficients.
Eigen::VectorXd rbfCoeff
 Vector of eddy viscosity RBF interoplated coefficients.
int nphiNut
 Number of viscosity modes.
newtonSteadyNSTurbSUP newtonObjectSUP
 Newton Object to solve the nonlinear problem sup approach.
newtonSteadyNSTurbPPE newtonObjectPPE
 Newton Object to solve the nonlinear problem PPE approach.
SteadyNSTurbproblem
 Pointer to the FOM problem.
PtrList< volScalarField > nutRecFields
 Reconstructed eddy viscosity fields list.
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 RhoPimple problem.

In this class are implemented the methods to solve a hyper reduced version of the unstationary Navier-stokes equations. This class must be used together with the compressible unsteadyNS class

Definition at line 57 of file HyperReducedCompressibleUnSteadyNS.H.

Constructor & Destructor Documentation

◆ HyperReducedCompressibleUnSteadyNS() [1/2]

HyperReducedCompressibleUnSteadyNS::HyperReducedCompressibleUnSteadyNS ( )

Construct Null.

Definition at line 39 of file HyperReducedCompressibleUnSteadyNS.C.

◆ HyperReducedCompressibleUnSteadyNS() [2/2]

HyperReducedCompressibleUnSteadyNS::HyperReducedCompressibleUnSteadyNS ( CompressibleUnSteadyRhoPimple & problem)
explicit

Construct Null.

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

Definition at line 43 of file HyperReducedCompressibleUnSteadyNS.C.

◆ ~HyperReducedCompressibleUnSteadyNS()

HyperReducedCompressibleUnSteadyNS::~HyperReducedCompressibleUnSteadyNS ( )
inline

Definition at line 74 of file HyperReducedCompressibleUnSteadyNS.H.

Member Function Documentation

◆ checkWrite()

bool HyperReducedCompressibleUnSteadyNS::checkWrite ( Time & timeObject)

Method to check and write solutions.

Definition at line 131 of file HyperReducedCompressibleUnSteadyNS.C.

◆ HyperReducedSys()

std::tuple< Eigen::MatrixXd, Eigen::VectorXd > HyperReducedCompressibleUnSteadyNS::HyperReducedSys ( Eigen::SparseMatrix< double > & S,
Eigen::VectorXd & se,
List< label > & MagicPoints,
Eigen::MatrixXd & Modes )

It assembles the reduced oeprators using the modes.

Parameters
[in]SThe SparseMatrix from which you want to extract the rows indices.
[in]sThe SparseMatrix from which you want to extract the rows indices.
[in]MagicPointscoming from DEIM
[in]Modesmodes given by the DEIM

Definition at line 96 of file HyperReducedCompressibleUnSteadyNS.C.

◆ projectReducedOperators()

void HyperReducedCompressibleUnSteadyNS::projectReducedOperators ( int NmodesUproj,
int NmodesPproj,
int NmodesEproj )

It assembles the reduced oeprators using the modes.

Parameters
[in]NmodesUprojThe number of modes one wants to use for velocity projection.
[in]NmodesPprojThe number of modes one wants to use for pressure projection.
[in]NmodesEprojThe number of modes one wants to use for energy projection.

◆ setOnlineVelocity()

void HyperReducedCompressibleUnSteadyNS::setOnlineVelocity ( Eigen::MatrixXd vel)

It checks if the number of imposed boundary conditions is correct and set the inlet velocity equal to the given one.

Parameters
[in]velInlet velocity

◆ SolveHyperReducedSys()

void HyperReducedCompressibleUnSteadyNS::SolveHyperReducedSys ( int NmodesUproj,
int NmodesPproj,
int NmodesEproj,
fileName folder = "./ITHACAoutput/Online/" )

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

Parameters
[in]mu_nowThe online viscosity.
[in]NmodesUprojThe number of modes one wants to use for velocity projection.
[in]NmodesPprojThe number of modes one wants to use for pressure projection.
[in]NmodesEprojThe number of modes one wants to use for energy projection.

Definition at line 72 of file HyperReducedCompressibleUnSteadyNS.C.

Member Data Documentation

◆ counter

int HyperReducedCompressibleUnSteadyNS::counter = 0

Counter.

Definition at line 150 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Efield

PtrList<volScalarField> HyperReducedCompressibleUnSteadyNS::Efield

Definition at line 135 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Emodes

volScalarModes HyperReducedCompressibleUnSteadyNS::Emodes

Definition at line 127 of file HyperReducedCompressibleUnSteadyNS.H.

◆ finalTime

scalar HyperReducedCompressibleUnSteadyNS::finalTime = 0.0

Definition at line 130 of file HyperReducedCompressibleUnSteadyNS.H.

◆ nextWrite

scalar HyperReducedCompressibleUnSteadyNS::nextWrite = 0.0

Definition at line 133 of file HyperReducedCompressibleUnSteadyNS.H.

◆ nutModes

volScalarModes HyperReducedCompressibleUnSteadyNS::nutModes

Definition at line 141 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Pfield

PtrList<volScalarField> HyperReducedCompressibleUnSteadyNS::Pfield

List to save the solutions.

Definition at line 135 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Pmodes

volScalarModes HyperReducedCompressibleUnSteadyNS::Pmodes

Definition at line 127 of file HyperReducedCompressibleUnSteadyNS.H.

◆ problem

CompressibleUnSteadyRhoPimple* HyperReducedCompressibleUnSteadyNS::problem

Full problem.

Definition at line 144 of file HyperReducedCompressibleUnSteadyNS.H.

◆ projGradModP

Eigen::MatrixXd HyperReducedCompressibleUnSteadyNS::projGradModP

Projected gradient of the pressure modes.

Definition at line 155 of file HyperReducedCompressibleUnSteadyNS.H.

◆ startTime

scalar HyperReducedCompressibleUnSteadyNS::startTime = 0.0

Definition at line 129 of file HyperReducedCompressibleUnSteadyNS.H.

◆ timeStep

scalar HyperReducedCompressibleUnSteadyNS::timeStep = 0.0

Definition at line 131 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Ufield

PtrList<volVectorField> HyperReducedCompressibleUnSteadyNS::Ufield

Definition at line 136 of file HyperReducedCompressibleUnSteadyNS.H.

◆ Umodes

volVectorModes HyperReducedCompressibleUnSteadyNS::Umodes

velocity modes.

Definition at line 126 of file HyperReducedCompressibleUnSteadyNS.H.

◆ vel_now

Eigen::MatrixXd HyperReducedCompressibleUnSteadyNS::vel_now

Imposed boundary conditions.

Definition at line 147 of file HyperReducedCompressibleUnSteadyNS.H.

◆ writeEvery

scalar HyperReducedCompressibleUnSteadyNS::writeEvery = timeStep

Definition at line 132 of file HyperReducedCompressibleUnSteadyNS.H.


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