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

Using a variable (increasing) inlet to get an easy convergence/initialization ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2013, 03:32
Default Using a variable (increasing) inlet to get an easy convergence/initialization ?
  #1
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
Dear all,
I'm running some simulations with rhoSimplecFoam (k-epsilon, Air) and I encounter some convergence / initialization problems. I mostly run my case at Mach 0.3 and 0.4 and I often get divergence even with simple geometries such as Naca Airfoils or Cylinders.

I tried different techniques:
- initialize the flow with a potentialFoam
- initialize the velocity internalField at different speed (0 to 80m/s)
- play with the under relaxation numbers ...
- using upwind scheme
- use different meshes (structured, unstructured, yPlus from 0.1 to 30,...)

After many tries, I found that a good way to avoid divergence and get convergence is to slowly increase the inlet velocity value ! For example, I start at 2m/s, then 5m/s, then 10m/s and so on until the actual velocity. However, this technique is "slow" and requires some manual change.

First, is this "initialization" ok ? I mean, I didn't see anybody using such a technique, maybe there is a problem I don't know about.

Second, is there a way to make this automatically ? I found this link but it looks old and unusable in OF2: http://www.idurun.com/?p=512

My inlet is:
Code:
alphat:
        type            calculated;
        value           uniform 0;

epsilon:
        type            fixedValue;
        value           uniform 2.15e-1;

k:
        type            fixedValue;
        value           uniform 1.6e-2;

mut:
        type            calculated;
        value           uniform 0;

p:
        type            zeroGradient;

T:
        type            fixedValue;
        value           uniform 281.4;

U:
        type            fixedValue;
        value           uniform (81.02 0 0);
My outlet is:
Code:
alphat:
        type            calculated;
        value           uniform 0;

epsilon:
        type            inletOutlet;
        inletValue     uniform 2.15e-1;
        value           uniform 2.15e-1;

k:
        type            inletOutlet;
        inletValue     uniform 1.6e-2;
        value           uniform 1.6e-2;

mut:
        type            calculated;
        value           uniform 0;

p:
        type            fixedValue;
        value           uniform 95650;

T:
        type            inletOutlet;
        inletValue     uniform 281.4;
        value           uniform 281.4;

U:
        type            inletOutlet;
        inletValue     uniform (81.02 0 0);
        value           uniform (81.02 0 0);
My wall is:
Code:
alphat: 
        type            alphatWallFunction;
        value           uniform 0;

epsilon:
        type            compressible::epsilonWallFunction;
        value           uniform 2.15e-1;

k:
        type            compressible::kqRWallFunction;
        value           uniform 1.6e-2;

mut:
        type            mutkWallFunction;
        value           uniform 0;

p:
        type            zeroGradient;

T:
        type            zeroGradient;

U:
        type            fixedValue;
        value           uniform (0 0 0);
My internalFiel is:
Code:
alphat:
        value           uniform 0;

epsilon:
        value           uniform 2.15e-1;

k:
        value           uniform 1.6e-2;

mut:
        value           uniform 0;

p:
        value           uniform 95650;

T:
        value           uniform 281.4;

U:
        value           uniform (81.02 0 0);
fredo490 is offline   Reply With Quote

Old   March 28, 2013, 10:04
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
hello,

Which field is diverging ? My guess would be turbulence model :
=> try turbulentIntensityKinetics... for k, and turbulentMixingLenght... for epsilon, and relax k,epsilon (if steady solver).

If you would to use a ramped velocity inlet, take a look at flowRateInletVelocity or uniformFixedValue, and specify a velocity changing in time (or iteration), like:
Code:
type uniformFixedValue;
uniformValue table
(
(0 (0 0 0))
(100 (100 0 0))
);
which start with 0 velocity at time 0, then grow to Ux=100m/s at time 100, and stay after that (since outOfBound clamp; is the default).

regards,
olivier
olivierG is offline   Reply With Quote

Old   March 28, 2013, 14:54
Default
  #3
Senior Member
 
JR22's Avatar
 
Jose Rey
Join Date: Oct 2012
Posts: 134
Rep Power: 18
JR22 will become famous soon enough
Look at the motorbike tutorial (Allrun), which uses potentialFoam to get the fields initially, then it runs the actual solver. Would this work for you?

MY BAD: You alread tried this.

Last edited by JR22; March 28, 2013 at 15:24.
JR22 is offline   Reply With Quote

Old   March 29, 2013, 04:23
Default
  #4
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
Thx Olivier for your advices.

0) the diverging field is most of the time the pressure that leads to a Floating Point Exception (caused by the thermo model).

1) I've tried to change my k and epsilon settings (inlet and relax number) but it doesn't change anything.

2) The technique of the Table works well but I need many steps to reach my final velocity.

3) I've also tried to use the flowRateInletVelocity inlet but it also often diverge after only 2 or 3 iterations (the pressure starts to diverge first). Moreover, using this kind of Inlet, I get some strange oscillation of the pressure/density through my domain. It's like a wave going from the inlet to the outlet and coming back (once my pressure inlet > pressure outlet and then two iteration later it is pressure inlet < pressure outlet and so on).
fredo490 is offline   Reply With Quote

Old   March 29, 2013, 06:00
Default
  #5
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
To make the things simple, here is my current case (3.8 MB) :
http://www.fredo490.fr/public/rhoSim...der_Vinlet.zip

It is a structured 4 inch cylinder at 81.02m/s (95650 Pa and 8.2°C).
fredo490 is offline   Reply With Quote

Old   April 2, 2013, 07:22
Default
  #6
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
hello,

You may try to modify the outlet BC:
-p : totalPressure
- U pressureInletOutletVelocity (or pressureInletVelocity / pressureDirectedInletVelocity / ...)

regards,
olivier
olivierG is offline   Reply With Quote

Old   April 2, 2013, 10:02
Default
  #7
Senior Member
 
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17
fredo490 is on a distinguished road
thx for your advice.

For those who want, I found a good source for the table inlet: http://www.openfoam.org/version2.1.0...conditions.php

Also, I found that using a "Laplacian schemes linear limited 0.5" helps a lot.
fredo490 is offline   Reply With Quote

Old   April 9, 2014, 09:01
Default
  #8
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
is it possible to use such table options for the SRF or MRF - options in order to increase the rotational speed?
Tobias Adam is offline   Reply With Quote

Old   April 9, 2014, 10:35
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well,

in case of MRF you can do it cause omega is defined as follows:

Code:
//- Angular velocty (rad/sec)
autoPtr<DataEntry<scalar> > omega_;
while in SRF there's no such possibility as RPM is defined as

Code:
//- Revolutions per minute
scalar rpm_;
Surely you can make your own SRFModel where RPM is simillar to omega in MRFModel.
alexeym 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
OpenFoam-1.6-ext Allwmake compilation error - one last barrier Pat84 OpenFOAM Installation 15 July 25, 2012 22:49
Turbulent flow through a pipe with variable inlet velocity lobstar OpenFOAM Running, Solving & CFD 8 March 28, 2012 12:15
Validation 12.1 vs 6.3, Difference in Reported Inlet Total Pressure jola FLUENT 1 May 5, 2011 15:33
Inlet table in STAR-CD Sachin Siemens 1 March 26, 2008 11:22
Variable velcity at inlet John FLUENT 1 April 7, 2003 12:34


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