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

What type return fvcdiv

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 10, 2008, 23:23
Default Hi Ivan fvc::div(...
  #1
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Ivan

fvc::div(...) return tmp<geometricfield>
you can use set the variable to the type of geometricfield(including the internal and boundary field, and the data are dimensioned) or just use its internal field(undimensioned).

Hope this helps

Junwei
su_junwei is offline   Reply With Quote

Old   October 11, 2008, 04:07
Default Thank you Junwei for your fast
  #2
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Thank you Junwei for your fast reply!
Ok, maybe I found the error, it is in:

volScalarField rhsRho1 = (- divPhiRho1 - rho0 * divPhiU1) / mesh.V();

In someway it doesn't like / mesh.V(), if I remove it, it compiles without errors. But now, 2 questions:

1) If I set a variable like this:
volScalarField a = b;
where b is a tmp<volscalarfield>,
the = assignment is valid?

2) It says that it find some Foam::tmp<foam::field<double> >, and as the only thing I have removed is mesh.V(), the latter should be the tmp, but in the programmer's guide i read that it's a volScalarField. How it is possible?
Bye!!
ivan_cozza is offline   Reply With Quote

Old   October 11, 2008, 08:23
Default Hi Ivan It seems that mesh
  #3
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Ivan

It seems that mesh.V() is a dimensionedField,Try the following code segment
volScalarField rhsRho1.dimensionedInternalField()= (- divPhiRho1 - rho0 * divPhiU1).dimensionedInternalField() / mesh.V();

It seems that there is not a member for volScalarField dividing dimensionedField

Junwei
su_junwei is offline   Reply With Quote

Old   October 11, 2008, 08:26
Default Hi Ivan A little more,
  #4
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Ivan

A little more, declare the volScalarField rhsRho1 behand please.

Junwei
su_junwei is offline   Reply With Quote

Old   October 12, 2008, 09:36
Default I'm a little confused, because
  #5
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
I'm a little confused, because the programmer's guide says that the .V() member of mesh should be a volScalarField. Could it be a bug in the programmer's guide?

Moreover, I found out that if I just delete mesh.V() from the right hand side of

df/dt = -div(flux)

it works. The results are coherent! So, the result of fvc::div is already divided by the cell volume?

Have a nice sunday,
Ivan
ivan_cozza is offline   Reply With Quote

Old   October 12, 2008, 15:48
Default This is a recent change: mesh.
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
This is a recent change: mesh.V() is now a dimensioned field, ie. it does not have boundary conditions.

Yes, fvc::div(phi) is divided by the cell volume.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 13, 2008, 07:09
Default Thank you Prof. Jasak, now I
  #7
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Thank you Prof. Jasak,
now I catch this part of the problem.
Cheers!
ivan_cozza 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
return code 2 Kwang-su Kim CFX 5 April 21, 2011 18:03
return code 47 Fernando CFX 0 May 15, 2008 06:29
Return Code 2 - CFX 11.0 AMD 64 Bayard Morales CFX 0 December 5, 2007 08:36
return code 127 Dave CFX 1 September 27, 2006 22:11
Return code 255 (CFX-5.7.1) Jesper CFX 4 May 23, 2005 08:03


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