sfigato |
March 25, 2013 04:05 |
Dimension Problem in If Condition
Hi Foamers,
I would like to implement a new cavitation solver in openFoam! I added a transport equation for mass fraction where I need to compare my local pressure (p) with a scalar experimental value pEq!
During the compiling of the code I got a dimension error!
Can anyone help me to fix it?
Here is the transport equation code:
Quote:
// Solve Mass Fraction Equation for the Gas Air (undissolved)
{
#include "sourceTerms.H"
//Scalar Transport Equation for Mass Fraction
if (pEq > p) //p)
{
fvScalarMatrix f4Eqn
(
fvm::ddt(rho, f4)
+ fvm::div(rhoPhi /*phi*/, f4)
- fvm::laplacian(Gamma4,f4)
//+ fvm::Sp(AaL,f4)
+ fvm::Sp(AdL,f4)
);
f4Eqn.relax();
solve( f4Eqn /*== AaL*fGlim*/);
}
else
{
fvScalarMatrix f4Eqn
(
fvm::ddt(rho, f4)
+ fvm::div(rhoPhi /*phi*/, f4)
- fvm::laplacian(Gamma4,f4)
+ fvm::Sp(AaL,f4)
//+ fvm::Sp(AdL,f4)
);
f4Eqn.relax();
solve( f4Eqn == AaL*fGlim);
}
//Update of All Phases Coeffcients
//rho == scalar(1)/((f1+f4)/rho1 + f2/rho2 + f3/rho3);
//rhoPhi == rho*phi;
}
|
Here the declarations for pEq and p
Quote:
Info<< "Reading thermodynamicProperties\n" << endl;
IOdictionary thermodynamicProperties
(
IOobject
(
"thermodynamicProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedScalar pEq(thermodynamicProperties.lookup("pEq"));
|
Quote:
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
|
The compiling error is:
Quote:
Making dependency list for source file ifasFCMfoam.C
Making dependency list for source file incompressibleFourPhaseMixture/fourPhaseMixture.C
SOURCE=ifasFCMfoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/turbulenceModels/incompressible/turbulenceModel -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/transportModels -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/ifasFCMfoam.o
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H: In function ‘int main(int, char**)’:
f4Eqn.H:6:11: error: no match for ‘operator>’ in ‘pEq > p’
f4Eqn.H:6:11: note: candidates are:
In file included from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpace.H:164:0,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.H:41,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/TimeState.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Time.H:47,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:6,
from ifasFCMfoam.C:36:
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpaceI.H:650:13: note: template<class Form, class Cmpt, int nCmpt> bool Foam::operator>(const Foam::VectorSpace<Form, Cmpt, nCmpt>&, const Foam::VectorSpace<Form, Cmpt, nCmpt>&)
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpaceI.H:650:13: note: template argument deduction/substitution failed:
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H:6:11: note: ‘Foam::dimensionedScalar {aka Foam::dimensioned<double>}’ is not derived from ‘const Foam::VectorSpace<Form, Cmpt, nCmpt>’
In file included from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.H:298:0,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/TimeState.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Time.H:47,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:6,
from ifasFCMfoam.C:36:
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.C:450:6: note: template<class Type> bool Foam::operator>(const Foam::dimensioned<Type>&, const Foam::dimensioned<Type>&)
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.C:450:6: note: template argument deduction/substitution failed:
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H:6:11: note: ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ is not derived from ‘const Foam::dimensioned<Type>’
In file included from ifasFCMfoam.C:49:0:
createFields.H:106:30: warning: unused variable ‘rho4’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/ifasFCMfoam.o] Fehler 1
|
|