|
[Sponsors] |
How to write fluctuating velocity field at runtime? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 22, 2014, 10:53 |
How to write fluctuating velocity field at runtime?
|
#1 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Hi,all
I'm doing a LES simulation. And I want to write the fluctuating velocity, that is: u'=U-UMean, so how can I implement this? I tried like this Code:
Info<< "Reading field UMean\n" << endl; volVectorField UMean ( IOobject ( "UMean", runTime.timeName(), mesh, IOobject::MUST_READ ), mesh ); volVectorField Ufluc ( IOobject ( "Ufluc", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh ); Ufluc=U-UMean; Ufluc.write(); Code:
NO_READ specified for read-constructor of object Ufluc of class IOobject From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 46. FOAM aborting |
|
April 22, 2014, 11:10 |
|
#2 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
The innovation to do this is to define the fluctuating field as to do post-process about u', although I know it's possible to do U-UMean in post-process, I still want to know if this can be accomplished directly.
|
|
April 27, 2014, 11:10 |
|
#3 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
You have specified the the Ufluc field not to be read from a file, and have failed to provide initial values that are in that case required to construct the field:
Code:
volVectorField Ufluc ( IOobject ( "Ufluc", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh // Missing initial values ); Code:
volVectorField Ufluc ( IOobject ( "Ufluc", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector ( "zero", U.dimensions(), // Or Umean.dimensions() vector (0,0,0) ) ); Code:
runTime.write();
__________________
When asking a question, prepare a SSCCE. Last edited by tomislav_maric; April 27, 2014 at 11:14. Reason: code formatting was messed up |
|
April 28, 2014, 08:14 |
|
#4 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
Thank you for your reply. Where should I put the 'runTime.write()' as you say? .H file or in the .C file? |
||
April 29, 2014, 05:41 |
|
#5 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
[QUOTE]
Thank you for your reply. Where should I put the 'runTime.write()' as you say? .H file or in the .C file? [\QUOTE] 'runTime' is a global object (class 'Foam::Time'), and it's usually used in application (solver) client code - if you open a solver you are interested in, you will find it at the end of the main simulation loop. If you are doing modifications in createFields.H, you don't have to explicitly write the fields there with '.write()', the solver will take care of the writing of all registered fields.
__________________
When asking a question, prepare a SSCCE. |
|
April 29, 2014, 22:41 |
|
#6 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
[QUOTE=tomislav_maric;488832]
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Question About Setting Whole Velocity Field Using "Proflie" in FLUENT | adsl17754 | FLUENT | 5 | July 31, 2018 05:29 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Setting the Velocity Field | Adammann | OpenFOAM | 1 | July 8, 2011 03:15 |
transient temperature field with constant velocity | Törnquist | CFX | 0 | September 16, 2003 05:22 |
Pressure from velocity field | Svante Hellzén | Main CFD Forum | 5 | November 30, 1999 19:20 |