CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Accessing sauter diameter defined in createFieldsH (http://www.cfd-online.com/Forums/openfoam-solving/59055-accessing-sauter-diameter-defined-createfieldsh.html)

mateusz_slowikowski March 10, 2008 11:33

I have a sauter mean diameter
 
I have a sauter mean diameter defined in the createFields.H file:

volScalarField d32_
(
IOobject
(
"d32",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
phasea->d()*alpha
);

{
volScalarField d32_temp = scalar(0.0)/d32_;
for (int k = 0; k<N_Bins; k++)
{
d32_temp += popBal->binVolume(k) * (*n_[k]) / phasea->d() / (Foam::pow( 2, (N_Bins - scalar(k-1)) / 3));
}
d32_ = scalar(1.0)/d32_temp;
}

and I want to access it in the kinetic theory model:

Foam::kineticTheoryModel::kineticTheoryModel
([...vars passed in...]):
...
da_ ((*(phasea.U())).DB().lookupObject<const> ("d32")),
...

However, I keep on getting these error:

kineticTheoryModel/kineticTheoryModel.C:51: error: ‚class Foam::tmp<foam::geometricfield<foam::tensor<double >, Foam::fvPatchField, Foam::volMesh> >‚ has no member named ‚DB‚
kineticTheoryModel/kineticTheoryModel.C:51: error: expected primary-expression before ‚const‚

I'm not sure how to correctly write the syntax...

mateusz_slowikowski March 10, 2008 11:40

the line da_ (phasea.U().DB
 
the line

da_ (phasea.U().DB().lookupObject<const> ("d32")),

solves it


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