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_line_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:
27 
29 
32 
34  Parameters rParameters
36  {
38 
39  for (unsigned int i=0; i < mpTable.size(); ++i) {
40  unsigned int TableId = rParameters["table"][i].GetInt();
41  if (TableId > 0) {
42  mpTable[i] = model_part.pGetTable(TableId);
43  } else {
44  mpTable[i] = nullptr;
45  }
46  }
47 
48  mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER];
49 
50  KRATOS_CATCH("")
51  }
52 
56 
59  {
61 
63 
64  const double Time = mrModelPart.GetProcessInfo()[TIME] / mTimeUnitConverter;
65  array_1d<double, 2> deltaH;
66  for (unsigned int i=0; i < mpTable.size(); ++i) {
67  if (mpTable[i]) {
68  deltaH[i] = mpTable[i]->GetValue(Time);
69  } else {
70  deltaH[i] = 0.0;
71  }
72  }
73 
77  y += deltaH;
78 
79  mSlope = (y[1] - y[0])
81 
82  block_for_each(mrModelPart.Nodes(), [&var, &y, this](Node& rNode) {
83  const double pressure = PORE_PRESSURE_SIGN_FACTOR * CalculatePressurewithTable(rNode, y);
84  if (mIsSeepage) {
85  if (pressure < PORE_PRESSURE_SIGN_FACTOR * mPressureTensionCutOff) { // Before 0. was used i.s.o. the tension cut off value -> no effect in any test.
86  rNode.FastGetSolutionStepValue(var) = pressure;
87  if (mIsFixed) rNode.Fix(var);
88  } else {
89  if (mIsFixedProvided) rNode.Free(var);
90  }
91  } else {
92  rNode.FastGetSolutionStepValue(var) = std::min(pressure, PORE_PRESSURE_SIGN_FACTOR * mPressureTensionCutOff);
93  }
94  });
95 
96  KRATOS_CATCH("")
97  }
98 
100  std::string Info() const override
101  {
102  return "ApplyPhreaticLinePressureTableProcess";
103  }
104 
105 protected:
106 
107  double CalculatePressurewithTable(const Node &rNode, const array_1d<double, 2> &y) const
108  {
109  double horCoord = rNode.Coordinates()[mHorizontalDirection];
110  horCoord = std::max(horCoord, mMinHorizontalCoordinate);
111  horCoord = std::min(horCoord, mMaxHorizontalCoordinate);
112  const double height = mSlope * (horCoord - mFirstReferenceCoordinate[mHorizontalDirection]) + y[0];
113  const double distance = height - rNode.Coordinates()[mGravityDirection];
114  return - mSpecificWeight * distance;
115  }
116 
117 private:
120  double mTimeUnitConverter;
121 
122 };
123 
124 }
Definition: apply_constant_phreatic_line_pressure_process.hpp:26
double mSlope
Definition: apply_constant_phreatic_line_pressure_process.hpp:152
unsigned int mHorizontalDirection
Definition: apply_constant_phreatic_line_pressure_process.hpp:149
std::string mVariableName
Definition: apply_constant_phreatic_line_pressure_process.hpp:142
unsigned int mGravityDirection
Definition: apply_constant_phreatic_line_pressure_process.hpp:146
Vector3 mFirstReferenceCoordinate
Definition: apply_constant_phreatic_line_pressure_process.hpp:150
Vector3 mSecondReferenceCoordinate
Definition: apply_constant_phreatic_line_pressure_process.hpp:151
ModelPart & mrModelPart
Member Variables.
Definition: apply_constant_phreatic_line_pressure_process.hpp:141
Definition: apply_phreatic_line_pressure_table_process.hpp:24
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: apply_phreatic_line_pressure_table_process.hpp:58
KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticLinePressureTableProcess)
ApplyPhreaticLinePressureTableProcess & operator=(const ApplyPhreaticLinePressureTableProcess &)=delete
ApplyPhreaticLinePressureTableProcess(ModelPart &model_part, Parameters rParameters)
Definition: apply_phreatic_line_pressure_table_process.hpp:33
double CalculatePressurewithTable(const Node &rNode, const array_1d< double, 2 > &y) const
Definition: apply_phreatic_line_pressure_table_process.hpp:107
std::string Info() const override
Turn back information as a string.
Definition: apply_phreatic_line_pressure_table_process.hpp:100
~ApplyPhreaticLinePressureTableProcess() override=default
ApplyPhreaticLinePressureTableProcess(const ApplyPhreaticLinePressureTableProcess &)=delete
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
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
Definition: table.h:435
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
integer i
Definition: TensorModule.f:17