Falling sphere doesn't fall if ForcingFunction is given

39 views
Skip to first unread message

Sagar G Nayak

unread,
Jun 23, 2025, 3:04:56 AMJun 23
to IBAMR Users
Hello,
In the 'falling_sphere' problem ( in ConstraintIB) the force is explicitly given to the sphere as "gravity minus buoyancy" and no additional ForcingFunction is mentioned. So, this doesn't give hydrostatic pressure field.

Since, I want to see the hydrostatic pressure, I am using ForcingFunction like this
ForcingFunction {
rho = RHO
function_0 = "0.0"
function_1 = "-rho*9.81"
function_2 = "0.0"
}

and give only gravity to the sphere using
ForceProjector {

rho_fluid = RHO
rho_body = 3.0
gravitational_constant = 0.0,-9.81, 0.0

}

I was expecting fluid would apply buoyancy to the sphere and it will lead to the same result. However in this case, though I am getting hydrostatic pressure, the sphere is not falling at all. Can someone please help?

Thanks

Sagar G Nayak

unread,
Jul 15, 2025, 3:20:53 AMJul 15
to IBAMR Users
Hello,
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);
}

Can someone please help?
Thanks

Amneet Bhalla

unread,
Sep 6, 2025, 1:18:36 PM (2 days ago) Sep 6
to ibamr...@googlegroups.com
Can you put some print statements in your forcing functions to see when they are getting called? Alternatively you can put print statements in the HierarchyIntegrator class which executes the registered callback functions to understand the sequence of function calls.  

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ibamr-users/b16f2391-846c-4c4d-a440-c80066a8ce6dn%40googlegroups.com.


--
--Amneet 



Reply all
Reply to author
Forward
0 new messages