37#ifndef ReducedUnsteadyNS_H
38#define ReducedUnsteadyNS_H
45#include <unsupported/Eigen/NonLinearOptimization>
46#include <unsupported/Eigen/NumericalDiff>
61 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
62 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
90 int operator()(
const Eigen::VectorXd& x, Eigen::VectorXd& fvec)
const;
91 int df(
const Eigen::VectorXd& x, Eigen::MatrixXd& fjac)
const;
228 fileName folder =
"./online_rec");
Header file of the reducedSteadyNS class.
Template object created to solve non linear problems using the Eigen library.
Class where it is implemented a reduced problem for the steady Navier-stokes problem.
Eigen::MatrixXd vel_now
Online inlet velocity vector.
Class where it is implemented a reduced problem for the unsteady Navier-stokes problem.
newton_unsteadyNS_PPE newton_object_PPE
Function object to call the non linear solver PPE approach.
Eigen::MatrixXd setOnlineVelocity(Eigen::MatrixXd vel)
Sets the online velocity.
bool startFromZero
A variable for starting solving the reduced system from zero or not.
double exportEvery
A variable for exporting the fields.
reducedUnsteadyNS()
Construct Null.
scalar tolerancePenalty
Tolerance for the residual of the boundary values, there is the same tolerance for velocity and tempe...
scalar finalTime
Scalar to store the final time if the online simulation.
Eigen::MatrixXd penalty_sup(Eigen::MatrixXd &vel_now, Eigen::MatrixXd &tauIter, int startSnap=0)
Method to determine the penalty factors iteratively.
newton_unsteadyNS_sup newton_object_sup
Function object to call the non linear solver sup approach.
int timeStepPenalty
Number of timesteps calculated for the iterative penalty method.
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.
scalar tstart
Scalar to store the initial time if the online simulation.
void reconstruct(bool exportFields=false, fileName folder="./online_rec")
Method to reconstruct the solutions from an online solve with a supremizer stabilisation technique.
unsteadyNS * problem
Pointer to the FOM problem.
Eigen::MatrixXd tauIter
Penalty Factor determined with iterative solver.
scalar time
Scalar to store the current time.
scalar maxIterPenalty
Maximum number of iterations to be done for the computation of the penalty factor.
double dt
Scalar to store the time increment.
Eigen::MatrixXd penalty_PPE(Eigen::MatrixXd &vel_now, Eigen::MatrixXd &tauIter, int startSnap=0)
Method to determine the penalty factors iteratively.
double storeEvery
A variable for storing the reduced coefficients.
Implementation of a parametrized full order unsteady NS problem and preparation of the the reduced ...
Newton object for the resolution of the reduced problem using a PPE approach.
int df(const Eigen::VectorXd &x, Eigen::MatrixXd &fjac) const
int operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) const
newton_unsteadyNS_PPE(int Nx, int Ny, unsteadyNS &problem)
Newton object for the resolution of the reduced problem using a supremizer approach.
newton_unsteadyNS_sup(int Nx, int Ny, unsteadyNS &problem)
int df(const Eigen::VectorXd &x, Eigen::MatrixXd &fjac) const
int operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) const
Header file of the unsteadyNS class.