SPHinXsys  alpha version
eulerian_weakly_compressible_fluid_dynamics_complex.h
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------*
2 * SPHinXsys *
3 * --------------------------------------------------------------------------*
4 * SPHinXsys (pronunciation: s'finksis) is an acronym from Smoothed Particle *
5 * Hydrodynamics for industrial compleX systems. It provides C++ APIs for *
6 * physical accurate simulation and aims to model coupled industrial dynamic *
7 * systems including fluid, solid, multi-body dynamics and beyond with SPH *
8 * (smoothed particle hydrodynamics), a meshless computational method using *
9 * particle discretization. *
10 * *
11 * SPHinXsys is partially funded by German Research Foundation *
12 * (Deutsche Forschungsgemeinschaft) DFG HU1527/6-1, HU1527/10-1 *
13 * and HU1527/12-1. *
14 * *
15 * Portions copyright (c) 2017-2020 Technical University of Munich and *
16 * the authors' affiliations. *
17 * *
18 * Licensed under the Apache License, Version 2.0 (the "License"); you may *
19 * not use this file except in compliance with the License. You may obtain a *
20 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
21 * *
22 * --------------------------------------------------------------------------*/
31 #pragma once
32 
35 #include "solid_body.h"
36 #include "solid_particles.h"
37 
38 namespace SPH
39 {
40  namespace eulerian_weakly_compressible_fluid_dynamics
41  {
42  typedef DataDelegateContact<EulerianFluidBody, WeaklyCompressibleFluidParticles, Fluid,
43  SolidBody, SolidParticles, Solid, DataDelegateEmptyBase>
44  WCFluidWallData;
45  typedef DataDelegateContact<EulerianFluidBody, WeaklyCompressibleFluidParticles, Fluid,
46  SPHBody, BaseParticles, BaseMaterial, DataDelegateEmptyBase>
47  WCFluidContactData;
48  typedef DataDelegateContact<EulerianFluidBody, WeaklyCompressibleFluidParticles, Fluid,
49  SolidBody, SolidParticles, Solid>
50  WCFSIContactData;
55  template <class BaseRelaxationType>
57  {
58  public:
59  template <class BaseBodyRelationType>
60  RelaxationWithWall(BaseBodyRelationType &base_body_relation,
61  BaseBodyRelationContact &wall_contact_relation);
62  virtual ~RelaxationWithWall() {};
63 
64  protected:
65  StdVec<Real> wall_inv_rho0_;
66  StdVec<StdLargeVec<Real> *> wall_mass_, wall_Vol_;
67  StdVec<StdLargeVec<Vecd> *> wall_vel_ave_, wall_acc_ave_, wall_n_;
68  };
69 
74  template <class BaseViscousAccelerationType>
75  class ViscousWithWall : public RelaxationWithWall<BaseViscousAccelerationType>
76  {
77  public:
78  // template for different combination of constructing body relations
79  template <class BaseBodyRelationType>
80  ViscousWithWall(BaseBodyRelationType &base_body_relation,
81  BaseBodyRelationContact &wall_contact_relation);
82  virtual ~ViscousWithWall() {};
83 
84  protected:
85  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
86  };
87 
89  template <class BaseViscousAccelerationType>
90  class BaseViscousAccelerationWithWall : public BaseViscousAccelerationType
91  {
92  public:
93  explicit BaseViscousAccelerationWithWall(ComplexBodyRelation &fluid_wall_relation);
95  BaseBodyRelationContact &wall_contact_relation);
97  BaseBodyRelationContact &wall_contact_relation);
98  };
100 
105  template <class BasePressureRelaxationType>
106  class PressureRelaxation : public RelaxationWithWall<BasePressureRelaxationType>
107  {
108  public:
109  // template for different combination of constructing body relations
110  template <class BaseBodyRelationType>
111  PressureRelaxation(BaseBodyRelationType &base_body_relation,
112  BaseBodyRelationContact &wall_contact_relation);
113  virtual ~PressureRelaxation() {};
114 
115  protected:
116  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
117  };
118 
120  template <class BasePressureRelaxationType>
121  class BasePressureRelaxationWithWall : public BasePressureRelaxationType
122  {
123  public:
124  explicit BasePressureRelaxationWithWall(ComplexBodyRelation &fluid_wall_relation);
126  BaseBodyRelationContact &wall_contact_relation);
127  BasePressureRelaxationWithWall(ComplexBodyRelation &fluid_complex_relation,
128  BaseBodyRelationContact &wall_contact_relation);
129  };
137 
143  template <class BaseDensityAndEnergyRelaxationType>
144  class DensityAndEnergyRelaxation : public RelaxationWithWall<BaseDensityAndEnergyRelaxationType>
145  {
146  public:
147  // template for different combination of constructing body relations
148  template <class BaseBodyRelationType>
149  DensityAndEnergyRelaxation(BaseBodyRelationType &base_body_relation,
150  BaseBodyRelationContact &wall_contact_relation);
151  virtual ~DensityAndEnergyRelaxation() {};
152 
153  protected:
154  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
155  };
156 
158  template <class BaseDensityAndEnergyRelaxationType>
159  class BaseDensityAndEnergyRelaxationWithWall : public DensityAndEnergyRelaxation<BaseDensityAndEnergyRelaxationType>
160  {
161  public:
162  explicit BaseDensityAndEnergyRelaxationWithWall(ComplexBodyRelation &fluid_wall_relation);
164  BaseBodyRelationContact &wall_contact_relation);
166  BaseBodyRelationContact &wall_contact_relation);
167  };
171 
177  {
178  public:
180  BaseBodyRelationContact &contact_relation, Real thereshold = 0.75);
181  explicit FreeSurfaceIndicationComplex(ComplexBodyRelation &complex_relation, Real thereshold = 0.75);
182  virtual ~FreeSurfaceIndicationComplex() {};
183 
184  protected:
185  StdVec<Real> contact_inv_rho0_;
186  StdVec<StdLargeVec<Real> *> contact_mass_;
187 
188  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
189  };
190  }
191 }
Here, we define the algorithm classes for weakly compressible fluid dynamics within the body...
The base relation between a SPH body and its contact SPH bodies.
Definition: base_body_relation.h:136
indicate the particles near the free fluid surface.
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:176
indicate the particles near the free surface of a fluid body. Note that, SPHinXsys does not require t...
Definition: eulerian_weakly_compressible_fluid_dynamics_inner.h:73
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:159
template class viscous acceleration with wall boundary
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:75
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:90
prepare data for contact particle dynamics
Definition: base_particle_dynamics.h:240
The relation combined an inner and a contact body relation. The interaction is in a inner-boundary-co...
Definition: complex_body_relation.h:42
template class pressure relaxation scheme with wall boundary
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:106
This is the derived class of base particles.
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:144
The abstract relation within a SPH body.
Definition: base_body_relation.h:117
Abstract base class for general relaxation algorithms with wall.
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:56
This is the class for bodies used for solid BCs or Elastic structure.
Definition: eulerian_weakly_compressible_fluid_dynamics_complex.h:121
Definition: solid_body_supplementary.cpp:9