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/)
-   -   Accessing an entry from an fvPatchScalarField (https://www.cfd-online.com/Forums/openfoam-programming-development/169338-accessing-entry-fvpatchscalarfield.html)

Flor April 7, 2016 13:24

Accessing an entry from an fvPatchScalarField
 
Dear Foamers,

I would like to access the scalarField of the roughness height Ks from a patch field of nut. By now I get the fvPatchScalarField

Code:

const fvPatchScalarField& nutField = bottomFvPatch.lookupPatchField<volScalarField, scalar>("nut");
Info << nutField << endl;

This results in the following output:

Code:

type            nutRoughWallFunction;
Cmu            0.09;
kappa          0.41;
E              9.8;
Cs              uniform 0.5;
Ks              uniform 0.001;
value          nonuniform List<scalar>
350
(
0.000654725
0.000654725
0.000654725
...

Now I would like to continue working with the Ks-field, but somehow I don't get it extracted. I'm thinking of something like

Code:

localKs = nutField.lookupEntry("Ks");
Any hints anyone? Maybe it's possible to cast the fvPatchScalarField into a dictionary?

Thanks in advance!
Florian


All times are GMT -4. The time now is 15:52.