|
[Sponsors] |
August 30, 2010, 16:00 |
Results file naming convention
|
#1 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
Hello,
I have a couple of questions regarding results files naming conventions: 1) I have seen models containing results files in the step "0" named, say, "a" and "a.org". The object type inside is "a". Can I safely assume that any file whose object does not match the file name can be ignored? If not, what is one to do when two independent files refer to the same object? 2) Along the same lines, I have cases where only file refers to a specific object; however, the object and the file names are not the same. I'm trying to figure out what the rule is for accepting a file containing cell results - take it or ignore it. If somebody could clarify this I would appreciate it. Thanks. -amtri |
|
September 1, 2010, 09:22 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
1) The a.org file is like a back-up. a is the file it is reading from and writing to in later timesteps.
2) I don't understand what you mean. Most of the time the files OpenFOAM uses for output can be found in the solver's createFields.H. Any GeometricField (e.g. volScalarField, volVectorField, etc...) with a constructor that takes an IOobject and a mesh will read from the file when it initializes. E.g.: Code:
volScalarField variableName ( IOobject ( // ... IOobject constructor options ), mesh ); Code:
IOobject ( name, instance, [local], READ_OPTION, WRITE_OPTION ) instance = the path (e.g. runTime.timeName() would be [case]/[timeValue]; constant() would be [case]/constant) local = optional. an extension to the path. e.g. [case]/constant/localName READ_OPTION = MUST_READ, READ_IF_PRESENT, or NO_READ - tells OpenFOAM if this file can be read. WRITE_OPTION = AUTO_WRITE, NO_WRITE - this indicates whether the file is able to be written. Not sure if I answered your question. |
|
September 1, 2010, 12:01 |
|
#3 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
marupio,
Thanks for the response. I take it I wasn't clear enough when asking the question in the first place. Also, these questions usually refer to the "0" state - the initial conditions. This is not surprising, since the user will usually put these files him/herself. To be more precise, here is specific case: I have a model where in directory "0" I have a file called "omega". However, the object type for this file is "epsilon" - as defined in the OpenFOAM header inside the file. So my question is: is this a valid file? Are there any rules whereby the results/initial conditions file name matches the name of the "object" entry in the file's OpenFOAM header? If this is a valid file, then this brings up the question: in your response you stated that "a.org" is a backup file. How can I tell that? What if, rather than calling it "a.org" a user had called it "a.b", or "c"? At what point does OpenFOAM decide that this is just an extraneous file that the user added in the directory and it shouldn't bother with it? Thanks. |
|
September 2, 2010, 09:56 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
OpenFOAM will only read files from the zero directory that were specified in createFields.H, as outlined by David. The other files will be ignored. In your case with a.org I'm guessing the file is used in a script that will reset a by copying a.org, then running setFields, and then running the solver (which then reads the newly set a file). What happens if the header specifies another object I'm not sure.
|
|
September 2, 2010, 10:43 |
|
#5 | ||
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Quote:
Likely what happened here was a file named epsilon was copied to produce the file for omega. It shouldn't have any effect. Quote:
Hope that helps! -Dave |
|||
September 2, 2010, 12:31 |
|
#6 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
Hmm... I think I'm starting to understand this. So maybe you can help me clear something.
The OpenFOAM database I'm looking at has the following files at step "0": U fixedInlet frontBackUpperPatches initialConditions k nut omega p turbulentBoundaryField Some of these files are included into others - and don't even an an OpenFOAM header in them. I'm not worried about them. If I look in the controlDict file, the application is "simpleFoam". I now go into the OpenFOAM directory OpenFOAM-1.6.x/applications/solvers/incompressible/simpleFoam and look at the file createFields.H According to the file (please correct me if I'm wrong), there are 2 IOobjects, both MUST_READ: "p" and "U". Does this mean I shouldn't read anything else?? How about the turbulence variables? I know they are important, because on subsequent steps they are written as output. What am I missing? Thanks million to both! -amtri |
|
September 2, 2010, 12:58 |
|
#7 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
One easy way to tell what it expects is to have an empty 0 directory and see what it complains about, adding one file at a time. You're right, it reads turbulence-related files, and those are buried a little deeper. The reason is: it depends on the turbulence model.
I believe it reads these when it executes this line: Code:
autoPtr<incompressible::RASModel> turbulence ( incompressible::RASModel::New(U, phi, laminarTransport) ); Code:
k_ ( IOobject ( "k", runTime_.timeName(), mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh_ ), epsilon_ ( IOobject ( "epsilon", runTime_.timeName(), mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh_ ), Another thing, some files are created for *output*, and not necessarily *input*. If you look in your createFields.H, you'll see #include "createPhi.H". createPhi is another GeometricField named "phi" whose read and write are set to: READ_IF_PRESENT, and AUTO_WRITE. That means: if the file "phi" is present, it will read it, otherwise it will calculate it. This also means that when you perform a simulation, the file "phi" will show up in your results. |
|
September 2, 2010, 13:48 |
|
#8 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
marupio,
Thanks for the explanations. But this is NOT pretty. Isn't there a place in the documentation that tells me what is expected to be there? I cannot imagine that a user will have to wade through the source code to determine what to create for initial conditions. I expected to see something like: "if application is ABC then...". Also, you are right that if I remove all files and see what OpenFOAM complains about will tell me what should be there; but it won't tell me what it could also optionally read IF it were there... Section 3.5 of the User Guide has a list of all solvers. That's a good start. But somewhere there should be a list of all required and optional variables for each solver. Maybe this IS in the documentation, but not in as neat a fashion as I imagine. Maybe someone can venture on how I can follow the threads to get this information? Thanks. -amtri |
|
September 7, 2010, 09:54 |
|
#9 | |
Senior Member
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17 |
Quote:
OF developers don't have the time and resources to maintain a full-fledged documentation effort. We don't pay them enough for that Mirko |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
1.7.x Environment Variables on Linux 10.04 | rasma | OpenFOAM Installation | 9 | July 30, 2010 05:43 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |
[OpenFOAM] ParaView 33 canbt open OpenFoam file | hariya03 | ParaView | 7 | September 25, 2008 18:33 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |