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

buoyantPimpleFoam jet case diverges with the negative temperature

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By taban
  • 2 Post By dlahaye
  • 1 Post By dlahaye
  • 1 Post By taban

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2020, 03:53
Default buoyantPimpleFoam jet case diverges with the negative temperature
  #1
New Member
 
mahtab
Join Date: Nov 2014
Posts: 11
Rep Power: 11
taban is on a distinguished road
Hi,
I want to simulate 2-D transient mixed convection heat transfer of a jet discharging to a confined cavity. The turbulent model was set kOmegaSST. I had run the case in buoyantBoussinesqPimpleFoam with OpenFoam 6 and got a stable solution out but, if I try to buoyantPimpleFoam solver in OpenFOAM 8, after a few time steps, the solution diverges with the negative temperature error. I want to use this solver because I need to apply Boussinesq approximation and incompressible perfect gas as equations of state for the different cases. The grid of the computational domain was shown in Figure. The output from checkMesh was OK. I checked out different schemes but they did not work. I think there is something wrong with pressure. I am new to compressible solvers and any help will be highly appreciated.
The BCs was attached in 0 folder and the other case setups were presented below:

** thermophysicalProperties:
Quote:
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo eConst;
equationOfState Boussinesq;
specie specie;
energy sensibleInternalEnergy;
}

mixture
{
specie
{
molWeight 28.9;
}
equationOfState
{
rho0 1;
T0 300;
beta 3e-03;
}
thermodynamics
{
Cv 712;
Hf 0;
}
transport
{
mu 1e-05;
Pr 0.7;
}
}
fvSchemes:
Quote:
ddtSchemes
{
default CrankNicolson 0.9;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind;
div(phi,e) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(phi,K) Gauss linear;
div(phi,Ekp) Gauss linear;
div(R) Gauss linear;
div(phi,omega) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(phiv,p) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

wallDist
{
method meshWave;
}

fvSolution:

Quote:
solvers
{
"rho.*"
{
solver diagonal;

}

p_rgh
{
solver GAMG;
smoother DIC;
tolerance 1e-6;
relTol 0.01;
}

p_rghFinal
{
$p_rgh;
relTol 0;
}

"(U|h|e|k|epsilon|omega|R)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0.01;
}

"(U|h|e|k|epsilon|omega|R)Final"
{
$U;
relTol 0;
}
}

PIMPLE

{
nOuterCorrectors 200; //Outer loops (pressure-momentum correction)
nCorrectors 2; //Inner loops (pressure correction)

outerCorrectorResidualControl
{

P
{
relTol 0;

tolerance 5e-5;
}

U
{
relTol 0;

tolerance 5e-5;
}

}
}

relaxationFactors
{

fields
{
p 0.3; //
pFinal 0.3; //last outer loop
}

equations
{
U 0.4;
UFinal 0.4; //last outer loop
"(T|k|h|e|epsilon|R)" 0.4;
"(T|k|h|e|epsilon|R|omega)Final" 0.4;

}
}
ControlDict
Quote:
application buoyantPimpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 2;

deltaT 0.00001;

writeControl timeStep;

writeInterval 300;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

adjustTimeStep yes;

maxCo 1;
Thank you
Attached Images
File Type: png Figure 3.png (32.6 KB, 17 views)
Attached Files
File Type: zip 0.zip (5.1 KB, 2 views)
HappyS5 likes this.
taban is offline   Reply With Quote

Old   December 9, 2020, 05:12
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 723
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Does your case convergence by limiting T and/or U?

limit temperature (https://www.openfoam.com/documentati...mperature.html), (especially this on) and velocity (https://www.openfoam.com/documentati...-velocity.html) using settings in fvOptions dictionary;
taban and HappyS5 like this.
dlahaye is offline   Reply With Quote

Old   December 10, 2020, 03:39
Default
  #3
New Member
 
mahtab
Join Date: Nov 2014
Posts: 11
Rep Power: 11
taban is on a distinguished road
Thanks for the reply. As you mentioned, I used fvOptions for limiting temperature and velocity but after few time steps, the pimple didn't converge within 200 iterations. The following was written at the beginning of the log file:
Quote:
Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type limitTemperature
Source: limitT
- selecting all cells
- selected 26650 cell(s) with volume 0.02
Selecting finite volume options model type limitVelocity
Source: limitU
- selecting all cells
- selected 26650 cell(s) with volume 0.02
Maybe the limitation didn't work because nothing was written in log file about the min/max temperature. As the sample in one time step:
Quote:

Courant Number mean: 0.00238817 max: 0.134812
deltaT = 2.0736e-05
Time = 6.4416e-05

PIMPLE: Iteration 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCGStab: Solving for Ux, Initial residual = 0.17658, Final residual = 3.60574e-05, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.212657, Final residual = 4.73067e-05, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.022711, Final residual = 2.11054e-07, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.0206422, Final residual = 0.000155762, No Iterations 11
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 9.84653e-08, global = 4.43905e-08, cumulative = 5.95705e-06
GAMG: Solving for p_rgh, Initial residual = 0.000178929, Final residual = 3.6506e-07, No Iterations 8
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 7.68786e-10, global = 7.35098e-11, cumulative = 5.95712e-06
PIMPLE: Iteration 2
DILUPBiCGStab: Solving for Ux, Initial residual = 0.227452, Final residual = 1.03182e-05, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.191036, Final residual = 2.16332e-05, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.0204513, Final residual = 4.84886e-08, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.00379843, Final residual = 2.81562e-05, No Iterations 8
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.89981e-08, global = 1.09843e-08, cumulative = 5.96811e-06
GAMG: Solving for p_rgh, Initial residual = 0.000629444, Final residual = 5.29463e-07, No Iterations 9
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.6159e-10, global = -1.28173e-11, cumulative = 5.96809e-06
PIMPLE: Iteration 3
DILUPBiCGStab: Solving for Ux, Initial residual = 0.0940387, Final residual = 1.61607e-06, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.131922, Final residual = 1.46427e-06, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.00535449, Final residual = 6.0974e-08, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.0051468, Final residual = 2.60118e-05, No Iterations 8
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 7.96289e-09, global = -1.21097e-09, cumulative = 5.96688e-06
GAMG: Solving for p_rgh, Initial residual = 5.29953e-05, Final residual = 6.97312e-07, No Iterations 5
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 3.9053e-10, global = 8.75014e-11, cumulative = 5.96697e-06
PIMPLE: Iteration 4
DILUPBiCGStab: Solving for Ux, Initial residual = 0.029834, Final residual = 7.28265e-07, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.0346117, Final residual = 1.58444e-06, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.00148732, Final residual = 1.61901e-08, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.00115918, Final residual = 4.64649e-06, No Iterations 8
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.59857e-09, global = -4.65078e-10, cumulative = 5.9665e-06
GAMG: Solving for p_rgh, Initial residual = 1.4396e-05, Final residual = 7.96018e-07, No Iterations 3
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.14664e-10, global = 1.98737e-10, cumulative = 5.9667e-06
PIMPLE: Iteration 5
DILUPBiCGStab: Solving for Ux, Initial residual = 0.00835071, Final residual = 2.48594e-07, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.00969872, Final residual = 3.0312e-07, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.000440338, Final residual = 2.18217e-09, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.000325922, Final residual = 1.61729e-06, No Iterations 8
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.04523e-09, global = -2.17603e-10, cumulative = 5.96649e-06
GAMG: Solving for p_rgh, Initial residual = 4.47355e-06, Final residual = 6.19601e-07, No Iterations 2
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 4.15933e-10, global = -1.32607e-10, cumulative = 5.96635e-06
PIMPLE: Iteration 6
DILUPBiCGStab: Solving for Ux, Initial residual = 0.00219789, Final residual = 5.50801e-08, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.00282701, Final residual = 3.90842e-08, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.000141649, Final residual = 2.34357e-09, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 0.000136829, Final residual = 1.30687e-06, No Iterations 6
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 8.77158e-10, global = -2.39752e-10, cumulative = 5.96611e-06
GAMG: Solving for p_rgh, Initial residual = 1.91224e-06, Final residual = 9.5513e-07, No Iterations 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.47261e-10, global = 2.56184e-10, cumulative = 5.96637e-06
PIMPLE: Iteration 7
DILUPBiCGStab: Solving for Ux, Initial residual = 0.000569046, Final residual = 1.39007e-08, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.000899099, Final residual = 4.39111e-08, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 4.42844e-05, Final residual = 1.07591e-09, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 6.24635e-05, Final residual = 8.45957e-07, No Iterations 4
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.73266e-10, global = -1.75868e-10, cumulative = 5.96619e-06
GAMG: Solving for p_rgh, Initial residual = 9.44909e-07, Final residual = 9.44909e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.41793e-10, global = -1.72826e-10, cumulative = 5.96602e-06
PIMPLE: Iteration 8
DILUPBiCGStab: Solving for Ux, Initial residual = 0.000156327, Final residual = 5.30874e-09, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.000298478, Final residual = 2.78122e-08, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 1.45116e-05, Final residual = 3.35323e-10, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 2.86466e-05, Final residual = 3.8733e-07, No Iterations 4
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.63074e-10, global = -4.05656e-11, cumulative = 5.96598e-06
GAMG: Solving for p_rgh, Initial residual = 4.0582e-07, Final residual = 4.0582e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.75802e-10, global = -3.9418e-11, cumulative = 5.96594e-06
PIMPLE: Iteration 9
DILUPBiCGStab: Solving for Ux, Initial residual = 4.16799e-05, Final residual = 3.73823e-09, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 9.83481e-05, Final residual = 1.20284e-08, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 4.10233e-06, Final residual = 9.04667e-11, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 1.36932e-05, Final residual = 5.97099e-07, No Iterations 2
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 4.05796e-10, global = -6.17554e-11, cumulative = 5.96588e-06
GAMG: Solving for p_rgh, Initial residual = 6.01839e-07, Final residual = 6.01839e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 4.09058e-10, global = -6.17691e-11, cumulative = 5.96582e-06
PIMPLE: Iteration 10
DILUPBiCGStab: Solving for Ux, Initial residual = 1.41778e-05, Final residual = 1.95432e-09, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 3.84989e-05, Final residual = 4.54547e-09, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 1.67477e-06, Final residual = 3.76822e-10, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 7.28163e-06, Final residual = 8.71983e-07, No Iterations 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.92667e-10, global = 3.91096e-11, cumulative = 5.96586e-06
GAMG: Solving for p_rgh, Initial residual = 8.73635e-07, Final residual = 8.73635e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.93807e-10, global = 3.92224e-11, cumulative = 5.9659e-06
PIMPLE: Converged
Doing final iteration
PIMPLE: Iteration 11
DILUPBiCGStab: Solving for Ux, Initial residual = 5.8758e-06, Final residual = 1.02998e-09, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 1.88933e-05, Final residual = 2.20091e-09, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 1.52782e-06, Final residual = 7.0056e-10, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 4.49699e-06, Final residual = 7.43966e-07, No Iterations 1
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.05671e-10, global = -9.26576e-11, cumulative = 5.9658e-06
GAMG: Solving for p_rgh, Initial residual = 7.4774e-07, Final residual = 7.4774e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.08241e-10, global = -9.28311e-11, cumulative = 5.96571e-06
DILUPBiCGStab: Solving for omega, Initial residual = 0.00102852, Final residual = 1.52599e-09, No Iterations 1
DILUPBiCGStab: Solving for k, Initial residual = 0.0527983, Final residual = 8.31523e-08, No Iterations 1
PIMPLE: Converged in 11 iterations
ExecutionTime = 177 s ClockTime = 712 s
How do I know if the limitation is running well? Is there an other suggestion?
taban is offline   Reply With Quote

Old   December 10, 2020, 12:23
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 723
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Look at fields inside of paraview or plot residual norms. See below.

Plotting the residual norm of various fields vs. iteration number
* write residual norms of the various fields to file instead of to screen. Do so using so-called unix pipe command, e.g., simpleFoam >& log.simpleFoam or use the runApplication utility instead (typically inside of Allrun);
* use foamLog utility to generate the the logs-directory in the case directory; foamLog runs a bunch of scripting commands to read data from the log-file and reorders the information in separate files;
* use gnuplot to load and plot the data in the logs-directory: in separate terminal run ./myplot. See sample myplot file below

Sample myplot file to plot residual norm vs. iteration number
#!/bin/bash

# Requires running foamLog <log-file> first!!

gnuplot -persist >/dev/null 2>&2 << EOF
set logscale y
plot "logs/UxFinalRes_0" with lines, \
"logs/UyFinalRes_0" with lines, \
"logs/UzFinalRes_0" with lines, \
"logs/pFinalRes_0" with lines, \
"logs/kFinalRes_0" with lines, \
"logs/epsilonFinalRes_0" with lines
HappyS5 likes this.
dlahaye is offline   Reply With Quote

Old   December 12, 2020, 01:15
Default
  #5
New Member
 
mahtab
Join Date: Nov 2014
Posts: 11
Rep Power: 11
taban is on a distinguished road
Thanks a lot. limiting T and U worked good and I don't get the error of the negative value of T. But I have divergence problems yet. Could you please check the boundary conditions and schemes that I used? Maybe they are wrong ��
I thank you a lot for your attention and help.
taban is offline   Reply With Quote

Old   December 13, 2020, 16:24
Default
  #6
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 723
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Write an extensive report with geometry, flow conditions, mesh used, solvers settings used and results obtained. It likely that doing so, you will find indications yourself. If not, I will happy to give your report a look.
dlahaye is offline   Reply With Quote

Old   December 14, 2020, 01:19
Default
  #7
New Member
 
mahtab
Join Date: Nov 2014
Posts: 11
Rep Power: 11
taban is on a distinguished road
Dear Domenico,
I will prepare the report and share it with you if there are any questions. Thanks for your kindness.
Mahtab
dlahaye likes this.
taban is offline   Reply With Quote

Reply

Tags
buoyantpimplefoam, negative temperature


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
negative initial temperature/ exceeded number of max. iteratons PSander OpenFOAM Running, Solving & CFD 0 July 12, 2020 12:37
Negative temperature T0 in sonicFoam OF 5.x deepbandivadekar OpenFOAM Running, Solving & CFD 8 August 20, 2018 09:40
Negative initial temperature T0 in wallboiling case of reactingTwoPhaseEulerFoam chengtun OpenFOAM Running, Solving & CFD 6 August 18, 2018 06:40
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 17:02.