Hi Friends, I have a proble
I have a problem of the Vector and scalar when I process the Darcy velocity. The Darcy velocity is depended on the gradient of pressure. Pressure is the SCALAR, but Darcy VELOCITY is the VECTOR. So when I complier, I was told the operator is error.
My equation of the Darcy velocity is:
U = -K/nu(grad(P) - rho*g) where K is the permeability, nu is the viscosity, P is pressure and g is gravity.
I encoded as followsing in FOAM:
fvVectorMatrix UEqn // solving Darcy velocity
- (K/nu)*(fvc::grad(P) - rho*g)
The complier error is:
buoyantFoam.C:81: error: no match for 'operator-' in 'Foam::fvc::grad(const Foam::GeometricField<type,>&) [with Type = Foam::scalar]() - Foam::operator*(const Foam::GeometricField<foam::scalar,>&, const Foam::GeometricField<type,>&) [with Type = Foam::scalar, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::GeometricField<foam::scalar,>&)((const Foam::GeometricField<foam::scalar,>*)(& gh))))'
/home/liu/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/dimensionSet.H:176: note: candidates are: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&)
/home/liu/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/dimensionSet.H:188: note: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&, const Foam::dimensionSet&)
/home/liu/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/dimensionedScalar.H:55: note: Foam::dimensionedScalar Foam::operator-(const Foam::dimensionedScalar&, Foam::scalar)
/home/liu/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/dimensionedScalar.H:56: note: Foam::dimensionedScalar Foam::operator-(Foam::scalar, const Foam::dimensionedScalar&)
/home/liu/OpenFOAM/OpenFOAM-1.2/src/cfdTools/general/lnInclude/initContinuityErr s.H:38: warning: unused variable 'cumulativeContErr'
make: *** [Make/linuxGcc4Opt/buoyantFoam.o] Error 1
Could any friend help me?
Thanks so much.
Is it possible, that your g is
Is it possible, that your g is only a scalar? It should be a vector (gravity is pointing somewhere).
Why are you building a matrix
Why are you building a matrix when the equation is explicit?
In any case, you haven't included U in the UEqn. What do you think you will be solving for?
Hi, freinds, Many thanks fo
Many thanks for your help.
I solve the UEqn for the Darcy`s velocity which is depended on the gradient pressure and gravity (for buoyancy). My whole solver is linked by (http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi). So if not like my wroten, what it should be? Could you give more advice?
|All times are GMT -4. The time now is 13:52.|