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

interFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2010, 12:23
Default interFoam
  #1
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
Hello,
I'd like to simulate a rotating gear system into oil. I choose the solver interFoam.
U: I compiled new BC to set a ramp of velocity of rotation (timeVaryingRotatingWallVelocity) for my rotating elements (http://www.cfd-online.com/Forums/ope...edvalue.html);
p: I used the totalPressure for the atmosphere patch and zeroGradient for all other walls and rotating element;
k-epsilon model for the turbulence.
First I tried with epsilon = 100 and my simulation died after 0.06 seconds.
Then I increased the value of epsilon = 1000 and my simulation died at 0.84 seconds.
I attached the plots of residuals and Courant number.
You can see that in the end of simulation k and epsilon start increasing very fast and bring the calculation to die in a very little time!

Now I'm thinking to run new analysis increasing the value of epsilon, but before I have some question:
1) Is it correct use k-epsilon for rotating element?
2) If yes, how can calculate the correct value of k and epsilon without find it by tentative? I try to use the formulas that are in OF user guide but I don't know how can use them with rotating elements or if are correct for rotating elements

Thanks anyone for any suggestion

Andrea
Attached Images
File Type: jpg res.JPG (40.7 KB, 118 views)
File Type: jpg Co.JPG (36.7 KB, 78 views)
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   May 10, 2010, 10:19
Default
  #2
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
Hello I spent much time about my case,
I think I improved my analysis but I'm still far to obtain the correct solution.
The problem is I cannot extend the analysis longer than 1.04 sec.
I want explain my problem:
- My run looks good until 1.04 sec (it has "just" buonding k from 0.5 sec). I used ramp of velocity until 0.25 sec. You can see the residuals in the pictures I attached.
- Suddenly the calculation crash! I can see in the error message the rown "floating point exception".
- So, how I found in http://www.cfd-online.com/Forums/ope...implefoam.html , I commented the row //export FOAM_SIGFPE= in etc/bashrc file.
- Then I restart the analysis from 1.04 and this is what I obtain:
Quote:
Courant Number mean: 0.0222972 max: 0.895581
deltaT = 0.000163178
Time = 1.05054

MULES: Solving for alpha1
Liquid phase volume fraction = 0.194044 Min(alpha1) = -1.51761e-20 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194043 Min(alpha1) = -1.54389e-20 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194043 Min(alpha1) = -1.70812e-21 Max(alpha1) = 1
GAMG: Solving for p, Initial residual = 0.0650721, Final residual = 9.71882e-08, No Iterations 22
GAMG: Solving for p, Initial residual = 0.0147061, Final residual = 9.55896e-08, No Iterations 20
GAMGPCG: Solving for p, Initial residual = 0.00283393, Final residual = 2.7137e-08, No Iterations 7
time step continuity errors : sum local = 2.74705e-11, global = 4.61938e-13, cumulative = -1.65011e-11
smoothSolver: Solving for omega, Initial residual = 0.0012319, Final residual = 3.73989e-07, No Iterations 6
smoothSolver: Solving for k, Initial residual = 0.000760956, Final residual = 9.41354e-07, No Iterations 14
bounding k, min: 7.9354e-16 max: 100 average: 0.209985
ExecutionTime = 4141.07 s ClockTime = 4166 s

Courant Number mean: 0.0222973 max: 0.898009
deltaT = 0.000163178
Time = 1.0507

MULES: Solving for alpha1
Liquid phase volume fraction = 0.194043 Min(alpha1) = -1.85544e-20 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194042 Min(alpha1) = -1.56878e-21 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194042 Min(alpha1) = -6.60323e-21 Max(alpha1) = 1
GAMG: Solving for p, Initial residual = 0.0651744, Final residual = 5.8543e+44, No Iterations 1000
GAMG: Solving for p, Initial residual = 1, Final residual = 2.10904e+42, No Iterations 1000
GAMGPCG: Solving for p: solution singularity
time step continuity errors : sum local = 2.54116e+222, global = 2.54116e+222, cumulative = 2.54116e+222
smoothSolver: Solving for omega, Initial residual = nan, Final residual = nan, No Iterations 1000
smoothSolver: Solving for k, Initial residual = nan, Final residual = nan, No Iterations 1000
ExecutionTime = 5874.96 s ClockTime = 5900 s

Courant Number mean: 1.30829e+117 max: 1.25004e+229
deltaT = 2.34969e-234
Time = 1.0507

MULES: Solving for alpha1
Liquid phase volume fraction = 0.194042 Min(alpha1) = -6.60323e-21 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194042 Min(alpha1) = -6.60323e-21 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.194042 Min(alpha1) = -6.60323e-21 Max(alpha1) = 1
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMGPCG: Solving for p: solution singularity
time step continuity errors : sum local = nan, global = nan, cumulative = nan
smoothSolver: Solving for omega, Initial residual = nan, Final residual = nan, No Iterations 1000

...
I think this is very stange.
Just in 1 iteration the p equation in the 2^ loop is not solved and in 3^ loop has "solution singulatiy", the time step continuity error grows up and I have "not a number" in k and epsilon!!!

Can anyone explain this?
Why I have this error?

Thanks

Andrea
Attached Images
File Type: png k-omega.png (18.8 KB, 49 views)
File Type: png p.png (23.0 KB, 45 views)
__________________
Andrea Pasquali

Last edited by andrea.pasquali; May 10, 2010 at 10:44.
andrea.pasquali is offline   Reply With Quote

Old   May 29, 2010, 10:36
Default
  #3
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
Hello,
I'm still trying with my model and with interFoam.

Now I try the BC "buoyantPressure" in p file for each patch, like in interFoam tutorial, instead of "zeroGradient".
If you see the alpha1 plot (attached) you can see that for "zeroGradient" alpha1 decrease, for "buoyantPressure" is costant (my model is a closed volume, no inlet no outlet and the liquid can't exit from the atmosphere patch).

I can't understand why...
The buoyantPressure BC is not for thermal analysis or where the density change?
Could anyone help me?

Thanks

Andrea
Attached Images
File Type: png alpha1_p_zeroGradient.png (14.7 KB, 44 views)
File Type: png alpha1_p_buoyantPressure.png (13.7 KB, 32 views)
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   May 30, 2010, 09:50
Default
  #4
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
The solving for alpha is okay. It is high likely that you face a convection-dominace. Have you tried or even applied flux limiter vor div(rho*phi,U) term? I not try as a guess limitedLinearV 1; Properly, this will avoid the blow up.

cheers
idrama is offline   Reply With Quote

Old   May 30, 2010, 09:52
Default
  #5
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
Addtionally, it seems that you carry out to less PISO loops. At this point in iteration, increase them to five. If you should have an orthogonal mesh then set non-Orthogonal-correction to zero otherwise 1 and try again.
idrama is offline   Reply With Quote

Old   May 30, 2010, 10:56
Default
  #6
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
Hi Claus,
thank you very much for your reply!

For div(rho*phi,U) I have "Gauss limitedLinearV 1"

For PISO loop I have:
nCorrectors 3
nNonOrthogonalCorrectors 0 --> This check is OK with checkMesh
nAlphaCorr 1
nAlphaSubCycles 3
cAlpha 1

Another thing, I saw the solution at 0.5 seconds:
with p zeroGradient I have a field from -1850 to +1880 Pa
with p buoyantPressure the field goes from -1850 to +3800 Pa

I don't know what is the correct way...
Can you help me?

Thanks

Andrea
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   May 30, 2010, 13:20
Default
  #7
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
At now, I don't know it either. Could you please post your p file and alpha1 file; i'd like to take a look!
idrama is offline   Reply With Quote

Old   May 30, 2010, 13:45
Default
  #8
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 16
andrea.pasquali is on a distinguished road
Hi Claus,
here "p"

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
shell
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}

walls
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}

shaft
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
bearingA
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
bearingB
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
differentialGear
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
wheel1
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
wheel2
{
type zeroGradient;
//type buoyantPressure;
//value uniform 0;
}
atmosphere
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}
}

// ************************************************** *********************** //
and here "alpha1"

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
shell
{
type zeroGradient;
}

walls
{
type zeroGradient;
}

shaft
{
type zeroGradient;
}
bearingA
{
type zeroGradient;
}
bearingB
{
type zeroGradient;
}
differentialGear
{
type zeroGradient;
}
wheel1
{
type zeroGradient;
}

wheel2
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
}

// ************************************************** *********************** //
For p BC I used first "zeroGradient" and then "buoyantPressure".

Thank you

Andrea
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   February 23, 2021, 13:06
Default residuals interfoam
  #9
Kil
New Member
 
Kil's Avatar
 
Serge
Join Date: Nov 2019
Posts: 22
Rep Power: 6
Kil is on a distinguished road
Hello every one!


I have use interFoam too and would like to plot residuals, Courant number and Y+.
Can you tell me how I may to make it correctly?
I red that there are many ways to do it, but i didn't understand none of them.
First of them is to use "foamMonitor" but in example there is only "p" and "u", but I need other residuals and Co and Y+.

Second way is to use "pyFoamPlotWatcher.py" but it didn't run on my system.I had get messages like "command not found". And also I don't understand how I can to save residuals in "logFile" when I using a script to run parallel interFoam....


Can anybody to help me on this theme?


P.S. I use Ubuntu 20.04.02 and OpenFoam 8 if it have a matter.
Kil 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
Getting a concentration field around a bubble in InterFoam azman OpenFOAM Running, Solving & CFD 3 June 7, 2022 05:21
interFoam / bubbleFoam to simulate an aerated tank Meratb OpenFOAM Running, Solving & CFD 3 November 6, 2020 12:45
InterFoam stops after deltaT goes to 1e14 francesco_b OpenFOAM Running, Solving & CFD 9 July 25, 2020 07:36
Interfoam... free surface simulation urgent lostin4ever Main CFD Forum 4 October 12, 2010 09:29
Open Channel Flow using InterFoam type solver sxhdhi OpenFOAM Running, Solving & CFD 3 May 5, 2009 22:58


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