Description

Base class for interfacing between a Chrono system and an FSI-aware fluid system.

This class provides the functionality of extracting state information from the Chrono MBS and loading fluid forces acting on the MBS solids. This base class also provides utilities for allocating the exchange data structures, verifying sizes of the exchange data vectors, and a default implementation for calculating FEA node direction vectors. A derived class must implement the actual functions for exchanging data between the two systems.

#include <ChFsiInterface.h>

Inheritance diagram for chrono::fsi::ChFsiInterface:
Collaboration diagram for chrono::fsi::ChFsiInterface:

Public Member Functions

void SetVerbose (bool verbose)
 
FsiBodyAddFsiBody (std::shared_ptr< ChBody > body)
 Add a rigid body.
 
FsiMesh1DAddFsiMesh1D (std::shared_ptr< fea::ChContactSurfaceSegmentSet > surface)
 Add a flexible solid with segment set contact to the FSI system.
 
FsiMesh2DAddFsiMesh2D (std::shared_ptr< fea::ChContactSurfaceMesh > surface)
 Add a flexible solid with surface mesh contact to the FSI system.
 
virtual void Initialize ()
 Initialize the FSI interface.
 
unsigned int GetNumBodies () const
 Get the number of FSI bodies.
 
unsigned int GetNumMeshes1D () const
 Get the number of FSI 1-D meshes.
 
unsigned int GetNumElements1D () const
 Get the number of FSI 1-D mesh elements (segments).
 
unsigned int GetNumNodes1D () const
 Get the number of FSI 1-D mesh nodes.
 
unsigned int GetNumMeshes2D () const
 Get the number of FSI 2-D meshes.
 
unsigned int GetNumElements2D () const
 Get the number of FSI 2-D mesh elements (segments).
 
unsigned int GetNumNodes2D () const
 Get the number of FSI 2-D mesh nodes.
 
const ChVector3dGetFsiBodyForce (size_t i) const
 Return the FSI applied force on the body with specified index. More...
 
const ChVector3dGetFsiBodyTorque (size_t i) const
 Return the FSI applied torque on the body with specified index. More...
 
void EnableNodeDirections (bool val)
 Enable calculation and communication of node directions for FSI meshes. Default: false.
 
bool UseNodeDirections () const
 Indicate whether or not node directions are being used.
 
void AllocateStateVectors (std::vector< FsiBodyState > &body_states, std::vector< FsiMeshState > &mesh1D_states, std::vector< FsiMeshState > &mesh2D_states) const
 Utility function to allocate state vectors. More...
 
void AllocateForceVectors (std::vector< FsiBodyForce > &body_forces, std::vector< FsiMeshForce > &mesh_forces1D, std::vector< FsiMeshForce > &mesh_forces2D) const
 Utility function to allocate force vectors.
 
bool CheckStateVectors (const std::vector< FsiBodyState > &body_states, const std::vector< FsiMeshState > &mesh1D_states, const std::vector< FsiMeshState > &mesh2D_states) const
 Utility function to check sizes of state vectors.
 
bool CheckForceVectors (const std::vector< FsiBodyForce > &body_forces, const std::vector< FsiMeshForce > &mesh_forces1D, const std::vector< FsiMeshForce > &mesh_forces2D) const
 Utility function to check sizes of force vectors.
 
void StoreSolidStates (std::vector< FsiBodyState > &body_states, std::vector< FsiMeshState > &mesh1D_states, std::vector< FsiMeshState > &mesh2D_states)
 Utility function to get current solid phase states from the multibody system in the provided structures. More...
 
void LoadSolidForces (std::vector< FsiBodyForce > &body_forces, std::vector< FsiMeshForce > &mesh1D_forces, std::vector< FsiMeshForce > &mesh2D_forces)
 Utility function to apply forces in the provided structures to the multibody system. More...
 
virtual void ExchangeSolidStates ()=0
 Exchange solid phase state information between the MBS and fluid system. More...
 
virtual void ExchangeSolidForces ()=0
 Exchange solid phase force information between the multibody and fluid systems. More...
 

Protected Member Functions

 ChFsiInterface (ChSystem &sysMBS, ChFsiFluidSystem &sysCFD)
 
void CalculateDirectionsMesh1D (const FsiMesh1D &mesh, FsiMeshState &states)
 Utility function to calculate direction vectors at the flexible 1-D mesh nodes. More...
 
void CalculateDirectionsMesh2D (const FsiMesh2D &mesh, FsiMeshState &states)
 Utility function to calculate direction vectors at the flexible 2-D mesh nodes. More...
 

Protected Attributes

bool m_verbose
 
bool m_initialized
 
bool m_use_node_directions
 
ChSystemm_sysMBS
 
ChFsiFluidSystemm_sysCFD
 
std::vector< FsiBodym_fsi_bodies
 rigid bodies exposed to the FSI system
 
std::vector< FsiMesh1Dm_fsi_meshes1D
 FEA meshes with 1-D segments exposed to the FSI system.
 
std::vector< FsiMesh2Dm_fsi_meshes2D
 FEA meshes with 2-D faces exposed to the FSI system.
 

Member Function Documentation

◆ AllocateStateVectors()

void chrono::fsi::ChFsiInterface::AllocateStateVectors ( std::vector< FsiBodyState > &  body_states,
std::vector< FsiMeshState > &  mesh1D_states,
std::vector< FsiMeshState > &  mesh2D_states 
) const

Utility function to allocate state vectors.

If use of node directions is enabled, also resize the vectors of node directions for FSI meshes.

◆ CalculateDirectionsMesh1D()

void chrono::fsi::ChFsiInterface::CalculateDirectionsMesh1D ( const FsiMesh1D mesh,
FsiMeshState states 
)
protected

Utility function to calculate direction vectors at the flexible 1-D mesh nodes.

For 1-D meshes, these are averages of the segment direction vectors of adjacent segments.

◆ CalculateDirectionsMesh2D()

void chrono::fsi::ChFsiInterface::CalculateDirectionsMesh2D ( const FsiMesh2D mesh,
FsiMeshState states 
)
protected

Utility function to calculate direction vectors at the flexible 2-D mesh nodes.

For 2-D meshes, these are averages of the face normals of adjacent faces.

◆ ExchangeSolidForces()

virtual void chrono::fsi::ChFsiInterface::ExchangeSolidForces ( )
pure virtual

Exchange solid phase force information between the multibody and fluid systems.

  • Extract fluid forces on rigid bodies from fluid system and apply them as external loads to the MBS.
  • Extract fluid forces on mesh nodes from fluid system and apply them as external loads to the MBS.

Implemented in chrono::fsi::sph::ChFsiInterfaceSPH.

◆ ExchangeSolidStates()

virtual void chrono::fsi::ChFsiInterface::ExchangeSolidStates ( )
pure virtual

Exchange solid phase state information between the MBS and fluid system.

  • Extract FSI body states from MBS and apply them to the fluid system.
  • Extract FSI mesh node states from MBS and apply them to the fluid system.

Implemented in chrono::fsi::sph::ChFsiInterfaceSPH.

◆ GetFsiBodyForce()

const ChVector3d & chrono::fsi::ChFsiInterface::GetFsiBodyForce ( size_t  i) const

Return the FSI applied force on the body with specified index.

The force is applied at the body COM and is expressed in the absolute frame.

◆ GetFsiBodyTorque()

const ChVector3d & chrono::fsi::ChFsiInterface::GetFsiBodyTorque ( size_t  i) const

Return the FSI applied torque on the body with specified index.

The torque is expressed in the absolute frame.

◆ LoadSolidForces()

void chrono::fsi::ChFsiInterface::LoadSolidForces ( std::vector< FsiBodyForce > &  body_forces,
std::vector< FsiMeshForce > &  mesh1D_forces,
std::vector< FsiMeshForce > &  mesh2D_forces 
)

Utility function to apply forces in the provided structures to the multibody system.

A derived class may use this function in its implementation of ExchangeSolidForces. A runtime exception is thrown if the output vectors do not have the appropriate sizes.

◆ StoreSolidStates()

void chrono::fsi::ChFsiInterface::StoreSolidStates ( std::vector< FsiBodyState > &  body_states,
std::vector< FsiMeshState > &  mesh1D_states,
std::vector< FsiMeshState > &  mesh2D_states 
)

Utility function to get current solid phase states from the multibody system in the provided structures.

This function is always called once during initialization of the containing ChFsiSystem. During simulation, a derived class may use this function in its implementation of ExchangeSolidStates. A runtime exception is thrown if the output vectors do not have the appropriate sizes.


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