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

OpenFoam 2.2 fvOptions temperature limits

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 5 Post By fredo490

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2013, 02:28
Default OpenFoam 2.2 fvOptions temperature limits
  #1
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
Dear all,
As some of you know, OF 2.2 introduce a new system of "fvOptions" files where we can set the porosity and so on...
There is another interesting command that is "temperatureLimitsConstraint". As its name says, it is used to constraint the temperature to a minimum and maximum value.

Because I didn't find any example online, here is my file:
You have to put it into the "fvOptions" file located in system
Code:
source1
{
    type            temperatureLimitsConstraint;
    selectionMode   all;
    active          true;

        temperatureLimitsConstraintCoeffs
        {
            Tmin     220;
            Tmax     270;
        }
}
This command will bound the temperature between 220K and 270K in all the domain. It is useful in some cases if your compressible solver can't catch the value temperature value during the first iterations.

Edit: the page description come from here: http://www.openfoam.org/version2.2.0/fvOptions.php
nsf, andrejssab, DanielFB and 2 others like this.
fredo490 is offline   Reply With Quote

Old   July 11, 2013, 15:39
Default
  #2
New Member
 
Hann Mao
Join Date: Jul 2013
Posts: 2
Rep Power: 0
hsmao is on a distinguished road
Thanks for the tip!

Does this work for all compressible solvers? I tried adding this to sonicFoam and it seems to get ignored.
hsmao is offline   Reply With Quote

Old   July 11, 2013, 18:49
Default
  #3
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
As I remember, sonic foam is mostly hard coded so it might not work.
To check, find the thermo equation in the source code and check if you can find a line with "+ fvoptions" or something similar.
fredo490 is offline   Reply With Quote

Old   July 11, 2013, 22:10
Default
  #4
ksv
New Member
 
ksv
Join Date: Feb 2011
Posts: 16
Rep Power: 15
ksv is on a distinguished road
Hi Fredo,
Thanks for your tip. May i know whether there exists similar options to control turbulent kinetic energy k and epsilon?
ksv
ksv is offline   Reply With Quote

Old   July 12, 2013, 05:11
Default
  #5
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
For k, omega et epsilon, you can add a simple code such as:
Code:
	k= max(k, kMin);
	k= min(k, kMax);
where kMin and kMax can be defined in the code or by a dimensionedScalar and a IOdictionary.

We must use fOption for T because T is not a variable used by OpenFoam. The function "fOption" actually modify the thermo equation (enthalpy) to correct the temperature.
fredo490 is offline   Reply With Quote

Old   April 30, 2014, 07:19
Default
  #6
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Hi all,

sorry for re-opening this thread but I'm using the temperatureLimitsConstraint in conjunction with chtMultiRegionFoam (OF-2.2.x, latest available update) and it actually doesn't seem to me it's working as it is supposed to. The fvOptions dict appears to be read properly, but when the enthalpy equation is solved the temperature violates the imposed bounds, even if all the discretization schemes should be bounded/limited. Here there are my fvSchemes and fvOptions dictionaries (there is only one fluid region at this stage), together with an extract of runtime output log.

fvSchemes:
Code:
ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         cellMDLimited Gauss linear 1;
    grad(U)         cellMDLimited Gauss linear 0.5;
    //grad(h)         faceLimited Gauss linear 1;
    
}

divSchemes
{
    default        none;
    div(phi,U)      bounded Gauss linearUpwindV grad(U);
    div(phi,K)      bounded Gauss linear;
    div(phi,h)      bounded Gauss limitedGamma 1 264157 294289; 
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(R)          Gauss linear;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(muEff,U) Gauss linear limited 0.333;
    laplacian(Dp,p_rgh) Gauss linear limited 0.333;
    laplacian(alphaEff,h) Gauss linear limited 0.333;
    laplacian(DkEff,k) Gauss linear limited 0.333;
    laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         limited 0.333;
}

fluxRequired
{
    default         no;
    p_rgh;
}
fvOptions:
Code:
temperature_constraints
{
    type          temperatureLimitsConstraint;
    active        yes;
    selectionMode cellZone;
    cellZone      fluid;
    
        temperatureLimitsConstraintCoeffs
        {
            Tmin     263;
            Tmax     293;
        }
        
}
log:
Code:
Region: fluid Courant Number mean: 1.4132369e-05 max: 0.98128545
deltaT = 2.381967e-05
Time = 0.000100306


Solving for fluid region fluid
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 0.00081227894, Final residual = 1.6049071e-07, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.07792845, Final residual = 1.8250737e-05, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.0014009406, Final residual = 3.9984243e-07, No Iterations 1
DILUPBiCG:  Solving for h, Initial residual = 0.000399081, Final residual = 8.990734e-08, No Iterations 1
Min/max T:262.29196 299.81974
Min/max rho:1.1716795 1.347332
GAMG:  Solving for p_rgh, Initial residual = 0.0007644805, Final residual = 1.345729e-05, No Iterations 3
GAMG:  Solving for p_rgh, Initial residual = 6.2938682e-05, Final residual = 1.757067e-06, No Iterations 2
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors (fluid): sum local = 3.6194871e-09, global = -1.1723455e-09, cumulative = 9.1079573e-09
Min/max rho:1.1709893 1.3499513
GAMG:  Solving for p_rgh, Initial residual = 1.1436979e-05, Final residual = 3.3044886e-07, No Iterations 2
GAMG:  Solving for p_rgh, Initial residual = 2.5426255e-06, Final residual = 4.4810886e-08, No Iterations 2
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors (fluid): sum local = 9.2017652e-11, global = -1.1644798e-11, cumulative = 9.0963125e-09
DILUPBiCG:  Solving for epsilon, Initial residual = 4.9736441e-05, Final residual = 2.2259148e-08, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 8.5244714e-13, Final residual = 1.2977543e-16, No Iterations 1
bounding k, min: 4.9998752e-16 max: 1.15 average: 0.0022126182
Any comments about this?

V.
vkrastev is offline   Reply With Quote

Old   July 15, 2014, 16:08
Default
  #7
New Member
 
Charles McCreary
Join Date: Jun 2010
Posts: 12
Rep Power: 16
crmccreary is on a distinguished road
Typically in a CHT analysis, the system directory will have subdirectories for each region. Did you put the fvOptions file in the relevant subdirectory? Also, at the top of the log file, OpenFOAM will tell you what it has read from the fvOptions file.

*UPDATE*
Same behavior here. Doesn't seem to limit the temperature at all.

Last edited by crmccreary; July 15, 2014 at 16:25. Reason: update
crmccreary is offline   Reply With Quote

Old   July 15, 2014, 16:57
Default
  #8
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by crmccreary View Post
Did you put the fvOptions file in the relevant subdirectory?
Yes.



Quote:
Originally Posted by crmccreary View Post
*UPDATE*
Same behavior here. Doesn't seem to limit the temperature at all.
Well, in my case the wrong max/min temperatures in the domain appeared to be related to the externalWallHeatFluxTemperature boundary condition, which is evidently affected by some bad implementation issue in the OF-2.2.x branch and goes always unstable unless an EXTREMELY fine near wall grid is arranged (I've checked this behavior for a simple 2D buoyancy driven cavity flow, see this tread for further details: http://www.cfd-online.com/Forums/ope...tml#post496092 ). Regarding the fvOptions temperature constraint, I haven't investigated it any further so I cannot add more useful information about it.

Best

V.
vkrastev is offline   Reply With Quote

Old   July 15, 2014, 17:33
Default
  #9
New Member
 
Charles McCreary
Join Date: Jun 2010
Posts: 12
Rep Power: 16
crmccreary is on a distinguished road
I was using the 2.3.x branch. Temperature in the solid blows up, not obeying the fvOptions limit. I suspect that, for some reason, diffusion at the boundary becomes zero thus zero heat flux at the boundary and the applied heat flux (fixed gradient on the solid) yields a near infinite temperature on the solid. Just a guess.
crmccreary is offline   Reply With Quote

Old   December 30, 2014, 09:27
Default
  #10
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13
derekm is on a distinguished road
THis does work in chtMultiRegionSimpleFoam in V2.3.1


in conjunction with scalarSemiImplicitSource
to construct a heat source limited by temperature


the comment in header file gives the wrong names for the coeffs it is Tmin and Tmax
not maximum and minimum.
Code:
   Temperaturelimit1
         {
        type            temperatureLimitsConstraint;
        active          true;
        selectionMode   all;
        
     temperatureLimitsConstraintCoeffs
        {
            Tmin     200;
            Tmax     340;
        }    
        
     }    
    energySource1
    {
        type            scalarSemiImplicitSource;
        active          true;
        
        selectionMode   all;
    
       
        scalarSemiImplicitSourceCoeffs
        {
            volumeMode      specific;
            injectionRateSuSp
            {
                h           (  20000 0 ); // 2e4 = 20w/litre
            }
        }
    }
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   August 27, 2018, 05:56
Default
  #11
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Adding a fvOptions file in system folder with :

Code:
temperatureLimit
{
    type limitTemperature;
    active true;

    limitTemperatureCoeffs
    {
        selectionMode all;
        min <Tmin>;
        max <Tmax>;
    }
}
seems to resolve the issue.
foadsf is offline   Reply With Quote

Old   December 16, 2019, 16:07
Default
  #12
Member
 
Thomas
Join Date: Nov 2017
Posts: 37
Rep Power: 9
hand90 is on a distinguished road
Hi everyone

My simulation in OF v1806 using rhoSimpleFoam crashed after very few iterations due to divergence in temperature. After limiting the temperature the solver runs very well.
Now the same simulation has a very similar behaviour in foam-extend 4.0 when using dbnsTurbFoam. When I tried to apply limits I realised that fvOptions is not available in the foam-extend version. Does anyone know a work around or how I can apply limits?
Many thanks.
hand90 is offline   Reply With Quote

Old   January 17, 2020, 00:59
Default Limit temperature within the inner loop?
  #13
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 8
sjohn2 is on a distinguished road
Is there a way to limit temperature within the inner loop?

My temparature blows up within a loop?

I am also interested in limiting the temperature for another variable interface temperature Tf? Anybody having any ideas?
I am using interfacecomposition model in reactingTwoPhaseEulerFoam?

Thanks
Stanley
sjohn2 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Is wall ajacent temperature equal to conservative temperature of the wall? shenying0710 CFX 8 January 4, 2013 05:03
Free stream temperature in tube wall saharesobh FLUENT 2 November 19, 2012 08:32
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
The OpenFOAM extensions project mbeaudoin OpenFOAM 16 October 9, 2007 10:33
chemical reaction - decompostition La S. Hyuck CFX 1 May 23, 2001 01:07


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