12 #if !defined(KRATOS_RESIDUALBASED_SEMI_EULERIAN_CONVECTION_DIFFUSION_STRATEGY )
13 #define KRATOS_RESIDUALBASED_SEMI_EULERIAN_CONVECTION_DIFFUSION_STRATEGY
69 template<
class TSparseSpace,
117 typename TLinearSolver::Pointer pNewLinearSolver,
128 KRATOS_ERROR <<
"ConvectionDiffusionPart already exists when constructing ResidualBasedSemiEulerianConvectionDiffusionStrategy" << std::endl;
142 typename SchemeType::Pointer pscheme =
typename SchemeType::Pointer
145 bool CalculateReactions =
false;
146 bool CalculateNormDxFlag =
true;
163 *mpConvectionModelPart,
168 CalculateNormDxFlag) );
171 mstep1->SetEchoLevel(2);
201 double Dp_norm = mstep1->Solve();
211 mstep1->SetEchoLevel(Level);
223 if (rCurrentProcessInfo.Has(CONVECTION_DIFFUSION_SETTINGS)==
false)
224 KRATOS_THROW_ERROR(std::logic_error,
"no CONVECTION_DIFFUSION_SETTINGS in model_part",
"");
227 ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
230 if(my_settings->IsDefinedDensityVariable()==
true)
232 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetDensityVariable()) ==
false)
233 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Density Variable defined but not contained in the model part",
"");
236 std::cout <<
"No density variable assigned for ConvDiff. Assuming density=1" << std::endl;
239 if(my_settings->IsDefinedDiffusionVariable()==
true)
241 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetDiffusionVariable()) ==
false)
242 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Diffusion Variable defined but not contained in the model part",
"");
245 std::cout <<
"No diffusion variable assigned for ConvDiff. Assuming diffusivity=0" << std::endl;
248 if(my_settings->IsDefinedUnknownVariable()==
true)
250 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetUnknownVariable()) ==
false)
251 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Unknown Variable defined but not contained in the model part",
"");
254 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Unknown Variable not defined!",
"");
264 if(my_settings->IsDefinedVolumeSourceVariable()==
true)
265 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: VolumeSource not yet implemented",
"");
275 if(my_settings->IsDefinedSurfaceSourceVariable()==
true)
276 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: SurfaceSource not yet implemented",
"");
280 if(my_settings->IsDefinedProjectionVariable()==
true)
282 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetProjectionVariable()) ==
false)
283 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Projection Variable defined but not contained in the model part",
"");
287 std::cout <<
"No Projection variable assigned for ConvDiff. Using PROJECTED_SCALAR1" << std::endl;
288 my_settings->SetProjectionVariable(PROJECTED_SCALAR1);
303 if(my_settings->IsDefinedConvectionVariable()==
true)
304 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: ConvectionVariable not used. Use VelocityVariable instead",
"");
307 if(my_settings->IsDefinedMeshVelocityVariable()==
true)
309 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetMeshVelocityVariable()) ==
false)
310 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: MeshVelocity Variable defined but not contained in the model part",
"");
313 std::cout <<
"No MeshVelocity variable assigned for ConvDiff. Assuming MeshVelocity=0" << std::endl;
316 if(my_settings->IsDefinedVelocityVariable()==
true)
318 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetVelocityVariable()) ==
false)
319 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: Velocity Variable defined but not contained in the model part",
"");
322 std::cout <<
"No Velocity variable assigned for ConvDiff. Assuming Velocity=0" << std::endl;
332 if(my_settings->IsDefinedTransferCoefficientVariable()==
true)
333 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: TransferCoefficient not yet implemented",
"");
336 if(my_settings->IsDefinedSpecificHeatVariable()==
true)
338 if (
BaseType::GetModelPart().NodesBegin()->SolutionStepsDataHas(my_settings->GetSpecificHeatVariable()) ==
false)
339 KRATOS_THROW_ERROR(std::logic_error,
"ConvDiffSettings: SpecificHeat Variable defined but not contained in the model part",
"");
342 std::cout <<
"No SpecificHeat variable assigned for ConvDiff. Assuming SpecificHeat=1" << std::endl;
426 typename BaseType::Pointer mstep1;
457 Element::Pointer pElem;
460 for(ModelPart::ElementsContainerType::iterator it
467 (*it).pGetGeometry(),
468 (*it).pGetProperties() ) );
469 MeshElems.push_back(pElem);
473 for(ModelPart::ElementsContainerType::iterator it
478 pElem = Element::Pointer(
new EulerianDiffusionElement<3,4>(
480 (*it).pGetGeometry(),
481 (*it).pGetProperties() ) );
482 MeshElems.push_back(pElem);
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
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 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 strategy is used to solve convection-diffusion problem.
Definition: residualbased_semi_eulerian_convdiff_strategy.h:75
ResidualBasedSemiEulerianConvectionDiffusionStrategy(ModelPart &model_part, typename TLinearSolver::Pointer pNewLinearSolver, bool ReformDofAtEachIteration=false, int dimension=3)
Definition: residualbased_semi_eulerian_convdiff_strategy.h:115
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:91
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:93
BaseType::TDataType TDataType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:85
double Solve() override
Definition: residualbased_semi_eulerian_convdiff_strategy.h:190
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:97
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:83
virtual ~ResidualBasedSemiEulerianConvectionDiffusionStrategy()
Definition: residualbased_semi_eulerian_convdiff_strategy.h:180
void SetEchoLevel(int Level) override
This sets the level of echo for the solving strategy.
Definition: residualbased_semi_eulerian_convdiff_strategy.h:209
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedSemiEulerianConvectionDiffusionStrategy)
int Check() override
Function to perform expensive checks.
Definition: residualbased_semi_eulerian_convdiff_strategy.h:219
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:89
void Clear() override
Clears the internal storage.
Definition: residualbased_semi_eulerian_convdiff_strategy.h:214
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_semi_eulerian_convdiff_strategy.h:95
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_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#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