Could someone please help me solve this issue? I
am trying to simulate the pressure rise during flow through packed bed
and compare with Ergun equation.
What I see happening is, when
two body force functions are registered (using
registerBodyForceFunction), IBAMR is evaluating only the one that is registered first (though the warning says they will be computed sequentially)
For example, if I do this (see that ForcingFunction is called first), I get hydrostatic pressure, but sphere doesn't move.
// Create Eulerian body force function specification objects.
if (input_db->keyExists("ForcingFunction"))
{
Pointer<CartGridFunction> f_fcn = new muParserCartGridFunction(
"f_fcn", app_initializer->getComponentDatabase("ForcingFunction"), grid_geometry);
time_integrator->registerBodyForceFunction(f_fcn);
}
// initialize gravitational force projector object.
ForceProjector* ptr_gravityforce =
new IBTK::ForceProjector("GravityForceProjector",
ib_method_ops->getLDataManager(),
patch_hierarchy,
app_initializer->getComponentDatabase("ForceProjector"),
"STAGGERED");
ib_method_ops->registerPreProcessSolveFluidEquationsCallBackFunction(&callForceProjectorCallBackFunction,
static_cast<void*>(ptr_gravityforce));
// initialize Eulerian body force object.
Pointer<CartGridFunction> ptr_cartgravityforce =
new IBTK::CartGridBodyForce(ptr_gravityforce->getEulerianForcePatchDataIndex());
time_integrator->registerBodyForceFunction(ptr_cartgravityforce);
If I do this, i.e define gravityforce first, the sphere moves, but I don't see any hydrostatic pressure
// initialize gravitational force projector object.
ForceProjector* ptr_gravityforce =
new IBTK::ForceProjector("GravityForceProjector",
ib_method_ops->getLDataManager(),
patch_hierarchy,
app_initializer->getComponentDatabase("ForceProjector"),
"STAGGERED");
ib_method_ops->registerPreProcessSolveFluidEquationsCallBackFunction(&callForceProjectorCallBackFunction,
static_cast<void*>(ptr_gravityforce));
// initialize Eulerian body force object.
Pointer<CartGridFunction> ptr_cartgravityforce =
new IBTK::CartGridBodyForce(ptr_gravityforce->getEulerianForcePatchDataIndex());
time_integrator->registerBodyForceFunction(ptr_cartgravityforce);
// Create Eulerian body force function specification objects.
if (input_db->keyExists("ForcingFunction"))
{
Pointer<CartGridFunction> f_fcn = new muParserCartGridFunction(
"f_fcn", app_initializer->getComponentDatabase("ForcingFunction"), grid_geometry);
time_integrator->registerBodyForceFunction(f_fcn);
}