Description

Physical system for fluid-solid interaction problems.

This class is used to represent fluid-solid interaction problems consisting of fluid dynamics and multibody system. Each of the two underlying physics is an independent object owned and instantiated by this class. The FSI system owns other objects to handle the interface between the two systems, boundary condition enforcing markers, and data.

#include <ChSystemFsi.h>

Classes

struct  ElasticMaterialProperties
 Structure with elastic material properties. More...
 

Public Types

enum  OutpuMode { OutpuMode::CSV, OutpuMode::CHPF, OutpuMode::NONE }
 Output mode. More...
 

Public Member Functions

 ChSystemFsi (ChSystem &other_physicalSystem)
 Constructor for FSI system.
 
 ~ChSystemFsi ()
 Destructor for the FSI system.
 
void DoStepDynamics_FSI ()
 Function to integrate the FSI system in time. More...
 
void DoStepDynamics_ChronoRK2 ()
 Function to integrate the multibody system dynamics based on Runge-Kutta 2nd-order integration scheme.
 
void SetVerbose (bool m_verbose)
 Enable/disable m_verbose terminal output.
 
void ReadParametersFromFile (const std::string &json_file)
 Read Chrono::FSI parameters from the specified JSON file.
 
void SetInitialSpacing (double spacing)
 Set initial spacing.
 
void SetKernelLength (double length)
 Set SPH kernel length.
 
void SetContainerDim (const ChVector<> &boxDim)
 Set the fluid container dimension.
 
void SetBoundaries (const ChVector<> &cMin, const ChVector<> &cMax)
 Set periodic boundary condition for fluid.
 
void SetActiveDomain (const ChVector<> &boxDim)
 Set size of active domain.
 
void SetNumBoundaryLayers (int num_layers)
 Set number of boundary layers (default: 3).
 
void SetDensity (double rho0)
 Set (initial) density.
 
void SetInitPressure (const double fzDim)
 Set prescribed initial pressure for gravity field.
 
void Set_G_acc (const ChVector<> &gravity)
 Set gravity for the FSI syatem.
 
void SetBodyForce (const ChVector<> &force)
 Set a constant force applied to the fluid. More...
 
void SetStepSize (double dT, double dT_Flex=0)
 Set FSI integration step size.
 
void SetMaxStepSize (double dT_max)
 Set the maximum allowable integration step size.
 
void SetAdaptiveTimeStepping (bool adaptive)
 Enable/disable adaptive time stepping.
 
void SetSPHintegration (bool runSPH)
 Enable/disable SPH integration.
 
void SetDiscreType (bool useGmatrix, bool useLmatrix)
 Set SPH discretization type, consistent or inconsistent.
 
void SetWallBC (BceVersion wallBC)
 Set wall boundary condition.
 
void SetRigidBodyBC (BceVersion rigidBodyBC)
 Set rigid body boundary condition.
 
void SetCohesionForce (double Fc)
 Set cohesion force of the granular material.
 
void SetSPHLinearSolver (SolverType lin_solver)
 Set the linear system solver for implicit methods.
 
void SetSPHMethod (FluidDynamics SPH_method, SolverType lin_solver=SolverType::BICGSTAB)
 Set the SPH method and, optionally, the linear solver type.
 
void SetElasticSPH (const ElasticMaterialProperties mat_props)
 Enable solution of elastic SPH (for continuum representation of granular dynamics). More...
 
void SetOutputLength (int OutputLength)
 Set simulation data output length.
 
void SetParticleOutputMode (OutpuMode mode)
 Set the FSI system output mode (default: NONE).
 
double GetKernelLength () const
 Return the SPH kernel length of kernel function.
 
double GetInitialSpacing () const
 Return the initial spacing of the SPH particles.
 
ChVector GetContainerDim () const
 Set the fluid container dimension.
 
double GetDensity () const
 Return density.
 
double GetViscosity () const
 Return viscosity.
 
double GetParticleMass () const
 Return SPH particle mass.
 
double GetBasePressure () const
 Return base pressure.
 
ChVector Get_G_acc () const
 Return gravitational acceleration.
 
double GetSoundSpeed () const
 Return the speed of sound in the fluid phase.
 
ChVector GetBodyForce () const
 Return the constant force applied to the fluid (if any).
 
double GetStepSize () const
 Return the FSI integration step size.
 
double GetMaxStepSize () const
 Return the current value of the maximum allowable integration step size.
 
bool GetAdaptiveTimeStepping () const
 Return a flag inicating whether adaptive time stepping is enabled.
 
size_t GetNumFluidMarkers () const
 Get the current number of fluid SPH particles.
 
size_t GetNumBoundaryMarkers () const
 Get the current number of boundary BCE markers.
 
size_t GetNumRigidBodyMarkers () const
 Get the current number of rigid body BCE markers.
 
size_t GetNumFlexBodyMarkers () const
 Get the current number of flexible body BCE markers.
 
double GetSimTime () const
 Get current simulation time.
 
std::vector< ChVector<> > GetParticlePositions () const
 Return the SPH particle positions.
 
std::vector< ChVector<> > GetParticleVelocities () const
 Return the SPH particle velocities.
 
std::vector< ChVector<> > GetParticleForces () const
 Return the forces acting on SPH particles.
 
std::vector< ChVector<> > GetParticleAccelerations () const
 Return the accelerations of SPH particles.
 
std::vector< ChVector<> > GetParticleFluidProperties () const
 Return the SPH particle fluid properties. More...
 
std::vector< std::shared_ptr< ChBody > > & GetFsiBodies ()
 Get a reference to the FSI bodies. More...
 
std::shared_ptr< fea::ChMeshGetFsiMesh ()
 Return the FSI mesh for flexible elements.
 
std::vector< std::shared_ptr< fea::ChElementCableANCF > > & GetFsiCables ()
 Get a reference to the FSI ChElementCableANCF. More...
 
std::vector< std::shared_ptr< fea::ChElementShellANCF_3423 > > & GetFsiShells ()
 Get a reference to the FSI ChElementShellANCF_3423. More...
 
std::vector< std::shared_ptr< fea::ChNodeFEAxyzD > > & GetFsiNodes ()
 Get a reference to the FSI ChNodeFEAxyzD. More...
 
void AddFsiBody (std::shared_ptr< ChBody > mbody)
 Add FSI body to the FsiSystem.
 
void SetCableElementsNodes (const std::vector< std::vector< int >> &elementsNodes)
 Set number of nodes in FEA cable elements in the FSI system.
 
void SetShellElementsNodes (const std::vector< std::vector< int >> &elementsNodes)
 Set number of nodes in FEA shell elements in the FSI system.
 
void SetFsiMesh (std::shared_ptr< fea::ChMesh > other_fsi_mesh)
 Set the FSI mesh for flexible elements.
 
void Initialize ()
 Complete construction of the FSI system (fluid and BDE objects). More...
 
void WriteParticleFile (const std::string &outfilename) const
 Write FSI system particle output.
 
void PrintParticleToFile (const std::string &dir) const
 Save the SPH particle information into files. More...
 
void PrintFsiInfoToFile (const std::string &dir, double time) const
 Save the FSI information into files. More...
 
void AddSPHParticle (const ChVector<> &point, double rho0, double pres0, double mu0, double h, const ChVector<> &velocity=ChVector<>(0), const ChVector<> &tauXxYyZz=ChVector<>(0), const ChVector<> &tauXyXzYz=ChVector<>(0))
 Add an SPH particle with given properties to the FSI system.
 
void AddSPHParticle (const ChVector<> &point, const ChVector<> &velocity=ChVector<>(0), const ChVector<> &tauXxYyZz=ChVector<>(0), const ChVector<> &tauXyXzYz=ChVector<>(0))
 Add an SPH particle with current properties to the SPH system.
 
void AddBoxSPH (double initSpace, double kernelLength, const ChVector<> &boxCenter, const ChVector<> &boxHalfDim)
 Create SPH particles in the specified box volume. More...
 
void AddBoxBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, const ChVector<> &size, int plane=12, bool isSolid=false)
 Add BCE markers in a box of given dimensions and at given position associated with the specified body.
 
void AddSphereBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double radius)
 Add BCE markers in a sphere of given radius associated with the specified body.
 
void AddSphereSurfaceBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double radius, double kernel_h)
 Add BCE markers on a spherical surface of given radius associated with the specified body.
 
void AddCylinderBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double radius, double height, double kernel_h, bool cartesian=true)
 Add BCE markers in a cylinder of given dimensions and at given position associated with the specified body.
 
void AddCylinderAnnulusBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double rad_in, double rad_out, double height, double kernel_h, bool cartesian=true)
 Add BCE markers in a cylinder annulus of given dimensions and at given position associated with the specified body.
 
void AddCylinderSurfaceBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double radius, double height, double kernel_h)
 Add BCE markers on a cylindrical surface of given dimensions and at given position associated with the specified body.
 
void AddConeBCE (std::shared_ptr< ChBody > body, const ChVector<> &relPos, const ChQuaternion<> &relRot, double radius, double height, double kernel_h, bool cartesian=true)
 Add BCE markers in a cone of given dimensions and at given position associated with the specified body.
 
void AddPointsBCE (std::shared_ptr< ChBody > body, const std::vector< ChVector<>> &points, const ChVector<> &collisionShapeRelativePos, const ChQuaternion<> &collisionShapeRelativeRot)
 Add BCE markers from a set of points and associate them with the given body.
 
void AddFileBCE (std::shared_ptr< ChBody > body, const std::string &dataPath, const ChVector<> &collisionShapeRelativePos, const ChQuaternion<> &collisionShapeRelativeRot, double scale, bool isSolid=true)
 Add BCE markers read from the specified file andd associate them with the given body.
 
void AddFEAmeshBCE (std::shared_ptr< fea::ChMesh > my_mesh, const std::vector< std::vector< int >> &NodeNeighborElement, const std::vector< std::vector< int >> &_1D_elementsNodes, const std::vector< std::vector< int >> &_2D_elementsNodes, bool add1DElem, bool add2DElem, bool multiLayer, bool removeMiddleLayer, int SIDE, int SIZE2D)
 Add BCE markers from mesh.
 
void AddSphereBody (std::shared_ptr< ChMaterialSurface > mat_prop, double density, const ChVector<> &pos, double radius)
 Create and add to the FSI system a rigid body with spherical shape. More...
 
void AddCylinderBody (std::shared_ptr< ChMaterialSurface > mat_prop, double density, const ChVector<> &pos, const ChQuaternion<> &rot, double radius, double length)
 Create and add to the FSI system a rigid body with cylindrical shape. More...
 
void AddBoxBody (std::shared_ptr< ChMaterialSurface > mat_prop, double density, const ChVector<> &pos, const ChQuaternion<> &rot, const ChVector<> &hsize)
 Create and add to the FSI system a rigid body with box shape. More...
 
thrust::device_vector< int > FindParticlesInBox (const ChFrame<> &frame, const ChVector<> &size)
 Utility function for finding indices of SPH particles inside a given OBB. More...
 
thrust::device_vector< Real4 > GetParticlePositions (const thrust::device_vector< int > &indices)
 Extract positions of all SPH particles with indices in the provided array. More...
 
thrust::device_vector< Real3 > GetParticleVelocities (const thrust::device_vector< int > &indices)
 Extract velocities of all SPH particles with indices in the provided array. More...
 
thrust::device_vector< Real4 > GetParticleForces (const thrust::device_vector< int > &indices)
 Extract forces applied to all SPH particles with indices in the provided array. More...
 
thrust::device_vector< Real4 > GetParticleAccelerations (const thrust::device_vector< int > &indices)
 Extract accelerations of all SPH particles with indices in the provided array. More...
 

Static Public Member Functions

static void CreateMeshPoints (geometry::ChTriangleMeshConnected &mesh, double delta, std::vector< ChVector<>> &point_cloud)
 Utility function for creating points filling a closed mesh. More...
 

Friends

class ChVisualizationFsi
 

Member Enumeration Documentation

◆ OutpuMode

Output mode.

Enumerator
CSV 

comma-separated value

CHPF 

binary

NONE 

none

Member Function Documentation

◆ AddBoxBody()

void chrono::fsi::ChSystemFsi::AddBoxBody ( std::shared_ptr< ChMaterialSurface mat_prop,
double  density,
const ChVector<> &  pos,
const ChQuaternion<> &  rot,
const ChVector<> &  hsize 
)

Create and add to the FSI system a rigid body with box shape.

BCE markers are created in the entire box volume using the current spacing value.

◆ AddBoxSPH()

void chrono::fsi::ChSystemFsi::AddBoxSPH ( double  initSpace,
double  kernelLength,
const ChVector<> &  boxCenter,
const ChVector<> &  boxHalfDim 
)

Create SPH particles in the specified box volume.

The SPH particles are created on a uniform grid with given spacing.

◆ AddCylinderBody()

void chrono::fsi::ChSystemFsi::AddCylinderBody ( std::shared_ptr< ChMaterialSurface mat_prop,
double  density,
const ChVector<> &  pos,
const ChQuaternion<> &  rot,
double  radius,
double  length 
)

Create and add to the FSI system a rigid body with cylindrical shape.

BCE markers are created in the entire cylindrical volume using the current spacing value.

◆ AddSphereBody()

void chrono::fsi::ChSystemFsi::AddSphereBody ( std::shared_ptr< ChMaterialSurface mat_prop,
double  density,
const ChVector<> &  pos,
double  radius 
)

Create and add to the FSI system a rigid body with spherical shape.

BCE markers are created in the entire spherical volume using the current spacing value.

◆ CreateMeshPoints()

void chrono::fsi::ChSystemFsi::CreateMeshPoints ( geometry::ChTriangleMeshConnected mesh,
double  delta,
std::vector< ChVector<>> &  point_cloud 
)
static

Utility function for creating points filling a closed mesh.

Calculate uu parameter and test bound

ray intersection

◆ DoStepDynamics_FSI()

void chrono::fsi::ChSystemFsi::DoStepDynamics_FSI ( )

Function to integrate the FSI system in time.

It uses a Runge-Kutta 2nd order algorithm to update both the fluid and multibody system dynamics. The midpoint data of MBS is needed for fluid dynamics update.

◆ FindParticlesInBox()

thrust::device_vector< int > chrono::fsi::ChSystemFsi::FindParticlesInBox ( const ChFrame<> &  frame,
const ChVector<> &  size 
)

Utility function for finding indices of SPH particles inside a given OBB.

The object-oriented box, of specified size, is assumed centered at the origin of the provided frame and aligned with the axes of that frame. The return value is a device thrust vector.

◆ GetFsiBodies()

std::vector<std::shared_ptr<ChBody> >& chrono::fsi::ChSystemFsi::GetFsiBodies ( )
inline

Get a reference to the FSI bodies.

FSI bodies are the ones seen by the fluid dynamics system.

◆ GetFsiCables()

std::vector<std::shared_ptr<fea::ChElementCableANCF> >& chrono::fsi::ChSystemFsi::GetFsiCables ( )
inline

Get a reference to the FSI ChElementCableANCF.

FSI ChElementCableANCF are the ones seen by the fluid dynamics system.

◆ GetFsiNodes()

std::vector<std::shared_ptr<fea::ChNodeFEAxyzD> >& chrono::fsi::ChSystemFsi::GetFsiNodes ( )
inline

Get a reference to the FSI ChNodeFEAxyzD.

FSI ChNodeFEAxyzD are the ones seen by the fluid dynamics system.

◆ GetFsiShells()

std::vector<std::shared_ptr<fea::ChElementShellANCF_3423> >& chrono::fsi::ChSystemFsi::GetFsiShells ( )
inline

Get a reference to the FSI ChElementShellANCF_3423.

FSI ChElementShellANCF_3423 are the ones seen by the fluid dynamics system.

◆ GetParticleAccelerations()

thrust::device_vector< Real4 > chrono::fsi::ChSystemFsi::GetParticleAccelerations ( const thrust::device_vector< int > &  indices)

Extract accelerations of all SPH particles with indices in the provided array.

The return value is a device thrust vector.

◆ GetParticleFluidProperties()

std::vector< ChVector<> > chrono::fsi::ChSystemFsi::GetParticleFluidProperties ( ) const

Return the SPH particle fluid properties.

For each SPH particle, the 3-dimensional array contains density, pressure, and viscosity.

◆ GetParticleForces()

thrust::device_vector< Real4 > chrono::fsi::ChSystemFsi::GetParticleForces ( const thrust::device_vector< int > &  indices)

Extract forces applied to all SPH particles with indices in the provided array.

The return value is a device thrust vector.

◆ GetParticlePositions()

thrust::device_vector< Real4 > chrono::fsi::ChSystemFsi::GetParticlePositions ( const thrust::device_vector< int > &  indices)

Extract positions of all SPH particles with indices in the provided array.

The return value is a device thrust vector.

◆ GetParticleVelocities()

thrust::device_vector< Real3 > chrono::fsi::ChSystemFsi::GetParticleVelocities ( const thrust::device_vector< int > &  indices)

Extract velocities of all SPH particles with indices in the provided array.

The return value is a device thrust vector.

◆ Initialize()

void chrono::fsi::ChSystemFsi::Initialize ( )

Complete construction of the FSI system (fluid and BDE objects).

Use parameters read from JSON file and/or specified through various Set functions.

◆ PrintFsiInfoToFile()

void chrono::fsi::ChSystemFsi::PrintFsiInfoToFile ( const std::string &  dir,
double  time 
) const

Save the FSI information into files.

This function creates CSV files for force and torque on rigid bodies and flexible nodes.

◆ PrintParticleToFile()

void chrono::fsi::ChSystemFsi::PrintParticleToFile ( const std::string &  dir) const

Save the SPH particle information into files.

This function creates three CSV files for SPH particles, boundary BCE markers, and solid BCE markers data.

◆ SetBodyForce()

void chrono::fsi::ChSystemFsi::SetBodyForce ( const ChVector<> &  force)

Set a constant force applied to the fluid.

Solid bodies are not explicitly affected by this force, but they are affected indirectly through the fluid.

◆ SetElasticSPH()

void chrono::fsi::ChSystemFsi::SetElasticSPH ( const ElasticMaterialProperties  mat_props)

Enable solution of elastic SPH (for continuum representation of granular dynamics).

By default, a ChSystemFSI solves an SPH fluid dynamics problem.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_fsi/ChSystemFsi.h
  • /builds/uwsbel/chrono/src/chrono_fsi/ChSystemFsi.cpp