9 #ifndef KRATOS_TWO_STEP_V_P_DEM_COUPLING_STRATEGY_H
10 #define KRATOS_TWO_STEP_V_P_DEM_COUPLING_STRATEGY_H
29 #include "custom_utilities/solver_settings.h"
65 template <
class TSparseSpace,
115 typename TLinearSolver::Pointer pVelocityLinearSolver,
116 typename TLinearSolver::Pointer pPressureLinearSolver,
117 bool ReformDofSet =
true,
118 double VelTol = 0.0001,
119 double PresTol = 0.0001,
120 int MaxPressureIterations = 1,
121 unsigned int TimeOrder = 2,
122 unsigned int DomainSize = 2) :
BaseType(rModelPart,
123 pVelocityLinearSolver,
124 pPressureLinearSolver,
128 MaxPressureIterations,
153 if ((
i)->IsNot(ISOLATED) && ((
i)->IsNot(RIGID) || (
i)->Is(SOLID)))
155 this->
UpdateAccelerations(CurrentAcceleration, CurrentVelocity, PreviousAcceleration, PreviousVelocity);
157 else if ((
i)->Is(RIGID))
160 (
i)->FastGetSolutionStepValue(ACCELERATION, 0) = Zeros;
161 (
i)->FastGetSolutionStepValue(ACCELERATION, 1) = Zeros;
165 (
i)->FastGetSolutionStepValue(PRESSURE, 0) = 0.0;
166 (
i)->FastGetSolutionStepValue(PRESSURE, 1) = 0.0;
167 (
i)->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0) = 0.0;
168 (
i)->FastGetSolutionStepValue(PRESSURE_VELOCITY, 1) = 0.0;
169 (
i)->FastGetSolutionStepValue(PRESSURE_ACCELERATION, 0) = 0.0;
170 (
i)->FastGetSolutionStepValue(PRESSURE_ACCELERATION, 1) = 0.0;
171 if ((
i)->SolutionStepsDataHas(VOLUME_ACCELERATION))
174 (
i)->FastGetSolutionStepValue(ACCELERATION, 0) = VolumeAcceleration;
175 (
i)->FastGetSolutionStepValue(VELOCITY, 0) += VolumeAcceleration * rCurrentProcessInfo[DELTA_TIME];
179 const double timeInterval = rCurrentProcessInfo[DELTA_TIME];
180 unsigned int timeStep = rCurrentProcessInfo[STEP];
183 (
i)->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0) = 0;
184 (
i)->FastGetSolutionStepValue(PRESSURE_VELOCITY, 1) = 0;
185 (
i)->FastGetSolutionStepValue(PRESSURE_ACCELERATION, 0) = 0;
186 (
i)->FastGetSolutionStepValue(PRESSURE_ACCELERATION, 1) = 0;
190 double &CurrentPressure = (
i)->FastGetSolutionStepValue(PRESSURE, 0);
191 double &PreviousPressure = (
i)->FastGetSolutionStepValue(PRESSURE, 1);
192 double &CurrentPressureVelocity = (
i)->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0);
193 double &CurrentPressureAcceleration = (
i)->FastGetSolutionStepValue(PRESSURE_ACCELERATION, 0);
195 CurrentPressureAcceleration = CurrentPressureVelocity / timeInterval;
197 CurrentPressureVelocity = (CurrentPressure - PreviousPressure) / timeInterval;
199 CurrentPressureAcceleration += -CurrentPressureVelocity / timeInterval;
201 double &previousFluidFraction = (
i)->FastGetSolutionStepValue(FLUID_FRACTION_OLD);
202 previousFluidFraction = (
i)->FastGetSolutionStepValue(FLUID_FRACTION);
211 const double TimeStep = rCurrentProcessInfo[DELTA_TIME];
216 if ((
i)->IsNot(PFEMFlags::EULERIAN_INLET))
225 const double ¤tFluidFraction = (
i)->FastGetSolutionStepValue(FLUID_FRACTION);
226 const double &previousFluidFraction = (
i)->FastGetSolutionStepValue(FLUID_FRACTION_OLD);
227 double ¤tFluidFractionRate = (
i)->FastGetSolutionStepValue(FLUID_FRACTION_RATE);
230 CurrentDisplacement[0] = 0.5 * TimeStep * (CurrentVelocity[0] + PreviousVelocity[0]) + PreviousDisplacement[0];
233 CurrentDisplacement[1] = 0.5 * TimeStep * (CurrentVelocity[1] + PreviousVelocity[1]) + PreviousDisplacement[1];
236 CurrentDisplacement[2] = 0.5 * TimeStep * (CurrentVelocity[2] + PreviousVelocity[2]) + PreviousDisplacement[2];
238 currentFluidFractionRate = (currentFluidFraction - previousFluidFraction) / TimeStep;
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
Definition: two_step_v_p_DEM_coupling_strategy.h:69
Helper class to define solution strategies for TwoStepVPStrategy.
Definition: solver_settings.h:57
Definition: two_step_v_p_strategy.h:71
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: two_step_v_p_strategy.h:89
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: two_step_v_p_strategy.h:87
BaseType::TSystemVectorType TSystemVectorType
Definition: two_step_v_p_strategy.h:85
BaseType::TSystemMatrixType TSystemMatrixType
Definition: two_step_v_p_strategy.h:83
BaseType::TDataType TDataType
Definition: two_step_v_p_strategy.h:79
void UpdateAccelerations(array_1d< double, 3 > &CurrentAcceleration, const array_1d< double, 3 > &CurrentVelocity, array_1d< double, 3 > &PreviousAcceleration, const array_1d< double, 3 > &PreviousVelocity)
Definition: v_p_strategy.h:385
virtual void InitializeStrategy(SolverSettingsType &rSolverConfig)
Definition: v_p_strategy.h:886
BaseType::TSystemMatrixType TSystemMatrixType
Definition: two_step_v_p_DEM_coupling_strategy.h:86
void CalculateDisplacementsAndPorosity() override
Definition: two_step_v_p_DEM_coupling_strategy.h:207
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: two_step_v_p_DEM_coupling_strategy.h:92
TwoStepVPSolverSettings< TSparseSpace, TDenseSpace, TLinearSolver > SolverSettingsType
Definition: two_step_v_p_DEM_coupling_strategy.h:96
TwoStepVPDEMcouplingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::Pointer StrategyPointerType
Definition: two_step_v_p_DEM_coupling_strategy.h:94
TwoStepVPStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Counted pointer of TwoStepVPDEMcouplingStrategy.
Definition: two_step_v_p_DEM_coupling_strategy.h:78
TwoStepVPDEMcouplingStrategy(ModelPart &rModelPart, typename TLinearSolver::Pointer pVelocityLinearSolver, typename TLinearSolver::Pointer pPressureLinearSolver, bool ReformDofSet=true, double VelTol=0.0001, double PresTol=0.0001, int MaxPressureIterations=1, unsigned int TimeOrder=2, unsigned int DomainSize=2)
Definition: two_step_v_p_DEM_coupling_strategy.h:113
KRATOS_CLASS_POINTER_DEFINITION(TwoStepVPDEMcouplingStrategy)
virtual ~TwoStepVPDEMcouplingStrategy()
Destructor.
Definition: two_step_v_p_DEM_coupling_strategy.h:135
BaseType::TDataType TDataType
Definition: two_step_v_p_DEM_coupling_strategy.h:80
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: two_step_v_p_DEM_coupling_strategy.h:90
BaseType::DofsArrayType DofsArrayType
Definition: two_step_v_p_DEM_coupling_strategy.h:84
TwoStepVPDEMcouplingStrategy(ModelPart &rModelPart, SolverSettingsType &rSolverConfig)
Definition: two_step_v_p_DEM_coupling_strategy.h:107
BaseType::TSystemVectorType TSystemVectorType
Definition: two_step_v_p_DEM_coupling_strategy.h:88
void CalculateTemporalVariables() override
Definition: two_step_v_p_DEM_coupling_strategy.h:137
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
integer i
Definition: TensorModule.f:17