12 #if !defined(KRATOS_RESIDUALBASED_CONVECTION_DIFFUSION_STRATEGY )
13 #define KRATOS_RESIDUALBASED_CONVECTION_DIFFUSION_STRATEGY
83 template<
class TSparseSpace,
131 typename TLinearSolver::Pointer pNewLinearSolver,
134 int prediction_order = 2
142 mprediction_order = prediction_order;
145 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.
GetValue(CONVECTION_DIFFUSION_SETTINGS);
153 typename SchemeType::Pointer pscheme =
typename SchemeType::Pointer
156 bool CalculateReactions =
false;
157 bool CalculateNormDxFlag =
true;
175 CalculateNormDxFlag));
176 mstep1->SetEchoLevel(2);
198 double Dt = rCurrentProcessInfo[DELTA_TIME];
199 int stationary= rCurrentProcessInfo[STATIONARY];
205 rCurrentProcessInfo[FRACTIONAL_STEP] = 1;
206 Dp_norm = mstep1->Solve();
214 double dt_old = rCurrentProcessInfo.GetPreviousTimeStepInfo(1)[DELTA_TIME];
216 double rho = dt_old/
Dt;
219 rCurrentProcessInfo[BDF_COEFFICIENTS].resize(3);
220 Vector& BDFcoeffs = rCurrentProcessInfo[BDF_COEFFICIENTS];
223 BDFcoeffs[2] =
coeff;
227 rCurrentProcessInfo[BDF_COEFFICIENTS].resize(2);
228 Vector& BDFcoeffs = rCurrentProcessInfo[BDF_COEFFICIENTS];
229 BDFcoeffs[0] = 1.0 /
Dt;
230 BDFcoeffs[1] = -1.0 /
Dt;
234 if(mprediction_order == 2)
237 KRATOS_THROW_ERROR(std::logic_error,
"insufficient buffer size for second order prediction",
"")
239 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
245 i->FastGetSolutionStepValue(rUnknownVar) = 2.00*
i->FastGetSolutionStepValue(rUnknownVar,1) -
i->FastGetSolutionStepValue(rUnknownVar,2);
251 rCurrentProcessInfo[FRACTIONAL_STEP] = 1;
253 Dp_norm = mstep1->Solve();
273 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.
GetValue(CONVECTION_DIFFUSION_SETTINGS);
275 const Variable<double>& rProjectionVariable = my_settings->GetProjectionVariable();
287 rCurrentProcessInfo[FRACTIONAL_STEP] = 2;
311 mstep1->SetEchoLevel(Level);
324 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.
GetValue(CONVECTION_DIFFUSION_SETTINGS);
327 const Variable<double>& rDiffusionVar = my_settings->GetDiffusionVariable();
328 const Variable<double>& rSourceVar = my_settings->GetVolumeSourceVariable();
330 const Variable<double>& rProjectionVariable = my_settings->GetProjectionVariable();
336 KRATOS_THROW_ERROR(std::logic_error,
"Add ----UnknownVar---- variable!!!!!! ERROR",
"");
338 KRATOS_THROW_ERROR(std::logic_error,
"Add ----rDensityVar---- variable!!!!!! ERROR",
"");
340 KRATOS_THROW_ERROR(std::logic_error,
"Add ----rDiffusionVar---- variable!!!!!! ERROR",
"");
342 KRATOS_THROW_ERROR(std::logic_error,
"Add ----rSourceVar---- variable!!!!!! ERROR",
"");
344 KRATOS_THROW_ERROR(std::logic_error,
"Add ----rMeshVelocityVar---- variable!!!!!! ERROR",
"");
346 KRATOS_THROW_ERROR(std::logic_error,
"Add ----rProjectionVariable---- variable!!!!!! ERROR",
"");
437 typename BaseType::Pointer mstep1;
440 int mprediction_order;
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
virtual bool AssembleCurrentData(Variable< int > const &ThisVariable)
Definition: communicator.cpp:502
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
Communicator & GetCommunicator()
Definition: model_part.h:1821
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
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
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
MeshType::ElementIterator ElementIterator
Definition: model_part.h:174
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
This strategy is used to solve convection-diffusion problem.
Definition: residualbased_convdiff_strategy.h:89
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_convdiff_strategy.h:109
void CalculateProjection()
Definition: residualbased_convdiff_strategy.h:266
void SetEchoLevel(int Level) override
This sets the level of echo for the solving strategy.
Definition: residualbased_convdiff_strategy.h:309
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_convdiff_strategy.h:107
virtual ~ResidualBasedConvectionDiffusionStrategy()
Definition: residualbased_convdiff_strategy.h:185
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_convdiff_strategy.h:111
ResidualBasedConvectionDiffusionStrategy(ModelPart &model_part, typename TLinearSolver::Pointer pNewLinearSolver, bool ReformDofAtEachIteration=true, int time_order=2, int prediction_order=2)
Definition: residualbased_convdiff_strategy.h:129
int Check() override
Function to perform expensive checks.
Definition: residualbased_convdiff_strategy.h:319
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_convdiff_strategy.h:97
double Solve() override
Definition: residualbased_convdiff_strategy.h:192
void Clear() override
Clears the internal storage.
Definition: residualbased_convdiff_strategy.h:314
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_convdiff_strategy.h:105
BaseType::TDataType TDataType
Definition: residualbased_convdiff_strategy.h:99
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_convdiff_strategy.h:103
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedConvectionDiffusionStrategy)
Definition: residualbased_elimination_builder_and_solver_componentwise.h:95
This class provides the implementation of a static scheme.
Definition: residualbased_incrementalupdate_static_scheme.h:57
This is a very simple strategy to solve linearly the problem.
Definition: residualbased_linear_strategy.h:64
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solving_strategy.h:79
virtual void InitializeSolutionStep()
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: solving_strategy.h:224
TSparseSpace::DataType TDataType
Definition: solving_strategy.h:69
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
TSparseSpace::MatrixType TSystemMatrixType
Definition: solving_strategy.h:71
TSparseSpace::VectorType TSystemVectorType
Definition: solving_strategy.h:73
TDenseSpace::VectorType LocalSystemVectorType
Definition: solving_strategy.h:81
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int time_order
Definition: ProjectParameters.py:51
list coeff
Definition: bombardelli_test.py:41
def GetSolutionStepValue(entity, variable, solution_step_index)
Definition: coupling_interface_data.py:253
model_part
Definition: face_heat.py:14
Dt
Definition: face_heat.py:78
rho
Definition: generate_droplet_dynamics.py:86
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17
ReformDofAtEachIteration
Definition: test_pureconvectionsolver_benchmarking.py:131