CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Read out value of keyword in boundaryField (

styleworker November 6, 2013 06:50

Read out value of keyword in boundaryField
Hello foamers,

I've added a new boundary condition (modified constantAlphaContactAngle) for calculating a temperature dependent contact angle. This BC writes out the current contact angle in the write function via:

os.writeKeyword("theta0") << calcMic(0) << token::END_STATEMENT << nl;
When correcting the the contact angle in interfaceProperties.C, the boundary alpha boundary conditions can be read via:

    const volScalarField::GeometricBoundaryField& abf = alpha1_.boundaryField();
    const fvBoundaryMesh& boundary = mesh.boundary();

    forAll(boundary, patchi)
        if (isA<alphaContactAngleFvPatchScalarField>(abf[patchi]))
            alphaContactAngleFvPatchScalarField& acap =
                    refCast<const alphaContactAngleFvPatchScalarField>

            fvsPatchVectorField& nHatp = nHatfv.boundaryField()[patchi];
            const scalarField theta
                convertToRad*acap.theta(U_.boundaryField()[patchi], nHatp)
            Info << "######## acap ======" << acap << endl;

The function alphaContactAngleFvPatchScalarField acap contains the entry theta0 with the corresponding value.

My Question: How can I get access to the value of the keyword theta0?

thank you!

styleworker November 11, 2013 10:44

Does anybody have an idea?

All times are GMT -4. The time now is 04:25.