CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Read out value of keyword in boundaryField (https://www.cfd-online.com/Forums/openfoam-programming-development/126013-read-out-value-keyword-boundaryfield.html)

styleworker November 6, 2013 05: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:
Code:

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:
Code:

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

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

            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 09:44

Does anybody have an idea?


All times are GMT -4. The time now is 05:03.