CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Problems with the execution of the setFields utility. (http://www.cfd-online.com/Forums/openfoam-pre-processing/93996-problems-execution-setfields-utility.html)

foamer November 2, 2011 11:34

Problems with the execution of the setFields utility.
 
Hi

I have problems with the execution of the setFields utility in the shocktube tutorial. (i have the same problem in the dambreak tutorial. For this one, i have consulted the OpenFOAM guide, but gets the same error message as in the shocktube tutorial).

After i have executed setFields, i get the following error message for the shocktube:


Usage: setFields [-latestTime] [-time ranges] [-parallel] [-constant] [-noZero] [-case dir] [-help] [-doc] [-srcDoc]



--> FOAM FATAL ERROR:
Wrong number of arguments, expected 0 found 2


FOAM exiting



The setFieldsDict file looks like:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues ( volVectorFieldValue U ( 0 0 0 ) volScalarFieldValue T 348.432 volScalarFieldValue p 100000 );

regions ( boxToCell { box ( 0 -1 -1 ) ( 5 1 1 ) ; fieldValues ( volScalarFieldValue T 278.746 volScalarFieldValue p 10000 ) ; } );


// ************************************************** *********************** //


I am looking for a detailed step by step solution for this problem.

From my point of view, it sounds like it is very straight forward to execute the setFields utility , but obviously not, i can not manage it. I am not good in openFoam programming nor experienced in this software.

Any help is deeply appreciated :)

Alex

kwardle November 2, 2011 12:15

Take a look at the error. It says you called setFields wrong. If you are setting the fields in your 0 directory (assuming it exists and all the field files are there). You should need no arguments for setFields. Just run `setFields` and you are golden.
-Kent

foamer November 9, 2011 06:27

Thank`s Kent

I found that is was enough to spell the "setFields" command and not "setFields . shocktube" :P

Its running now.

camille131 June 3, 2013 09:42

Dear,
is it possible to impose a Temerature with setFields for a while?

For example I d like to ignite a mixture in reactingFoam by setting up a temperature field, after a few diffusion has occured, and maintain the temperature a few time steps such that the mixture ignite.

Thanks

Cam

kwardle June 3, 2013 11:57

Nope, not with setFields---it is used only for setting the initial condition on your fields. I suppose you could run it for "a while" and then reinitialize the temperature with setFields at the latestTime, but I don't think that is what you are going for. There are other ways to do what you ask and other threads in the forum which discuss this.

camille131 June 3, 2013 12:24

Well thank you for your response :-)

Do you know what should be the length and height of a patch tu simulate a spark? (my chamber is 40 cm long and has a diameter of 28 cm) .
I m trying different scales but it s not easy to find the right one.. at the beginning (at t=0.05) I put the T set at 810 K and it rises till 2300 K .

That seems ok for premixed CH4 combustion at stoechiometry. But the CH4 flow semms interrupted..


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