IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
|
Class IBHydrodynamicForceEvaluator computes hydrodynamic force and torque on immersed bodies. The class uses Reynolds transport theorem to integrate momentum over a Cartesian box region that moves with an arbitrary rigid body translation velocity. More...
#include </home/runner/work/IBAMR/IBAMR/include/ibamr/IBHydrodynamicForceEvaluator.h>
Classes | |
struct | IBHydrodynamicForceObject |
Public Member Functions | |
IBHydrodynamicForceEvaluator (std::string object_name, double rho, double mu, double current_time, bool register_for_restart=true) | |
Default constructor. More... | |
virtual | ~IBHydrodynamicForceEvaluator () |
Virtual destructor. | |
void | registerStructure (IBTK::Vector3d &box_X_lower, IBTK::Vector3d &box_X_upper, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, const IBTK::Vector3d &box_vel=IBTK::Vector3d::Zero(), int strct_id=0) |
Register structure ID, level number, and integration domain with the class. More... | |
void | updateStructureDomain (const IBTK::Vector3d &box_vel_new, double dt, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, int strct_id=0) |
Update the domain of integration as a result of structure motion. This should be called before computeLaggedMomentumIntegral to insure that the correct box is being used. More... | |
void | setTorqueOrigin (const IBTK::Vector3d &X0, int strct_id=0) |
Set the origin of the position vector used to compute torques. More... | |
virtual void | preprocessIntegrateData (double current_time, double new_time) |
Preprocess data for the current timestep. | |
const IBHydrodynamicForceObject & | getHydrodynamicForceObject (int strct_id) |
Get access to hydrodynamic data of the given structure id. | |
void | computeLaggedMomentumIntegral (int u_old_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &u_src_bc_coef=std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * >()) |
Compute the momentum integral for the velocity variable at the previous time step over the new control volume. This should be called before advancing the hierarchy but after updateStructureDomain. More... | |
void | updateStructureMomentum (const IBTK::Vector3d &P_strct_new, const IBTK::Vector3d &L_strct_new, int strct_id=0) |
Update the new momenta of the bodies within the structure. This should be called after advancing the hierarchy. More... | |
virtual void | computeHydrodynamicForce (int u_idx, int p_idx, int f_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, double dt, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &u_src_bc_coef=std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * >(), SAMRAI::solv::RobinBcCoefStrategy< NDIM > *p_src_bc_coef=NULL) |
Compute hydrodynamic force. This should be called after advancing the hierarchy. More... | |
virtual void | postprocessIntegrateData (double current_time, double new_time) |
Postprocess data for the next timestep. | |
void | putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override |
Override the putToDatabase method of the base Serializable class. | |
void | registerStructurePlotData (SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > > visit_data_writer, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, int strct_id=0) |
Create the control volume plot data and register it with the VisIt data writer. More... | |
void | updateStructurePlotData (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, int strct_id=0) |
Update the plot variable for the new location of the control volume box. More... | |
Class IBHydrodynamicForceEvaluator computes hydrodynamic force and torque on immersed bodies. The class uses Reynolds transport theorem to integrate momentum over a Cartesian box region that moves with an arbitrary rigid body translation velocity.
References Flavio Noca, On the evaluation of time-dependent fluid-dynamic forces on bluff bodies.
IBAMR::IBHydrodynamicForceEvaluator::IBHydrodynamicForceEvaluator | ( | std::string | object_name, |
double | rho, | ||
double | mu, | ||
double | current_time, | ||
bool | register_for_restart = true |
||
) |
Default constructor.
rho | Fluid/structure density. |
mu | Fluid Viscosity. |
current_time | Current integration time. |
|
virtual |
Compute hydrodynamic force. This should be called after advancing the hierarchy.
u_idx | Patch index of velocity variable (after advancing the hierarchy) with appropriate ghost cell width. |
p_idx | Patch index of pressure variable with appropriate ghost cell width. |
f_idx | Patch index of body force variable with appropriate ghost cell width. |
dt | Time step from the integrator. Pass IBHierarchyIntegrator::getMaximumTimeStepSize() instead of new_time - old_time to avoid floating point errors from subtraction |
u_src_bc_coef | Velocity boundary condition object maintained by the integrator. |
p_src_bc_coef | Pressure boundary condition object maintained by the integrator. |
void IBAMR::IBHydrodynamicForceEvaluator::computeLaggedMomentumIntegral | ( | int | u_old_idx, |
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | patch_hierarchy, | ||
const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > & | u_src_bc_coef = std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*>() |
||
) |
Compute the momentum integral for the velocity variable at the previous time step over the new control volume. This should be called before advancing the hierarchy but after updateStructureDomain.
u_old_idx | Patch index of velocity variable (before advancing the hierarchy) with appropriate ghost cell width. |
wgt_sc_idx | Patch index of volume weights associated with faces. |
u_src_bc_coef | Velocity boundary condition object maintained by the integrator. |
p_src_bc_coef | Pressure boundary condition object maintained by the integrator. |
void IBAMR::IBHydrodynamicForceEvaluator::registerStructure | ( | IBTK::Vector3d & | box_X_lower, |
IBTK::Vector3d & | box_X_upper, | ||
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | patch_hierarchy, | ||
const IBTK::Vector3d & | box_vel = IBTK::Vector3d::Zero() , |
||
int | strct_id = 0 |
||
) |
Register structure ID, level number, and integration domain with the class.
box_X_lower | Initial (typically at time = 0) position of lower left corner of the integration domain. |
box_X_upper | Initial (typically at time = 0) position of upper right corner of the integration domain. |
box_vel | Initial (typically at time = 0) velocity of the integration domain in three Cartesian directions. |
strct_id | A unique integer id to associate with an integration domain. |
void IBAMR::IBHydrodynamicForceEvaluator::registerStructurePlotData | ( | SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > > | visit_data_writer, |
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | patch_hierarchy, | ||
int | strct_id = 0 |
||
) |
Create the control volume plot data and register it with the VisIt data writer.
strct_id | A unique integer id to associate with an integration domain. |
void IBAMR::IBHydrodynamicForceEvaluator::setTorqueOrigin | ( | const IBTK::Vector3d & | X0, |
int | strct_id = 0 |
||
) |
Set the origin of the position vector used to compute torques.
X0 | A 3D vector corresponding to the origin of the position vector used to compute torques |
strct_id | A unique integer id to associate with an integration domain. |
void IBAMR::IBHydrodynamicForceEvaluator::updateStructureDomain | ( | const IBTK::Vector3d & | box_vel_new, |
double | dt, | ||
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | patch_hierarchy, | ||
int | strct_id = 0 |
||
) |
Update the domain of integration as a result of structure motion. This should be called before computeLaggedMomentumIntegral to insure that the correct box is being used.
box_vel_new | Velocity of the integration domain in three Cartesian directions during the time step. |
dt | Time step from the integrator. Pass IBHierarchyIntegrator::getMaximumTimeStepSize() instead of new_time - old_time to avoid floating point errors from subtraction |
strct_id | A unique integer id to associate with an integration domain. |
void IBAMR::IBHydrodynamicForceEvaluator::updateStructureMomentum | ( | const IBTK::Vector3d & | P_strct_new, |
const IBTK::Vector3d & | L_strct_new, | ||
int | strct_id = 0 |
||
) |
Update the new momenta of the bodies within the structure. This should be called after advancing the hierarchy.
P_strct_new | Linear momentum of the structure after the integration. |
L_strct_new | Angular momentum of the structure after the integration. |
strct_id | A unique integer id to associate with an integration domain. |
void IBAMR::IBHydrodynamicForceEvaluator::updateStructurePlotData | ( | SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | patch_hierarchy, |
int | strct_id = 0 |
||
) |
Update the plot variable for the new location of the control volume box.
strct_id | A unique integer id to associate with an integration domain |