CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Accessing other variables in defining boundary condition (https://www.cfd-online.com/Forums/openfoam-solving/62983-accessing-other-variables-defining-boundary-condition.html)

Cynthia Poon March 25, 2009 03:36

Accessing other variables in defining boundary condition
 
Dear All,

I am going to write a boundary conditon by the fvPatchFields like this:
grad(Ux) = function of k
where Ux = x-component of Velocity; k = turbulent kinetic energy;

In my fvPatchFields class, I obtain k by writing this:
const fvPatchField<scalar>& k =
patch().lookupPatchField<volScalarField,scalar>("k ");


The boundary condition compile successfully, but when I start running my case, an error message like this appear:
request for volScalarField k from objectRegistry region0 failed
available objects of type volScalarField are
3
(
p
T
CdA
)

All p, T and CdA are defined in createField.C of my solver, while the k is first defined inside another class. Is it because k is the private data of RAS/kEpsilon Model, so I cannot get an access to this private data? Or my code quoted above is wrong?

Would anybody please kindly give me an idea on how can I access that volScalarField variable? I long for the help!

Regards,
Cynthia

Voulet September 27, 2021 06:28

Hello. I've exacly the same problem 12 years after you.


Does someone has a solution ? Is it possible to access a turbulence-related quantity in this way ? I use OF8.


All times are GMT -4. The time now is 17:58.