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 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 SetDiscreType (bool useGmatrix, bool useLmatrix)
 Set SPH discretization type, consistent or inconsistent.
 
void SetWallBC (BceVersion wallBC)
 Set wall boundary condition.
 
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 SetOutputDirectory (const std::string &output_dir)
 Set output directory for FSI data. 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<> > GetParticlePosOrProperties ()
 Return the SPH particle position.
 
std::vector< ChVector<> > GetParticleVel ()
 Return the SPH particle velocity.
 
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 (std::vector< std::vector< int >> elementsNodes)
 Set number of nodes in FEA cable elements in the FSI system.
 
void SetShellElementsNodes (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 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 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 AddANCFshellBCE (std::vector< std::shared_ptr< fea::ChElementShellANCF_3423 >> &m_fsi_shells, std::shared_ptr< fea::ChMesh > mesh, bool multiLayer=true, bool removeMiddleLayer=false, int SIDE=-2)
 Add BCE markers genetrated from ANCF shell elements.
 
void AddANCFshellBCE (std::vector< std::shared_ptr< fea::ChElementShellANCF_3423 >> &m_fsi_shells, std::vector< std::shared_ptr< fea::ChNodeFEAxyzD >> &m_fsi_nodes, std::shared_ptr< fea::ChMesh > mesh, const std::vector< std::vector< int >> &elementsNodes, const std::vector< std::vector< int >> &NodeNeighborElement, bool multiLayer=true, bool removeMiddleLayer=false, int SIDE=-2)
 Add BCE markers genetrated from shell elements.
 
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...
 

Static Public Member Functions

static void CreateMeshPoints (std::shared_ptr< 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 ( std::shared_ptr< 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.

◆ 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.

◆ 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.

◆ 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.

◆ SetOutputDirectory()

void chrono::fsi::ChSystemFsi::SetOutputDirectory ( const std::string &  output_dir)

Set output directory for FSI data.

No output is generated by default (for better performance). If an output directory is specified, output files with information on each FSI body and node are generated in a subdirectory 'fsi/' of the given output directory. It is the caller's responsibility to ensure that output_dir exists.


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