CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Correct foamfile header for input file with mixed quantities (any version of OF) (https://www.cfd-online.com/Forums/openfoam-solving/200307-correct-foamfile-header-input-file-mixed-quantities-any-version.html)

deepbandivadekar March 29, 2018 07:17

Correct foamfile header for input file with mixed quantities (any version of OF)
 
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 April 12, 2018 06:26

Anyone at all ?

deepbandivadekar April 22, 2018 10:53

Bumping this up again.. just in case

CFDTeufel February 15, 2021 05:10

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.


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