inferFoam cannot read pressure (p_rgh)

I am trying to couple two interFoam simulations with eachother, herefor I use the example damBreak from openFOAM. This simulation is extended by adding a new mesh to the right of the existing mesh. The left has as boundary conditions a fixed value for the pressure and fixed gradient for the velocity. The right side has a fixed value for the velocity and fixed gradient for the pressure. As for now I did not yet look into exchanging data of alpha. When I try to run the simulation, the following error occurs:

Attempt to cast type calculated to type fixedValue

From function To& Foam::refCast(From&) [with To = Foam::fixedValueFvPatchField<double>; From = Foam::fvPatchField<double>]
in file /opt/openfoam7/src/OpenFOAM/lnInclude/typeInfo.H at line 114.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  preciceAdapter::FF::PressureGradient::write(double*, bool, unsigned int) at ??:?
#3  preciceAdapter::Interface::writeCouplingData() at ??:?
#4  preciceAdapter::Adapter::writeCouplingData() at ??:?
#5  preciceAdapter::Adapter::execute() at ??:?
#6  Foam::functionObjects::preciceAdapterFunctionObject::execute() at ??:?
#7  Foam::functionObjectList::execute() at ??:?
#8  Foam::Time::run() const at ??:?
#9  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/interFoam"
#10  __libc_start_main in "/lib/x86_64-linux-gnu/"
#11  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/interFoam"

Something goes wrong when getting data from the PressureGradient.
Does anyone knows how to solve this? The case can be found at

Thanks for helping in advance!

I think the problem originates from the fact that interFoam uses p_rgh instead of p. So, p is a derived field, to which we cannot define a boundary condition.

For this solver we would need to extend the Fluid-Fluid module of the adapter to also write and read p_rgh, a contribution which would be very welcome! :slight_smile:

We now have a general issue regarding incompressible multiphase solvers:

I am closing this topic, but feel free to comment in the issue or reopen if problems persist after the feature gets implemented.