sourav8016 |
August 21, 2021 12:46 |
how to put if statement in between volScalarField and dimensionedScalar
Hi Foamers,
I have to put a if statement in between a volScalarField and dimensionedScalar. The part of the code is :
//////////////////////////////////////////////////////////////
volScalarField y = mesh.C().component(vector::Y);
volScalarField u = ustar*(((1.0-Y0)/(Y0-Foam::log(Y0)-1.0))*Foam::log(y)/(h*Y0)));
if(y >= Y0*h && y <= h )
{
u = ustar*(((1.0-Y0)/(Y0-Foam::log(Y0)-1.0))*Foam::log(y/(h*Y0)));
}
else
{
u = 0.0;
}
dimensionedScalar Y0
(
transportProperties.lookup("Y0")
);
dimensionedScalar h
(
transportProperties.lookup("h")
);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
After running the code I'm getting this error :
.C:82:24: error: no match for ‘operator<=’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘Foam::dimensionedScalar {aka Foam::dimensioned<double>}’)
if(y >= Y0*h && y <= h )
|