KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Fractional-step strategy for incompressible Navier-Stokes formulation This strategy implements a splitting scheme for the incompressible Navier-Stokes equations. It is intended to be used in combination with the FractionalStep element in the FluidDynamicsApplication. The fractional step index, which is stored in the ProcessInfo, takes the values 1 : Momentum step (calculate fractional step velocity) 2-3 : Unused (reserved for componentwise calculation of frac step velocity) 4 : Pressure step 5 : Computation of projections 6 : End of step velocity. More...
#include <fractional_step_strategy.h>
Public Member Functions | |
Life Cycle | |
FractionalStepStrategy (ModelPart &rModelPart, SolverSettingsType &rSolverConfig, bool PredictorCorrector) | |
FractionalStepStrategy (ModelPart &rModelPart, SolverSettingsType &rSolverConfig, bool PredictorCorrector, const Kratos::Variable< int > &PeriodicVar) | |
FractionalStepStrategy (ModelPart &rModelPart, SolverSettingsType &rSolverConfig, bool PredictorCorrector, bool CalculateReactionsFlag) | |
FractionalStepStrategy (ModelPart &rModelPart, SolverSettingsType &rSolverConfig, bool PredictorCorrector, bool CalculateReactionsFlag, const Kratos::Variable< int > &PeriodicVar) | |
~FractionalStepStrategy () override | |
Destructor. More... | |
Operations | |
void | Initialize () override |
Initialization of member variables and prior operations. More... | |
int | Check () override |
Function to perform expensive checks. More... | |
void | InitializeSolutionStep () override |
Performs all the required operations that should be done (for each step) before solving the solution step. More... | |
bool | SolveSolutionStep () override |
Solves the current step. This function returns true if a solution has been found, false otherwise. More... | |
void | FinalizeSolutionStep () override |
Performs all the required operations that should be done (for each step) after solving the solution step. More... | |
virtual void | CalculateReactions () |
Calculates the reactions This methods calculates the reactions of the momentum equation. These are computed as minus the RHS and saved in the REACTION variable. More... | |
virtual void | AddIterationStep (Process::Pointer pNewStep) |
virtual void | ClearExtraIterationSteps () |
void | Clear () override |
Clears the internal storage. More... | |
Access | |
void | SetEchoLevel (int Level) override |
This sets the level of echo for the solving strategy. More... | |
void | SetCalculateReactionsFlag (bool CalculateReactionsFlag) |
This method sets the flag mCalculateReactionsFlag. More... | |
bool | GetCalculateReactionsFlag () |
This method returns the flag mCalculateReactionsFlag. More... | |
Input and output | |
std::string | Info () const override |
Turn back information as a string. More... | |
void | PrintInfo (std::ostream &rOStream) const override |
Print information about this object. More... | |
void | PrintData (std::ostream &rOStream) const override |
Print object's data. More... | |
Public Member Functions inherited from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | |
ImplicitSolvingStrategy () | |
Default constructor. More... | |
ImplicitSolvingStrategy (ModelPart &rModelPart, Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
ImplicitSolvingStrategy (ModelPart &rModelPart, bool MoveMeshFlag=false) | |
Default constructor. More... | |
virtual | ~ImplicitSolvingStrategy () |
BaseType::Pointer | Create (ModelPart &rModelPart, Parameters ThisParameters) const override |
Create method. More... | |
void | SetRebuildLevel (int Level) override |
This sets the build level. More... | |
int | GetRebuildLevel () const override |
This returns the build level. More... | |
void | SetStiffnessMatrixIsBuilt (const bool StiffnessMatrixIsBuilt) |
This method sets the flag mStiffnessMatrixIsBuilt. More... | |
bool | GetStiffnessMatrixIsBuilt () const |
This method gets the flag mStiffnessMatrixIsBuilt. More... | |
KRATOS_CLASS_POINTER_DEFINITION (ImplicitSolvingStrategy) | |
Parameters | GetDefaultParameters () const override |
This method provides the defaults parameters to avoid conflicts between the different constructors. More... | |
Public Member Functions inherited from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace > | |
SolvingStrategy () | |
Default constructor. More... | |
SolvingStrategy (ModelPart &rModelPart, Parameters ThisParameters) | |
Default constructor. (with parameters) More... | |
SolvingStrategy (ModelPart &rModelPart, bool MoveMeshFlag=false) | |
Default constructor. More... | |
virtual | ~SolvingStrategy () |
KRATOS_CLASS_POINTER_DEFINITION (SolvingStrategy) | |
virtual void | Predict () |
Operation to predict the solution ... if it is not called a trivial predictor is used in which the values of the solution step of interest are assumed equal to the old values. More... | |
virtual double | Solve () |
The problem of interest is solved. More... | |
virtual bool | IsConverged () |
This should be considered as a "post solution" convergence check which is useful for coupled analysis. More... | |
virtual void | CalculateOutputData () |
This operations should be called before printing the results when non trivial results (e.g. stresses) need to be calculated given the solution of the step. More... | |
int | GetEchoLevel () |
This returns the level of echo for the solving strategy. More... | |
void | SetMoveMeshFlag (bool Flag) |
This function sets the flag that says if the mesh is moved. More... | |
bool | MoveMeshFlag () |
This function returns the flag that says if the mesh is moved. More... | |
bool | GetMoveMeshFlag () |
This function returns the flag that says if the mesh is moved. More... | |
virtual void | MoveMesh () |
This function is designed to move the mesh. More... | |
ModelPart & | GetModelPart () |
Operations to get the pointer to the model. More... | |
const ModelPart & | GetModelPart () const |
Operations to get the pointer to the model. More... | |
virtual double | GetResidualNorm () |
Operations to get the residual norm. More... | |
virtual TSystemMatrixType & | GetSystemMatrix () |
This method returns the LHS matrix. More... | |
virtual TSystemVectorType & | GetSystemVector () |
This method returns the RHS vector. More... | |
virtual TSystemVectorType & | GetSolutionVector () |
This method returns the solution vector. More... | |
Protected Member Functions | |
Protected Operations | |
void | SetTimeCoefficients () |
Set the Time Coefficients object Calculate the coefficients for the BDF2 time iteration. These are stored in the BDF_COEFFICIENTS variable of the ProcessInfo container. More... | |
virtual std::tuple< bool, double > | SolveStep () |
bool | CheckFractionalStepConvergence (const double NormDv) |
bool | CheckPressureConvergence (const double NormDp) |
virtual void | ComputeSplitOssProjections (ModelPart &rModelPart) |
virtual void | CalculateEndOfStepVelocity () |
void | EnforceSlipCondition (const Kratos::Flags &rSlipWallFlag) |
Substract wall-normal component of velocity update to ensure that the final velocity satisfies slip conditions. More... | |
void | PeriodicConditionProjectionCorrection (ModelPart &rModelPart) |
void | PeriodicConditionVelocityCorrection (ModelPart &rModelPart) |
Protected Member Functions inherited from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | |
void | AssignSettings (const Parameters ThisParameters) override |
This method assigns settings to member variables. More... | |
Protected Member Functions inherited from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace > | |
virtual Parameters | ValidateAndAssignParameters (Parameters ThisParameters, const Parameters DefaultParameters) const |
This method validate and assign default parameters. More... | |
Protected Attributes | |
Protected member Variables | |
double | mVelocityTolerance |
double | mPressureTolerance |
double | mPressureGradientRelaxationFactor |
unsigned int | mMaxVelocityIter |
unsigned int | mMaxPressureIter |
unsigned int | mDomainSize |
unsigned int | mTimeOrder |
bool | mPredictorCorrector |
bool | mUseSlipConditions |
bool | mReformDofSet |
bool | mCalculateReactionsFlag |
StrategyPointerType | mpMomentumStrategy |
Scheme for the solution of the momentum equation. More... | |
StrategyPointerType | mpPressureStrategy |
Scheme for the solution of the mass equation. More... | |
std::vector< Process::Pointer > | mExtraIterationSteps |
const Kratos::Variable< int > & | mrPeriodicIdVar |
Protected Attributes inherited from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | |
int | mRebuildLevel |
bool | mStiffnessMatrixIsBuilt |
The current rebuild level. More... | |
Protected Attributes inherited from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace > | |
int | mEchoLevel |
Type Definitions | |
typedef ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | BaseType |
typedef BaseType::LocalSystemVectorType | LocalSystemVectorType |
typedef BaseType::LocalSystemMatrixType | LocalSystemMatrixType |
typedef ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::Pointer | StrategyPointerType |
typedef SolverSettings< TSparseSpace, TDenseSpace, TLinearSolver > | SolverSettingsType |
KRATOS_CLASS_POINTER_DEFINITION (FractionalStepStrategy) | |
Counted pointer of FractionalStepStrategy. More... | |
Fractional-step strategy for incompressible Navier-Stokes formulation This strategy implements a splitting scheme for the incompressible Navier-Stokes equations. It is intended to be used in combination with the FractionalStep element in the FluidDynamicsApplication. The fractional step index, which is stored in the ProcessInfo, takes the values 1 : Momentum step (calculate fractional step velocity) 2-3 : Unused (reserved for componentwise calculation of frac step velocity) 4 : Pressure step 5 : Computation of projections 6 : End of step velocity.
TSparseSpace | Sparse space template type |
TDenseSpace | Dense space template type |
TLinearSolver | Linear solver template type |
typedef ImplicitSolvingStrategy<TSparseSpace, TDenseSpace, TLinearSolver> Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::BaseType |
typedef BaseType::LocalSystemMatrixType Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::LocalSystemMatrixType |
typedef BaseType::LocalSystemVectorType Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::LocalSystemVectorType |
typedef SolverSettings<TSparseSpace,TDenseSpace,TLinearSolver> Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::SolverSettingsType |
typedef ImplicitSolvingStrategy<TSparseSpace, TDenseSpace, TLinearSolver>::Pointer Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::StrategyPointerType |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverride |
Destructor.
|
inlinevirtual |
|
inlineprotectedvirtual |
|
inlinevirtual |
Calculates the reactions This methods calculates the reactions of the momentum equation. These are computed as minus the RHS and saved in the REACTION variable.
|
inlineoverridevirtual |
Function to perform expensive checks.
It is designed to be called ONCE to verify that the input is correct.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Clears the internal storage.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlinevirtual |
|
inlineprotectedvirtual |
|
inlineprotected |
Substract wall-normal component of velocity update to ensure that the final velocity satisfies slip conditions.
rSlipWallFlag | If Node.Is(rSlipWallFlag) == true, the node is in the wall. |
|
inlineoverridevirtual |
Performs all the required operations that should be done (for each step) after solving the solution step.
A member variable should be used as a flag to make sure this function is called only once per step.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
This method returns the flag mCalculateReactionsFlag.
|
inlineoverridevirtual |
Turn back information as a string.
Reimplemented from Kratos::ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >.
|
inlineoverridevirtual |
Initialization of member variables and prior operations.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Performs all the required operations that should be done (for each step) before solving the solution step.
A member variable should be used as a flag to make sure this function is called only once per step.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
Kratos::FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::KRATOS_CLASS_POINTER_DEFINITION | ( | FractionalStepStrategy< TSparseSpace, TDenseSpace, TLinearSolver > | ) |
Counted pointer of FractionalStepStrategy.
|
inlineprotected |
On periodic boundaries, the nodal area and the values to project need to take into account contributions from elements on both sides of the boundary. This is done using the conditions and the non-historical nodal data containers as follows:
1- The partition that owns the PeriodicCondition adds the values on both nodes to their non-historical containers.
2- The non-historical containers are added across processes, transmiting the right value from the condition owner to all partitions.
3- The value on all periodic nodes is replaced by the one received in step 2.
|
inlineprotected |
|
inlineoverridevirtual |
Print object's data.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inline |
This method sets the flag mCalculateReactionsFlag.
CalculateReactionsFlag | The flag that tells if the reactions are computed |
|
inlineoverridevirtual |
This sets the level of echo for the solving strategy.
Level | of echo for the solving strategy |
{ 0 -> Mute... no echo at all 1 -> Printing time and basic information 2 -> Printing linear solver data 3 -> Print of debug information: Echo of stiffness matrix, Dx, b... }
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineprotected |
Set the Time Coefficients object Calculate the coefficients for the BDF2 time iteration. These are stored in the BDF_COEFFICIENTS variable of the ProcessInfo container.
|
inlineoverridevirtual |
Solves the current step. This function returns true if a solution has been found, false otherwise.
Reimplemented from Kratos::SolvingStrategy< TSparseSpace, TDenseSpace >.
|
inlineprotectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Scheme for the solution of the momentum equation.
|
protected |
Scheme for the solution of the mass equation.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |