CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

error : invalid use of void expression

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By saeid.oqaz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2013, 04:57
Default error : invalid use of void expression
  #1
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14
saeid.oqaz is on a distinguished road
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();
error:

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
Kummi likes this.
saeid.oqaz is offline   Reply With Quote

Old   September 27, 2013, 04:58
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Which line is number 21?
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   September 27, 2013, 05:11
Default
  #3
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14
saeid.oqaz is on a distinguished road
line 21 : );
saeid.oqaz is offline   Reply With Quote

Old   September 27, 2013, 06:04
Default
  #4
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 14
saeid.oqaz is on a distinguished road
Quote:
Originally Posted by akidess View Post
Which line is number 21?
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)
);
saeid.oqaz is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 17:38.