12 #if !defined(KRATOS_RESIDUALBASED_EULERIAN_CONVECTION_DIFFUSION_STRATEGY )
13 #define KRATOS_RESIDUALBASED_EULERIAN_CONVECTION_DIFFUSION_STRATEGY
86 template<
class TSparseSpace,
134 typename TLinearSolver::Pointer pNewLinearSolver,
156 typename SchemeType::Pointer pscheme =
typename SchemeType::Pointer
159 bool CalculateReactions =
false;
160 bool CalculateNormDxFlag =
true;
177 *mpConvectionModelPart,
182 CalculateNormDxFlag));
184 mstep1->SetEchoLevel(2);
215 double Dp_norm = mstep1->Solve();
225 mstep1->SetEchoLevel(Level);
237 if (rCurrentProcessInfo.Has(CONVECTION_DIFFUSION_SETTINGS)==
false)
238 KRATOS_ERROR <<
"no CONVECTION_DIFFUSION_SETTINGS in model_part" << std::endl;
241 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
244 if(my_settings->IsDefinedDensityVariable()==
true)
246 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetDensityVariable()) ==
false)
247 KRATOS_ERROR <<
"ConvDiffSettings: Density Variable defined but not contained in the model part" << std::endl;
250 std::cout <<
"No density variable assigned for ConvDiff. Assuming density=1" << std::endl;
253 if(my_settings->IsDefinedDiffusionVariable()==
true)
255 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetDiffusionVariable()) ==
false)
256 KRATOS_ERROR <<
"ConvDiffSettings: Diffusion Variable defined but not contained in the model part" << std::endl;
259 std::cout <<
"No diffusion variable assigned for ConvDiff. Assuming diffusivity=0" << std::endl;
262 if(my_settings->IsDefinedUnknownVariable()==
true)
264 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetUnknownVariable()) ==
false)
265 KRATOS_ERROR <<
"ConvDiffSettings: Unknown Variable defined but not contained in the model part" << std::endl;
268 KRATOS_ERROR <<
"ConvDiffSettings: Unknown Variable not defined!" << std::endl;
271 if(my_settings->IsDefinedVolumeSourceVariable()==
true)
273 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetVolumeSourceVariable()) ==
false)
274 KRATOS_ERROR <<
"ConvDiffSettings: VolumeSource Variable defined but not contained in the model part" << std::endl;
277 std::cout <<
"No VolumeSource variable assigned for ConvDiff. Assuming VolumeSource=0" << std::endl;
288 if(my_settings->IsDefinedSurfaceSourceVariable()==
true)
289 KRATOS_ERROR <<
"ConvDiffSettings: SurfaceSource not yet implemented" << std::endl;
299 if(my_settings->IsDefinedProjectionVariable()==
true)
300 KRATOS_ERROR <<
"ConvDiffSettings: ProjectionVariable not useed. Remove it" << std::endl;
311 if(my_settings->IsDefinedConvectionVariable()==
true)
312 KRATOS_ERROR <<
"ConvDiffSettings: ConvectionVariable not used. Use VelocityVariable instead" << std::endl;
315 if(my_settings->IsDefinedMeshVelocityVariable()==
true)
317 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetMeshVelocityVariable()) ==
false)
318 KRATOS_ERROR <<
"ConvDiffSettings: MeshVelocity Variable defined but not contained in the model part" << std::endl;
321 std::cout <<
"No MeshVelocity variable assigned for ConvDiff. Assuming MeshVelocity=0" << std::endl;
324 if(my_settings->IsDefinedVelocityVariable()==
true)
326 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetVelocityVariable()) ==
false)
327 KRATOS_ERROR <<
"ConvDiffSettings: Velocity Variable defined but not contained in the model part" << std::endl;
330 std::cout <<
"No Velocity variable assigned for ConvDiff. Assuming Velocity=0" << std::endl;
340 if(my_settings->IsDefinedTransferCoefficientVariable()==
true)
341 KRATOS_ERROR <<
"ConvDiffSettings: TransferCoefficient not yet implemented" << std::endl;
344 if(my_settings->IsDefinedSpecificHeatVariable()==
true)
346 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetSpecificHeatVariable()) ==
false)
347 KRATOS_ERROR <<
"ConvDiffSettings: SpecificHeat Variable defined but not contained in the model part" << std::endl;
350 std::cout <<
"No SpecificHeat variable assigned for ConvDiff. Assuming SpecificHeat=1" << std::endl;
411 mpConvectionModelPart = &(current_model.
CreateModelPart(
"ConvDiffPart"));
422 Element::Pointer pElem;
429 const unsigned int& NumNodes = rGeom.
size();
435 (*it).pGetGeometry(),
436 (*it).pGetProperties() ) );
437 MeshElems.push_back(pElem);
439 else if(NumNodes == 4)
443 (*it).pGetGeometry(),
444 (*it).pGetProperties() ) );
445 MeshElems.push_back(pElem);
454 const unsigned int& NumNodes = rGeom.
size();
460 (*it).pGetGeometry(),
461 (*it).pGetProperties() ) );
462 MeshElems.push_back(pElem);
464 else if(NumNodes == 8)
468 (*it).pGetGeometry(),
469 (*it).pGetProperties() ) );
470 MeshElems.push_back(pElem);
504 typename BaseType::Pointer mstep1;
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
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 different model parts across multi-physics simulations.
Definition: model.h:60
ModelPart & CreateModelPart(const std::string &ModelPartName, IndexType NewBufferSize=1)
This method creates a new model part contained in the current Model with a given name and buffer size...
Definition: model.cpp:37
void DeleteModelPart(const std::string &ModelPartName)
This method deletes a modelpart with a given name.
Definition: model.cpp:64
bool HasModelPart(const std::string &rFullModelPartName) const
This method checks if a certain a model part exists given a certain name.
Definition: model.cpp:178
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
void SetProcessInfo(ProcessInfo::Pointer pNewProcessInfo)
Definition: model_part.h:1766
ProcessInfo::Pointer pGetProcessInfo()
Definition: model_part.h:1756
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
void SetBufferSize(IndexType NewBufferSize)
This method sets the suffer size of the model part database.
Definition: model_part.cpp:2171
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
Model & GetModel()
Definition: model_part.h:323
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
Current class provides an implementation for standard builder and solving operations.
Definition: residualbased_block_builder_and_solver.h:82
This strategy is used to solve convection-diffusion problem.
Definition: residualbased_eulerian_convdiff_strategy.h:92
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedEulerianConvectionDiffusionStrategy)
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_eulerian_convdiff_strategy.h:108
void SetEchoLevel(int Level) override
This sets the level of echo for the solving strategy.
Definition: residualbased_eulerian_convdiff_strategy.h:223
int Check() override
Function to perform expensive checks.
Definition: residualbased_eulerian_convdiff_strategy.h:233
virtual ~ResidualBasedEulerianConvectionDiffusionStrategy()
Definition: residualbased_eulerian_convdiff_strategy.h:193
ResidualBasedEulerianConvectionDiffusionStrategy(ModelPart &model_part, typename TLinearSolver::Pointer pNewLinearSolver, bool ReformDofAtEachIteration=false, int dimension=3)
Definition: residualbased_eulerian_convdiff_strategy.h:132
virtual void GenerateMeshPart(int dimension)
Definition: residualbased_eulerian_convdiff_strategy.h:404
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_eulerian_convdiff_strategy.h:114
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_eulerian_convdiff_strategy.h:110
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_eulerian_convdiff_strategy.h:106
double Solve() override
Definition: residualbased_eulerian_convdiff_strategy.h:204
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_eulerian_convdiff_strategy.h:100
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_eulerian_convdiff_strategy.h:112
void Clear() override
Clears the internal storage.
Definition: residualbased_eulerian_convdiff_strategy.h:228
BaseType::TDataType TDataType
Definition: residualbased_eulerian_convdiff_strategy.h:102
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
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_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
model_part
Definition: face_heat.py:14
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
ReformDofAtEachIteration
Definition: test_pureconvectionsolver_benchmarking.py:131