|
[Sponsors] |
September 27, 2013, 04:57 |
error : invalid use of void expression
|
#1 |
New Member
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14 |
hi foamers.
my problem is entrophy Generation shown in following picture : i write a code for of220 & got this error. code: Code:
volVectorField gradT = fvc::grad(T); volScalarField gradTx = gradT.component(0); volScalarField gradTy = gradT.component(1); volScalarField uX = U.component(0); volScalarField uY = U.component(1); volVectorField graduX = fvc::grad(uX); volVectorField graduY = fvc::grad(uY); volScalarField dudx = graduX.component(0); volScalarField dvdy = graduY.component(1); volScalarField dudy = graduX.component(1); volScalarField dvdx = graduY.component(0); fvScalarMatrix SEqn ( Sgen == (k/Foam::pow(T,2))*(Foam::pow(gradTx,2)+Foam::pow(gradTy,2)) + (mu/T)*(Foam::pow(dudx,2)+Foam::pow(dvdy,2))*2 + (mu/T)*Foam::pow((dudy+dvdx),2) ); SEqn.solve(); Code:
In file included from myPorousSimpleFoam.C:73:0: SEqn.H: In function ‘int main(int, char**)’: SEqn.H:21:1: error: invalid use of void expression make: *** [Make/linux64GccDPOpt/myPorousSimpleFoam.o] Error 1 |
|
September 27, 2013, 05:11 |
|
#3 |
New Member
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14 |
line 21 : );
|
|
September 27, 2013, 06:04 |
|
#4 |
New Member
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14 |
thanks anton. my problem is solved.
using fvc::grad is an explicit operation that actually returns an volScalarFields, not fvScalarMatrix. Code:
volScalarField Sgen ( (k/Foam::pow(T,2))*(Foam::pow(gradTx,2)+Foam::pow(gradTy,2)) + (mu/T)*(Foam::pow(dudx,2)+Foam::pow(dvdy,2))*2 + (mu/T)*Foam::pow((dudy+dvdx),2) ); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 06:16 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 06:25 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 07:36 |
OpenFoam 14 installation problem | gfcoppola | OpenFOAM Installation | 20 | November 2, 2007 13:38 |