|
[Sponsors] |
March 6, 2014, 09:04 |
Calculations and Dimensions
|
#1 |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Hi,
I am working with the multiphaseEulerFoam and I recognized that sometimes fields are initialized like Code:
volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Code:
volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector("U", dimVelocity, vector::zero) ); |
|
March 6, 2014, 09:23 |
|
#2 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22 |
Hi Maybee,
The clue is in the way the field is read: In case of your 'p'-example, the p-field must be read (IOobject::MUST_READ). Initial value of the field and also the dimensions are read from the field in the time folder "runTime.timeName()". In case of the velocity field U. You specify IOobject::NO_READ meaning that OF will not search for an input file in the time folder but that the field is initialized by the dimensions vector (which automatically defines the dimensions). There is an other option possible: READ_IF_PRESENT which basically combines the two previous ones. (in fact also a fourth, MUST_READ_IF_MODIFIED, but this is less relevant in the present context). Hope this clarifies things... Cheers, L |
|
March 6, 2014, 13:09 |
|
#3 |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
Thx. got it now.
|
|
December 26, 2014, 08:06 |
|
#4 |
Member
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 12 |
Hi Lieven, I want to define volSymmetryField, but I don't know know how to write the code of demensioneSet and initialize it. Would you mind giving me some advice? Thanks!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
transient calculations! | lelia | Siemens | 9 | April 14, 2008 09:33 |
How to choose a BL dimensions..? | Cyril | FLUENT | 11 | September 21, 2007 09:42 |
Including gravity in calculations!!! | gilberto | CFX | 26 | October 15, 2001 21:55 |