Hi,
I am trying to work with an FSI problem which involves 3 participants:
- Solid
- Fluid1
- Fluid2 (openfoam adapter
pimplefoam
)
like this:
Fluid1 talks to Solid and Fluid2. Solid talks to Fluid1 only and Fluid2 talks to Fluid1 only.
I am using multi-coupling scheme and Fluid1 is controller participant.
My problem is that, when I try to run the simulation, it sticks into a deadlock and doesn’t move ahead.
I am attching following content here:
-
preCICE config file
precice-config.xml (8.6 KB) -
log file for Fluid1 participant
fluid1.log (106.0 KB) -
log file for Fluid2 participant
fluid2.log (89.0 KB) -
log file for Solid participant
solid.log (83.9 KB)
CODE
- code from main solver loop of Fluid1
- code from main solver loop of Solid
it seems to me that, fluid2 and solid enters into receive and the code runs into a deadlock. The Fluid2 is using and openfoam solver: pimplefoam.
CODE:
The main sover loop for Fluid1
is:
while (interface.is_coupling_ongoing()):# and interface.is_coupling_ongoing()):
# When an implicit coupling scheme is used, checkpointing is required
if interface.is_action_required(action_write_iteration_checkpoint()):
interface.mark_action_fulfilled(action_write_iteration_checkpoint())
velocity, pressure, success = perform_partitioned_implicit_euler_step(
velocity_old, pressure_old, crossSectionLength_old, crossSectionLength, dx, precice_dt, velocity_in(
t + precice_dt), custom_coupling=True)
interface.write_vector_data(velocityID_fluid, vertexIDs_fluid1tofluid2, [0.0, 0.0, velocity[-1]])
pressure_solid_send = pressure[0:51]
interface.write_block_scalar_data(pressureID_solid, vertexIDs_fluid1tosolid, pressure_solid_send)
interface.advance(precice_dt)
pressure[-1] = interface.read_scalar_data(pressureID_fluid, vertexIDs_fluid1tofluid2)
crossSectionLength_recv = interface.read_block_scalar_data(
crossSectionLengthID, vertexIDs_fluid1tosolid)
crossSectionLength[0:51] = crossSectionLength_recv
# i.e. not yet converged
if interface.is_action_required(action_read_iteration_checkpoint()):
interface.mark_action_fulfilled(action_read_iteration_checkpoint())
else: # converged, timestep complete
t += precice_dt
velocity_old = np.copy(velocity)
pressure_old = np.copy(pressure)
crossSectionLength_old = np.copy(crossSectionLength)
time_it += 1
the main solver loop for the Solid
participant is:
while interface.is_coupling_ongoing():
# When an implicit coupling scheme is used, checkpointing is required
if interface.is_action_required(action_write_iteration_checkpoint()):
interface.mark_action_fulfilled(action_write_iteration_checkpoint())
crossSectionLength = crossSection0 * (
(pressure0 - 2.0 * c_mk ** 2) ** 2 / (pressure - 2.0 * c_mk ** 2) ** 2)
interface.write_block_scalar_data(crossSectionLengthID, vertexIDs, crossSectionLength)
precice_dt = interface.advance(precice_dt)
pressure = interface.read_block_scalar_data(pressureID, vertexIDs)
if interface.is_action_required(action_read_iteration_checkpoint()): # i.e. not yet converged
interface.mark_action_fulfilled(action_read_iteration_checkpoint())
else:
t += precice_dt
Please let me know if there anything which I am missing either from config file or code.
For ease, following is the config visualization: