I would go ahead and extend the codedFixedValue
boundary condition, that you have already available with some lines that access the mapped inlet patch directly from its code. Below is a stupid example, that should illustrate that access. Please mind, that the assignment operator's argument is just made up by myself, which is sole purpose is to illustrate the working principle. The lines above are the important ones.
You first define the inlet patch name and get a const reference to the mesh. Afterwards a const reference to the velocity field is created, which is looked up from the object registry. The next step looks for the patch name and stores the corresponding patch ID as a lable, which is then reused by the following line to access the boundary field of the inlet patch.
myPatch
{
type codedFixedValue;
value uniform 0;
redirectType rampedFixedValue; // name of generated BC
code
#{
const word coupledPatchName("INLET");
const fvMesh& mesh(dimensionedInternalField().mesh());
const volVectorField& U(db().lookupObject<volVectorField>("U");
const label coupledPatchID(mesh.boundaryMesh().findPatchID(coupledPatchName));
const vectorField& UbCoupled(U.boundaryField()[coupledPatchID]);
operator==(10*vector::one*max(mag(UbCoupled)));
#};
}
I hope this helps with your problem, otherwise please shout.