Skip to content

Commit

Permalink
Merge pull request IBAMR#1687 from IBAMR/mass_loss_redux
Browse files Browse the repository at this point in the history
Mass loss redux
  • Loading branch information
amneetb authored Apr 5, 2024
2 parents a6bdb29 + 2a3dbf5 commit 407503e
Show file tree
Hide file tree
Showing 21 changed files with 2,698 additions and 571 deletions.
7 changes: 7 additions & 0 deletions doc/news/changes/major/20240404KaustubhKehdkar
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Remove the volume shift algorithm and replace it with a volume redistribution algorithm in the RelaxationLSMethod class.

New: Introduce a new LevelSetUtilities class to provide implementations of helper functions for enforcing mass/volume conservation across phases. This class also includes implementations of SetLSProperties (to set or reset the level set after reinitialization) and TagLSRefinementCells (to tag cells for grid refinement based on the level set). These additions reduce duplicated codes in multiphase examples.

Enhancement: Spiliting BrinkmanPenalization into normal and tangential components near the solid interface.

(Amneet Bhalla, Kaustubh Khedkar, and Ramakrishnan Thirumalaisamy, 2024/04/04)
14 changes: 14 additions & 0 deletions ibtk/include/ibtk/ibtk_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@ smooth_heaviside(const double& phi, const double& alpha)
return Hphi;
}

/*!
* Smooth delta function.
*/
inline double
smooth_delta(const double& phi, const double& alpha)
{
double delta = 0.0;
if (std::abs(phi) <= alpha)
{
delta = 0.5 / alpha + 1.0 / (2.0 * alpha) * std::cos(M_PI * phi / alpha);
}
return delta;
}

/*!
* Discontinuous heaviside function.
*/
Expand Down
36 changes: 35 additions & 1 deletion include/ibamr/BrinkmanPenalizationRigidBodyDynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,26 @@ class BrinkmanPenalizationRigidBodyDynamics : public BrinkmanPenalizationStrateg
*/
void putToDatabase(SAMRAI::tbox::Pointer<SAMRAI::tbox::Database> db) override;

/*!
* \brief Factor to enhance the Brinkman penalty in the normal direction to
* the solid interface.
*/
void setNormalBrinkmanPenaltyFactor(double penalty_factor_normal)
{
d_penalty_factor_normal = penalty_factor_normal;
return;
} // setNormalBrinkmanPenaltyFactor

/*!
* \brief Factor to enhance the Brinkman penalty in the tangential direction to
* the solid interface.
*/
void setTangentialBrinkmanPenaltyFactor(double penalty_factor_tangential)
{
d_penalty_factor_tangential = penalty_factor_tangential;
return;
} // setTangentialBrinkmanPenaltyFactor

/*!
* \brief Get initial center of mass of the body.
*/
Expand Down Expand Up @@ -308,7 +328,8 @@ class BrinkmanPenalizationRigidBodyDynamics : public BrinkmanPenalizationStrateg
// Hydrodynamic force evaluator.
SAMRAI::tbox::Pointer<IBAMR::IBHydrodynamicSurfaceForceEvaluator> d_hydro_force_eval;

// Contour level
// Contour level of the indicator function/level set at which hydrodynamic forces
// are evaluated
double d_contour_level = 0.0;

// Number of interface cells to compute the Heaviside function
Expand All @@ -322,6 +343,11 @@ class BrinkmanPenalizationRigidBodyDynamics : public BrinkmanPenalizationStrateg
KinematicsFcnData d_kinematics_fcn_data;
ExternalForceTorqueFcnData d_ext_force_torque_fcn_data;

// If we want to apply Brinkman penalty differently in the normal vs. tangential directions
// along the structure interface
bool d_split_penalty = false;
double d_penalty_factor_normal = 1.0, d_penalty_factor_tangential = 1.0;

private:
/*!
* \brief Copy constructor.
Expand Down Expand Up @@ -356,6 +382,14 @@ class BrinkmanPenalizationRigidBodyDynamics : public BrinkmanPenalizationStrateg
* members.
*/
void getFromRestart();

void computeBrinkmanVelocityWithoutSplitting(int u_in_idx, double time, int cycle_num);

void computeBrinkmanVelocityWithSplitting(int u_in_idx, double time, int cycle_num);

void demarcateBrinkmanZoneWithoutSplitting(int u_idx, double time, int cycle_num);

void demarcateBrinkmanZoneWithSplitting(int u_idx, double time, int cycle_num);
};

} // namespace IBAMR
Expand Down
Loading

0 comments on commit 407503e

Please sign in to comment.