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.
boussinesq_basset_history_force_law.h
Go to the documentation of this file.
1 // Author: Guillermo Casas (gcasas@cimne.upc.edu)
2 // Date: February 2019
3 
4 #if !defined(SDEM_BOUSSINESQ_BASSET_HISTORY_FORCE_LAW_H_INCLUDED)
5 #define SDEM_BOUSSINESQ_BASSET_HISTORY_FORCE_LAW_H_INCLUDED
6 
7 #include "history_force_law.h"
8 
9 namespace Kratos {
10 
11  class KRATOS_API(SWIMMING_DEM_APPLICATION) BoussinesqBassetHistoryForceLaw : public HistoryForceLaw {
12 
13  public:
14  typedef Node NodeType;
16 
17  // TODO: make mDoApplyFaxenCorrections an option
19  mDoApplyFaxenCorrections(false),
20  mBassetForceType(4),
21  mQuadratureOrder(2),
22  mOldDaitchePresentCoefficient(0.0),
23  mOldBassetTerm(ZeroVector(3)){}
24 
26 
28 
29  HistoryForceLaw::Pointer Clone() const override;
30 
31  std::string GetTypeOfLaw() override;
32 
33  void ComputeForce(Geometry<Node >& r_geometry,
34  const double reynolds_number,
35  double particle_radius,
36  double fluid_density,
37  double fluid_kinematic_viscosity,
38  array_1d<double, 3>& minus_slip_velocity,
39  array_1d<double, 3>& history_force,
40  const ProcessInfo& r_current_process_info) override;
41 
42  // variables for Daitche's method
43  static std::vector<double> mAjs;
44  static std::vector<double> mBns;
45  static std::vector<double> mCns;
46  static std::vector<double> mDns;
47  static std::vector<double> mEns;
49  // variables for Hinsberg's method
50  static double mTimeWindow;
51  static std::vector<double> mAs;
52  static std::vector<double> mTs;
53  static std::vector<double> mAlphas;
54  static std::vector<double> mBetas;
55 
56  private:
57  bool mDoApplyFaxenCorrections;
58  int mBassetForceType;
59  int mQuadratureOrder;
60  double mOldDaitchePresentCoefficient;
61  array_1d<double, 3> mOldBassetTerm;
62 
63 
64  double GetDaitcheCoefficient(int order, unsigned int n, unsigned int j, const double last_h_over_h, const int n_steps_per_quad_step);
65  void CalculateExplicitFractionalDerivative(NodeType& node, array_1d<double, 3>& fractional_derivative, double& present_coefficient, Vector& historic_integrands, const double last_h_over_h, const int n_steps_per_quad_step);
66  void AddHinsbergTailContribution(NodeType& node, array_1d<double, 3>& fractional_derivative_of_slip_vel, const int order, const int n_steps_per_quad_step, const double time, const double delta_time, const double last_h_over_h, DenseVector<double>& historic_integrands);
67  void AddHinsbergTailContributionStrict(NodeType& node, array_1d<double, 3>& fractional_derivative_of_slip_vel, const int order, const int n_steps_per_quad_step, const double time, const double delta_time, const double last_h_over_h, DenseVector<double>& historic_integrands);
68  double Phi(const double x);
69  double Ki(const double alpha, const double beta, const double time);
70  void AddFdi(const int order, array_1d<double, 3>& F, const double t_win, const double alpha, const double beta, const double last_h_over_h, const double delta_time, const DenseVector<double>& historic_integrands, const array_1d<double, 3>& oldest_integrand);
71  void AddFre(array_1d<double, 3>& old_Fi, const double beta, const double delta_time);
72 
73  friend class Serializer;
74 
75  virtual void save(Serializer& rSerializer) const override {
77  }
78 
79  virtual void load(Serializer& rSerializer) override {
81  }
82 
83  }; //class BoussinesqBassetHistoryForceLaw
84 
85 } // Namespace Kratos
86 
87 #endif /* SDEM_BOUSSINESQ_BASSET_HISTORY_FORCE_LAW_H_INCLUDED defined */
Definition: boussinesq_basset_history_force_law.h:11
static std::vector< double > mEns
Definition: boussinesq_basset_history_force_law.h:47
~BoussinesqBassetHistoryForceLaw()
Definition: boussinesq_basset_history_force_law.h:27
static bool mDaitcheVectorsAreFull
Definition: boussinesq_basset_history_force_law.h:48
static std::vector< double > mAjs
Definition: boussinesq_basset_history_force_law.h:43
static std::vector< double > mAs
Definition: boussinesq_basset_history_force_law.h:51
static double mTimeWindow
Definition: boussinesq_basset_history_force_law.h:50
static std::vector< double > mBetas
Definition: boussinesq_basset_history_force_law.h:54
BoussinesqBassetHistoryForceLaw()
Definition: boussinesq_basset_history_force_law.h:18
static std::vector< double > mBns
Definition: boussinesq_basset_history_force_law.h:44
Node NodeType
Definition: boussinesq_basset_history_force_law.h:14
static std::vector< double > mCns
Definition: boussinesq_basset_history_force_law.h:45
static std::vector< double > mDns
Definition: boussinesq_basset_history_force_law.h:46
static std::vector< double > mTs
Definition: boussinesq_basset_history_force_law.h:52
KRATOS_CLASS_POINTER_DEFINITION(BoussinesqBassetHistoryForceLaw)
static std::vector< double > mAlphas
Definition: boussinesq_basset_history_force_law.h:53
Geometry base class.
Definition: geometry.h:71
Definition: history_force_law.h:16
Definition: amatrix_interface.h:530
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
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
list t_win
Definition: bombardelli_test.py:31
time
Definition: face_heat.py:85
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
delta_time
Definition: generate_frictional_mortar_condition.py:130
F
Definition: hinsberg_optimization.py:144
def load(f)
Definition: ode_solve.py:307
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
def Phi(t)
Definition: quadrature.py:273
int j
Definition: quadrature.py:648
x
Definition: sensitivityMatrix.py:49
Definition: mesh_converter.cpp:38