IBAMR  IBAMR version 0.19.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
IBAMR::IBHydrodynamicForceEvaluator Class Reference

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 <ibamr/IBHydrodynamicForceEvaluator.h>

Inheritance diagram for IBAMR::IBHydrodynamicForceEvaluator:
Inheritance graph
[legend]

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. More...
 
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. More...
 
const IBHydrodynamicForceObjectgetHydrodynamicForceObject (int strct_id)
 Get access to hydrodynamic data of the given structure id. More...
 
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=nullptr)
 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. More...
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 Override the putToDatabase method of the base Serializable class. More...
 
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...
 

Private Member Functions

 IBHydrodynamicForceEvaluator (const IBHydrodynamicForceEvaluator &from)=delete
 Copy constructor. More...
 
IBHydrodynamicForceEvaluatoroperator= (const IBHydrodynamicForceEvaluator &that)=delete
 Assignment operator. More...
 
void resetFaceAreaWeight (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy)
 Reset weight of the cell face to face area. More...
 
void resetFaceVolWeight (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy)
 Reset weight of the cell face to cell volume. More...
 
void fillPatchData (const int u_src_idx, const int p_src_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &u_src_bc_coef, SAMRAI::solv::RobinBcCoefStrategy< NDIM > *p_src_bc_coef, const double fill_time)
 Allocate and fill velocity and pressure patch data. More...
 
void getPhysicalCoordinateFromSideIndex (IBTK::Vector3d &side_coord, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, const SAMRAI::pdat::SideIndex< NDIM > side_idx, const int axis)
 Compute the physical coordinate of a given side index. More...
 

Private Attributes

std::string d_object_name
 Object name. More...
 
double d_rho
 Fluid density and viscosity. More...
 
double d_mu
 
double d_current_time
 Current integrator time. More...
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::SideVariable< NDIM, double > > d_u_var
 Fluid velocity and pressure with appropriate ghost width. More...
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_p_var
 
int d_u_idx
 
int d_p_idx
 
int d_face_wgt_sc_idx
 Patch data index for face weights. More...
 
int d_vol_wgt_sc_idx
 
std::map< int, IBHydrodynamicForceObjectd_hydro_objs
 Data structure encapsulating hydrodynamic force on an object. More...
 

Detailed Description

References Flavio Noca, On the evaluation of time-dependent fluid-dynamic forces on bluff bodies.

Nangia et al., A moving control volume approach to computing hydrodynamic forces and torques on immersed bodies. \note The Cartesian box should enclose the body entirely. \note Various IB methods need to provide linear and angular momentum of the enclosed body to the class.

Constructor & Destructor Documentation

◆ IBHydrodynamicForceEvaluator() [1/2]

IBAMR::IBHydrodynamicForceEvaluator::IBHydrodynamicForceEvaluator ( std::string  object_name,
double  rho,
double  mu,
double  current_time,
bool  register_for_restart = true 
)
Parameters
rhoFluid/structure density.
muFluid Viscosity.
current_timeCurrent integration time.

◆ ~IBHydrodynamicForceEvaluator()

virtual IBAMR::IBHydrodynamicForceEvaluator::~IBHydrodynamicForceEvaluator ( )
virtual

◆ IBHydrodynamicForceEvaluator() [2/2]

IBAMR::IBHydrodynamicForceEvaluator::IBHydrodynamicForceEvaluator ( const IBHydrodynamicForceEvaluator from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ registerStructure()

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 
)
Parameters
box_X_lowerInitial (typically at time = 0) position of lower left corner of the integration domain.
box_X_upperInitial (typically at time = 0) position of upper right corner of the integration domain.
box_velInitial (typically at time = 0) velocity of the integration domain in three Cartesian directions.
strct_idA unique integer id to associate with an integration domain.

◆ updateStructureDomain()

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 
)
Parameters
box_vel_newVelocity of the integration domain in three Cartesian directions during the time step.
dtTime step from the integrator. Pass IBHierarchyIntegrator::getMaximumTimeStepSize() instead of new_time - old_time to avoid floating point errors from subtraction
strct_idA unique integer id to associate with an integration domain.

◆ setTorqueOrigin()

void IBAMR::IBHydrodynamicForceEvaluator::setTorqueOrigin ( const IBTK::Vector3d X0,
int  strct_id = 0 
)
Parameters
X0A 3D vector corresponding to the origin of the position vector used to compute torques
strct_idA unique integer id to associate with an integration domain.

◆ preprocessIntegrateData()

virtual void IBAMR::IBHydrodynamicForceEvaluator::preprocessIntegrateData ( double  current_time,
double  new_time 
)
virtual

◆ getHydrodynamicForceObject()

const IBHydrodynamicForceObject& IBAMR::IBHydrodynamicForceEvaluator::getHydrodynamicForceObject ( int  strct_id)

◆ computeLaggedMomentumIntegral()

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 > * >() 
)
Parameters
u_old_idxPatch index of velocity variable (before advancing the hierarchy) with appropriate ghost cell width.
wgt_sc_idxPatch index of volume weights associated with faces.
u_src_bc_coefVelocity boundary condition object maintained by the integrator.
p_src_bc_coefPressure boundary condition object maintained by the integrator.

◆ updateStructureMomentum()

void IBAMR::IBHydrodynamicForceEvaluator::updateStructureMomentum ( const IBTK::Vector3d P_strct_new,
const IBTK::Vector3d L_strct_new,
int  strct_id = 0 
)
Parameters
P_strct_newLinear momentum of the structure after the integration.
L_strct_newAngular momentum of the structure after the integration.
strct_idA unique integer id to associate with an integration domain.

◆ computeHydrodynamicForce()

virtual void IBAMR::IBHydrodynamicForceEvaluator::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 = nullptr 
)
virtual
Parameters
u_idxPatch index of velocity variable (after advancing the hierarchy) with appropriate ghost cell width.
p_idxPatch index of pressure variable with appropriate ghost cell width.
f_idxPatch index of body force variable with appropriate ghost cell width.
dtTime step from the integrator. Pass IBHierarchyIntegrator::getMaximumTimeStepSize() instead of new_time - old_time to avoid floating point errors from subtraction
u_src_bc_coefVelocity boundary condition object maintained by the integrator.
p_src_bc_coefPressure boundary condition object maintained by the integrator.

◆ postprocessIntegrateData()

virtual void IBAMR::IBHydrodynamicForceEvaluator::postprocessIntegrateData ( double  current_time,
double  new_time 
)
virtual

◆ putToDatabase()

void IBAMR::IBHydrodynamicForceEvaluator::putToDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database db)
overridevirtual

◆ registerStructurePlotData()

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 
)
Parameters
strct_idA unique integer id to associate with an integration domain.

◆ updateStructurePlotData()

void IBAMR::IBHydrodynamicForceEvaluator::updateStructurePlotData ( SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy,
int  strct_id = 0 
)
Parameters
strct_idA unique integer id to associate with an integration domain

◆ operator=()

IBHydrodynamicForceEvaluator& IBAMR::IBHydrodynamicForceEvaluator::operator= ( const IBHydrodynamicForceEvaluator that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ resetFaceAreaWeight()

void IBAMR::IBHydrodynamicForceEvaluator::resetFaceAreaWeight ( SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy)
private

◆ resetFaceVolWeight()

void IBAMR::IBHydrodynamicForceEvaluator::resetFaceVolWeight ( SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy)
private

◆ fillPatchData()

void IBAMR::IBHydrodynamicForceEvaluator::fillPatchData ( const int  u_src_idx,
const int  p_src_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy,
const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &  u_src_bc_coef,
SAMRAI::solv::RobinBcCoefStrategy< NDIM > *  p_src_bc_coef,
const double  fill_time 
)
private

◆ getPhysicalCoordinateFromSideIndex()

void IBAMR::IBHydrodynamicForceEvaluator::getPhysicalCoordinateFromSideIndex ( IBTK::Vector3d side_coord,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > >  patch,
const SAMRAI::pdat::SideIndex< NDIM >  side_idx,
const int  axis 
)
private

Member Data Documentation

◆ d_object_name

std::string IBAMR::IBHydrodynamicForceEvaluator::d_object_name
private

◆ d_rho

double IBAMR::IBHydrodynamicForceEvaluator::d_rho
private

◆ d_mu

double IBAMR::IBHydrodynamicForceEvaluator::d_mu
private

◆ d_current_time

double IBAMR::IBHydrodynamicForceEvaluator::d_current_time
private

◆ d_u_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::SideVariable<NDIM, double> > IBAMR::IBHydrodynamicForceEvaluator::d_u_var
private

◆ d_p_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::IBHydrodynamicForceEvaluator::d_p_var
private

◆ d_u_idx

int IBAMR::IBHydrodynamicForceEvaluator::d_u_idx
private

◆ d_p_idx

int IBAMR::IBHydrodynamicForceEvaluator::d_p_idx
private

◆ d_face_wgt_sc_idx

int IBAMR::IBHydrodynamicForceEvaluator::d_face_wgt_sc_idx
private

◆ d_vol_wgt_sc_idx

int IBAMR::IBHydrodynamicForceEvaluator::d_vol_wgt_sc_idx
private

◆ d_hydro_objs

std::map<int, IBHydrodynamicForceObject> IBAMR::IBHydrodynamicForceEvaluator::d_hydro_objs
private

The documentation for this class was generated from the following file: