37#ifndef ReducedUnsteadyNSTurb_H
38#define ReducedUnsteadyNSTurb_H
44#include "UnsteadyNSTurb.H"
46#include <unsupported/Eigen/NonLinearOptimization>
47#include <unsupported/Eigen/NumericalDiff>
53 newtonUnsteadyNSTurbSUP() {}
55 newtonUnsteadyNSTurbSUP(
int Nx,
int Ny,
58 Nphi_u(problem.NUmodes + problem.liftfield.size() + problem.NSUPmodes),
59 nphiNut(problem.nNutModes),
60 Nphi_p(problem.NPmodes),
61 N_BC(problem.inletIndex.rows()),
62 gNut(problem.nNutModes)
65 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
66 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
75 Eigen::VectorXd y_old;
76 Eigen::VectorXd yOldOld;
80 std::vector<SPLINTER::RBFSpline*> SPLINES;
88 newtonUnsteadyNSTurbPPE() {}
90 newtonUnsteadyNSTurbPPE(
int Nx,
int Ny,
93 Nphi_u(problem.NUmodes + problem.liftfield.size()),
94 nphiNut(problem.nNutModes),
95 Nphi_p(problem.NPmodes),
96 N_BC(problem.inletIndex.rows()),
97 gNut(problem.nNutModes)
100 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
101 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
110 Eigen::VectorXd y_old;
111 Eigen::VectorXd yOldOld;
113 Eigen::MatrixXd tauU;
114 Eigen::VectorXd gNut;
115 std::vector<SPLINTER::RBFSpline*> SPLINES;
121 newtonUnsteadyNSTurbSUPAve() {}
123 newtonUnsteadyNSTurbSUPAve(
int Nx,
int Ny,
126 Nphi_u(problem.NUmodes + problem.liftfield.size() + problem.NSUPmodes),
127 nphiNut(problem.nNutModes),
128 Nphi_p(problem.NPmodes),
129 N_BC(problem.inletIndex.rows()),
130 gNut(problem.nNutModes),
131 gNutAve(problem.nutAve.size())
134 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
135 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
144 Eigen::VectorXd y_old;
145 Eigen::VectorXd yOldOld;
147 Eigen::MatrixXd tauU;
148 Eigen::VectorXd gNut;
149 Eigen::VectorXd gNutAve;
150 std::vector<SPLINTER::RBFSpline*> SPLINES;
156 newtonUnsteadyNSTurbPPEAve() {}
158 newtonUnsteadyNSTurbPPEAve(
int Nx,
int Ny,
161 Nphi_u(problem.NUmodes + problem.liftfield.size()),
162 nphiNut(problem.nNutModes),
163 Nphi_p(problem.NPmodes),
164 N_BC(problem.inletIndex.rows()),
165 gNut(problem.nNutModes),
166 gNutAve(problem.nutAve.size())
170 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
171 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
180 Eigen::VectorXd y_old;
181 Eigen::VectorXd yOldOld;
183 Eigen::MatrixXd tauU;
184 Eigen::VectorXd gNut;
185 Eigen::VectorXd gNutAve;
186 std::vector<SPLINTER::RBFSpline*> SPLINES;
305 fileName folder =
"./online_rec");
Header file of the reducedSteadyNS class.
Header file of the reducedUnsteadyNS class.
void solveOnlinePPEAve(Eigen::MatrixXd velNow)
Method to perform an online solve using a PPE stabilisation method with the use of the average splitt...
ReducedUnsteadyNSTurb()
Construct Null.
int nphiNut
Number of viscosity modes.
newtonUnsteadyNSTurbSUP newtonObjectSUP
Function object to call the non linear solver sup approach.
newtonUnsteadyNSTurbSUPAve newtonObjectSUPAve
Function object to call the non linear solver sup approach with the splitting of the eddy viscosity.
PtrList< volScalarField > nutRecFields
Reconstructed eddy viscosity fields list.
void solveOnlineSUPAve(Eigen::MatrixXd velNow)
Method to perform an online solve using a supremizer stabilisation method with the use of the average...
Eigen::MatrixXd rbfCoeffMat
The matrix of the eddy viscosity RBF interoplated coefficients.
bool skipLift
Interpolation boolean variable to skip lifting functions.
int dimA
Dimension of the interpolation independent variable.
Eigen::VectorXd muStar
Online parameter value.
Eigen::MatrixXd initCond
The matrix of the initial velocity and pressure reduced coefficients.
Eigen::VectorXd gNutAve
The reduced average vector for viscosity coefficients.
void solveOnlineSUP(Eigen::MatrixXd velNow)
Method to perform an online solve using a supremizer stabilisation method.
int interChoice
Interpolation independent variable choice.
newtonUnsteadyNSTurbPPE newtonObjectPPE
Function object to call the non linear solver PPE approach.
void reconstruct(bool exportFields=false, fileName folder="./online_rec")
Method to reconstruct the solutions from an online solve with any of the two techniques SUP or the PP...
PtrList< volScalarField > nutModes
List of pointers to store the modes for the eddy viscosity.
void solveOnlinePPE(Eigen::MatrixXd velNow)
Method to perform an online solve using a PPE stabilisation method.
UnsteadyNSTurb * problem
Pointer to the FOM problem.
newtonUnsteadyNSTurbPPEAve newtonObjectPPEAve
Function object to call the non linear solver PPE approach with the splitting of the eddy viscosity.
Eigen::MatrixXd setOnlineVelocity(Eigen::MatrixXd vel)
Sets the online velocity.
Eigen::VectorXd nut0
The initial eddy viscosity reduced coefficients.
Implementation of a parametrized full order unsteady NS problem and preparation of the reduced matr...
reducedUnsteadyNS()
Construct Null.