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

Correct foamfile header for input file with mixed quantities (any version of OF)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2018, 08:17
Question Correct foamfile header for input file with mixed quantities (any version of OF)
  #1
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Hello,

I have a case that takes in certain input values from a file named "input" in the 0 folder. The input file has varied quantities (of various dimensions; see code below). I do not prefer to create separate input files e.g. classified by vectors/scalers. This single input file then is included in each of the inititalisation files (U, T, p...).

For some reason the case ran successfully by commenting out the foamfile header in OF 5.x. However, for a the lack of availability of the OF 5.x on the cluster I have to run it with lower version: 2.4.0 And this is giving me an error:

Code:
--> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 23 the word 'pressure'
I have a line of thought that this is happening because in this version of OF, as the solver starts parsing input values, it begins from p file and cannot understand the word 'pressure' which is used in the input file and thus fails. This would be the case with other variables (U, T, ...) as well but since it begins with p it just stops at the first instance.

The error persists even after I uncomment the foamfile header in the input file, and with different keywords against class and object. I didn't find any resource to correct that.

Does anyone know, what should be the correct foamfile header for this input file? How does it change with the different versions of OF (I'd like to know the correct header for OF 5.x as well)


Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      values;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


speed             speed [0 1 -1 0 0 0 0] (1500 0 0); // m/s 
temperature       temperature [0 0  0 1 0 0 0] 286.95; // Kelvin
temperaturePorous temperaturePorous [0 0  0 1 0 0 0] 300; // Kelvin
pressure          pressure [1 -1 -2 0 0 0 0] 373384; // Pascals
pressurePorous    pressurePorous [1 -1 -2 0 0 0 0] 1.01235e5; // Pascals
density          density [1 -3 0 0 0 0 0] 1.25; //kg/m^3

mDot          mDot [1 0 -1 0 0 0 0] 0.001; //kg/s 0.00001
For the OF 5.x version I didn't have to supply dimensions like this, it just worked with keyword and value (e.g. speed (1500 0 0 );
deepbandivadekar is offline   Reply With Quote

Old   April 12, 2018, 07:26
Default
  #2
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Anyone at all ?
deepbandivadekar is offline   Reply With Quote

Old   April 22, 2018, 11:53
Default
  #3
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Bumping this up again.. just in case
deepbandivadekar is offline   Reply With Quote

Old   February 15, 2021, 06:10
Default
  #4
New Member
 
Join Date: Nov 2020
Posts: 2
Rep Power: 0
CFDTeufel is on a distinguished road
How does your p dictionary look like? I'd like to see, how do you call these parameters in the intended dictionary.
I would do it like the turorial motorBike in tutorials\incompressible\pisoFoam\LES\motorBike.
CFDTeufel is offline   Reply With Quote

Reply

Tags
foamfile, header, input file, openfoam 2.4.0, openfoam 5.x


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
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 10:07
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18


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