Description
Base class for a 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. A derived class must always set the FSI interface for coupling the two physics systems.
#include <ChFsiSystem.h>


Classes | |
| class | MBDCallback |
| Class to specify step dynamics for the associated multibody system. More... | |
Public Types | |
| enum | CouplingScheme { CONCURRENT, SEQUENTIAL } |
| Co-simulation coupling scheme used by DoStepDynamics. More... | |
Public Member Functions | |
| virtual | ~ChFsiSystem () |
| Destructor for the FSI system. | |
| void | AttachFluidSystem (ChFsiFluidSystem *sys) |
| Attach a fluid system. | |
| void | AttachMultibodySystem (ChSystem *sys) |
| Attach a MBS system. | |
| ChFsiFluidSystem & | GetFluidSystem () const |
| Access the associated fluid system. | |
| ChSystem & | GetMultibodySystem () const |
| Access the associated multibody system. | |
| ChFsiInterface & | GetFsiInterface () const |
| Access the associated FSI interface. | |
| void | SetVerbose (bool verbose) |
| Enable/disable verbose terminal output (default: true). More... | |
| void | SetGravitationalAcceleration (const ChVector3d &gravity) |
| Set gravitational acceleration for the FSI system. More... | |
| void | SetStepSizeCFD (double step) |
| Set integration step size for fluid dynamics. | |
| void | SetStepsizeMBD (double step) |
| Set integration step size for multibody dynamics. More... | |
| CouplingScheme | GetCouplingScheme () const |
| Get the co-simulation coupling scheme in effect. | |
| std::shared_ptr< FsiBody > | AddRigidBody (std::shared_ptr< ChBody > body, std::shared_ptr< ChBodyGeometry > geometry, bool check_embedded) |
| Add a rigid body to the FSI system. | |
| virtual void | Initialize () |
| Initialize the FSI system. More... | |
| void | RegisterMBDCallback (std::shared_ptr< MBDCallback > callback) |
| Set a custom function for advancing the dynamics of the associated multibody system. More... | |
| void | DoStepDynamics (double step) |
| Function to advance the FSI system combined state. More... | |
| double | GetSimTime () const |
| Get current simulation time. | |
| double | GetStepSizeMBD () const |
| Get the integration step size for multibody dynamics. | |
| double | GetStepSizeCFD () const |
| Get the integration step size for fluid dynamics. | |
| double | GetRtf () const |
| Get current estimated RTF (real time factor) for the coupled problem. | |
| void | SetRtf (double rtf) |
| Set RTF value for the coupled problem. More... | |
| double | GetRtfCFD () const |
| Get current estimated RTF (real time factor) for the fluid system. | |
| double | GetRtfMBD () const |
| Get current estimated RTF (real time factor) for the multibody system. | |
| double | GetRatioMBD () const |
| Get ratio of simulation time spent in MBS integration. | |
| double | GetTimerStep () const |
| Return the time in seconds for for simulating the last step. | |
| double | GetTimerCFD () const |
| Return the time in seconds for fluid dynamics over the last step. | |
| double | GetTimerMBD () const |
| Return the time in seconds for multibody dynamics over the last step. | |
| double | GetTimerFSI () const |
| Return the time in seconds for data exchange between phases over the last step. | |
| const std::vector< std::shared_ptr< FsiBody > > & | GetBodies () const |
| Get a list of the FSI rigid bodies. | |
| const ChVector3d & | GetFsiBodyForce (size_t i) const |
| Return the FSI applied force on the body with specified index (as returned by AddRigidBody). More... | |
| const ChVector3d & | GetFsiBodyTorque (size_t i) const |
| Return the FSI applied torque on the body with specified index (as returned by AddRigidBody). More... | |
Protected Member Functions | |
| ChFsiSystem (ChSystem *sysMBS, ChFsiFluidSystem *sysCFD) | |
| Construct an FSI system coupling the provided multibody and fluid systems. More... | |
| void | SetCouplingScheme (CouplingScheme scheme) |
| Select the co-simulation coupling scheme. More... | |
Protected Attributes | |
| ChSystem * | m_sysMBS |
| multibody system | |
| ChFsiFluidSystem * | m_sysCFD |
| FSI fluid solver. | |
| std::shared_ptr< ChFsiInterface > | m_fsi_interface |
| FSI interface system. | |
| bool | m_verbose |
| enable/disable m_verbose terminal output | |
| bool | m_is_initialized |
| set to true once the Initialize function is called | |
Member Enumeration Documentation
◆ CouplingScheme
|
strong |
Co-simulation coupling scheme used by DoStepDynamics.
- CONCURRENT: Advance both phases concurrently, then exchange. The fluid force applied over a step is evaluated from the solid state one step earlier. Appropriate when the fluid advance is expensive and the coupling is weak (e.g. SPH), where overlapping the two phases pays for the extra step of lag.
- SEQUENTIAL: Exchange states, advance the fluid, exchange forces, then advance the MBS. The fluid force applied over a step is evaluated from the solid state at the beginning of that step. Required when the fluid force is stiff in the solid state (e.g. potential-flow hydrostatic restoring), where a lagged force acts as negative damping.
Constructor & Destructor Documentation
◆ ChFsiSystem()
|
protected |
Construct an FSI system coupling the provided multibody and fluid systems.
Derived classes must also construct and set the FSI interface (m_fsi_interface).
Member Function Documentation
◆ DoStepDynamics()
| void chrono::fsi::ChFsiSystem::DoStepDynamics | ( | double | step | ) |
Function to advance the FSI system combined state.
This implements an explicit force-displacement co-simulation step, in one of two orderings selected by the active CouplingScheme (see GetCouplingScheme).
With CouplingScheme::CONCURRENT:
- advance fluid dynamics (CFD) to new data exchange point;
- advance multibody dynamics (MBD) to new data exchange point;
- extract (from fluid system) and apply (to MBS) fluid forces on FSI solid objects;
- extract (from MBS) and apply (to fluid system) new states for FSI solid objects; No data exchange is performed before the first step; this assumes that FSI solid states and FSI solid forces are properly initialized. The fluid forces applied to the MBS over a step were evaluated from the solid state one step earlier.
With CouplingScheme::SEQUENTIAL:
- extract (from MBS) and apply (to fluid system) new states for FSI solid objects;
- advance fluid dynamics (CFD) to new data exchange point;
- extract (from fluid system) and apply (to MBS) fluid forces on FSI solid objects;
- advance multibody dynamics (MBD) to new data exchange point. The fluid forces applied to the MBS over a step are evaluated from the solid state at the beginning of that step, and the two phases are advanced serially.
Notes:
- CFD advance calls ChFsiFluidSystem::DoStepDynamics multiple times (see SetStepSizeCFD);
- with CouplingScheme::CONCURRENT, MBD advance is executed in a separate, concurrent thread and does not block execution;
- the caller can register a custom callback (of type ChFsiSystem::MBDCallback) to control MBD advance;
- if MBDCallback not provided, MBD advance calls ChSystem::DoStepDynamics multiple times (see SetStepsizeMBD);
- with CouplingScheme::SEQUENTIAL, the reported step timer (GetTimerStep) includes the data exchange time.
◆ GetFsiBodyForce()
| const ChVector3d & chrono::fsi::ChFsiSystem::GetFsiBodyForce | ( | size_t | i | ) | const |
Return the FSI applied force on the body with specified index (as returned by AddRigidBody).
The force is applied at the body COM and is expressed in the absolute frame.
◆ GetFsiBodyTorque()
| const ChVector3d & chrono::fsi::ChFsiSystem::GetFsiBodyTorque | ( | size_t | i | ) | const |
Return the FSI applied torque on the body with specified index (as returned by AddRigidBody).
The torque is expressed in the absolute frame.
◆ Initialize()
|
virtual |
Initialize the FSI system.
A call to this function marks the completion of system construction. The default implementation performs the following operations:
- check that an associated FSI interface was created and a value for integration step size was provided;
- initialize the FSI interface;
- get initial solid states from the FSI interface;
- initialize the associated fluid solver, passing the initial solid states;
Reimplemented in chrono::fsi::sph::ChFsiSystemSPH, and chrono::fsi::tdpf::ChFsiSystemTDPF.
◆ RegisterMBDCallback()
|
inline |
Set a custom function for advancing the dynamics of the associated multibody system.
If not provided, the MBS system is integrated with the specified step size (see SetStepsizeMBD) by calling ChSystem::DoStepDynamics.
◆ SetCouplingScheme()
|
inlineprotected |
Select the co-simulation coupling scheme.
This is deliberately not part of the public API: a concrete ChFsiSystem is responsible for selecting the scheme that is valid for its fluid solver, and may choose to expose this setting to its own users. Must be set before the first call to DoStepDynamics.
◆ SetGravitationalAcceleration()
| void chrono::fsi::ChFsiSystem::SetGravitationalAcceleration | ( | const ChVector3d & | gravity | ) |
Set gravitational acceleration for the FSI system.
This function sets gravity for both the fluid and multibody systems.
◆ SetRtf()
|
inline |
Set RTF value for the coupled problem.
This is necessary for correct reporting if automatic integration of the multibody system dynamics is disabled and performed externally.
◆ SetStepsizeMBD()
| void chrono::fsi::ChFsiSystem::SetStepsizeMBD | ( | double | step | ) |
Set integration step size for multibody dynamics.
If a value is not provided, the MBS system is integrated with the same step used for fluid dynamics.
◆ SetVerbose()
| void chrono::fsi::ChFsiSystem::SetVerbose | ( | bool | verbose | ) |
Enable/disable verbose terminal output (default: true).
The default implementation sets the verbose mode for the FSI system and the underlying FSI interface.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_fsi/ChFsiSystem.h
- /builds/uwsbel/chrono/src/chrono_fsi/ChFsiSystem.cpp