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.
apply_phreatic_surface_pressure_table_process.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Vahid Galavi
11 //
12 
13 #pragma once
14 
15 #include "includes/table.h"
16 
19 
20 namespace Kratos
21 {
22 
24 {
25 
26 public:
28 
31 
33  Parameters rParameters
36 
37  unsigned int TableId = rParameters["table"].GetInt();
38  mpTable = model_part.pGetTable(TableId);
39  mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER];
40 
41  KRATOS_CATCH("")
42  }
43 
47 
51 
53  const double Time = mrModelPart.GetProcessInfo()[TIME] / mTimeUnitConverter;
54  const double deltaH = mpTable->GetValue(Time);
55 
56  Vector3 direction = ZeroVector(3);
57  direction[mGravityDirection] = 1.0;
58 
59  block_for_each(mrModelPart.Nodes(), [&var, &direction, &deltaH, this](Node &rNode) {
60  double distance = inner_prod(mNormalVector, rNode.Coordinates());
61  const double d = inner_prod(mNormalVector, direction);
62  distance = -(distance - mEqRHS) / d;
63  distance += deltaH;
64  const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance;
65  if (mIsSeepage) {
66  if (pressure < PORE_PRESSURE_SIGN_FACTOR* mPressureTensionCutOff) { // Before 0. was used i.s.o. the tension cut off value -> no effect in any test.
67  rNode.FastGetSolutionStepValue(var) = pressure;
68  if (mIsFixed) rNode.Fix(var);
69  } else {
70  if (mIsFixedProvided) rNode.Free(var);
71  }
72  } else {
73  rNode.FastGetSolutionStepValue(var) = std::min(pressure, PORE_PRESSURE_SIGN_FACTOR * mPressureTensionCutOff);
74  }
75  });
76 
77  KRATOS_CATCH("")
78  }
79 
81  std::string Info() const override
82  {
83  return "ApplyPhreaticSurfacePressureTableProcess";
84  }
85 
86 private:
87  TableType::Pointer mpTable;
88  double mTimeUnitConverter;
89 
90 };
91 
92 }
Definition: apply_constant_phreatic_surface_pressure_process.hpp:26
std::string mVariableName
Definition: apply_constant_phreatic_surface_pressure_process.hpp:129
unsigned int mGravityDirection
Definition: apply_constant_phreatic_surface_pressure_process.hpp:133
ModelPart & mrModelPart
Member Variables.
Definition: apply_constant_phreatic_surface_pressure_process.hpp:128
Definition: apply_phreatic_surface_pressure_table_process.hpp:24
ApplyPhreaticSurfacePressureTableProcess(const ApplyPhreaticSurfacePressureTableProcess &)=delete
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: apply_phreatic_surface_pressure_table_process.hpp:49
std::string Info() const override
Turn back information as a string.
Definition: apply_phreatic_surface_pressure_table_process.hpp:81
ApplyPhreaticSurfacePressureTableProcess(ModelPart &model_part, Parameters rParameters)
Definition: apply_phreatic_surface_pressure_table_process.hpp:32
ApplyPhreaticSurfacePressureTableProcess & operator=(const ApplyPhreaticSurfacePressureTableProcess &)=delete
KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticSurfacePressureTableProcess)
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
Definition: table.h:435
#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
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
model_part
Definition: face_heat.py:14