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

0/T file magically changes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2018, 14:58
Default 0/T file magically changes
  #1
New Member
 
Robbe
Join Date: Apr 2018
Posts: 3
Rep Power: 8
robbedoes is on a distinguished road
Hi fellow foamers

First of all, I am still new to OpenFOAM, so hopefully I am not making an obvious mistake here... Any suggestions are much appreciated

I am using reactingFoam (OF v5) to simulate fuel injection in a constant volume chamber filled with air, starting from the DLR_A_LTS tutorial. I set up the boundary conditions similarly to the article of Som (2012), resulting in an initial chamber temperature of 1000 K. As boundary conditions, I used an injection temperature of 373 K at the injector orifice, and a zeroGradient at the walls of the domain. Currently I have no outlet, as I would like to study the interaction of the fuel with the walls. I specified all values in the T file and copied it to T.orig such that both are exactly the same.

Then, when I try to run the simulation, I see that (out of nowhere) the T file is replaced and the value for the initial conditions are replaced with the fuel temperature (so from 1000 K to 373 K)! As a consequence, my entire temperature field in paraview is not what it should be... The weird thing is that the T.orig file is still the same. I checked the Allrun file and took out the line that copies T.orig, but it did not change anything. Does someone have an idea of what's happening here? Also, could someone point out why exactly there exists an .orig file for temperature, but not for p and U for example.

Thanks in advance, and have a nice weekend!
Robbe

P.S.: For clarification, I included both the T files. The first one I made, the second one appeared after the simulation.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 1000;

boundaryField
{
    injector
    {
        type            fixedValue;
        value           uniform 373;
    }
    walls
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       volScalarField;
    location    "0";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 373;

boundaryField
{
    walls
    {
        type            zeroGradient;
    }
}

// ************************************************************************* //
robbedoes is offline   Reply With Quote

Old   April 14, 2018, 01:02
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
There is a setfields command in the allrun file. Check that.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 16, 2018, 15:49
Default
  #3
New Member
 
Robbe
Join Date: Apr 2018
Posts: 3
Rep Power: 8
robbedoes is on a distinguished road
Quote:
Originally Posted by piu58 View Post
There is a setfields command in the allrun file. Check that.
Hi Uwe

Thanks for your answer. That did the trick!

Could you (or someone else) please elaborate a bit on the meaning of the setFieldsDict file? If I understand correctly, I have already set the initial value of the field in the T file, so why exactly do I need to specify it again? Also, why don't the pressure and velocity need such an additional entry in setFieldsDict?

Thanks again.

Robbe
robbedoes is offline   Reply With Quote

Old   April 17, 2018, 00:12
Default
  #4
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Setfileds is not necessary in closer sense. You may always set the filed in the 0/T file in your example.
Setfields hels to set a filed independend from te mesh. If you use a finer mesh, simply by changing some hex commands, a
Code:
value nonuniform List<scalar>
command needs to be changed. With setfields you may avoid this.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Reply


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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 21:53
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 towanda OpenFOAM Community Contributions 6 September 5, 2015 21:03
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


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