CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to write k and epsilon before the abnormal end (https://www.cfd-online.com/Forums/openfoam-solving/59333-how-write-k-epsilon-before-abnormal-end.html)

xiuying November 4, 2007 20:53

Hi, I used turbFoam to simu
 
Hi,

I used turbFoam to simulate rough bed channel flow. But unluckly k and epsilon always blow up, So I want to check where they start to blow up and write k and epsilon before the running abnormaly end. Often the time is not the right writing time in controlDICT. Could you inform me how to del with this problem. Thank you.

Kang

guanghaowu November 4, 2007 23:05

Hi, Please try this one.
 
Hi,

Please try this one.

if ( runTime.value() > myOutputTime)
{
k.write();
epsilon.write();
}

myOutputTime is a scalar defined by you.

Best regards,

Guanghao

guanghaowu November 4, 2007 23:26

Sorry, the above is not correc
 
Sorry, the above is not correct. Please try this one.

if ( runTime.value() > myOutputTime)
{
turbulence->k()().write();
turbulence->epsilon()().write();
}

Best regards,
Guanghao

xiuying November 5, 2007 01:01

Hi,Guanghao, Thank you very
 
Hi,Guanghao,

Thank you very much. I will try and hope it is right.

Regards,

Kang

xiuying November 5, 2007 01:09

Hi, Guanghao, I don't know
 
Hi, Guanghao,

I don't know when the running will blow up if I only run once, so how can I defined the 'myOutputTime'?

Thanks,

Kang

guanghaowu November 5, 2007 01:36

Hi, Kang The 'turbulence-
 
Hi, Kang


The 'turbulence->k()().write()' writes k every time step. So you can define 'myOutputTime' at anytime before the running blows up. If you really dont know when the running will blow up, you also can define 'myOutputTimes' as follows.

scalar myOutputTime = runTime.startTime().value();

Best regards,
Guanghao

xiuying November 5, 2007 17:48

Hi,Guanghao, Thanks. I h
 
Hi,Guanghao,

Thanks.

I have an idea, but I don't know if it can solve the problem. The fowolling is my wrong information, and I found maybe the code will end if k or epsilon is more than a fixed value. If we know the end condition the code used, and add a if sentence in the code, maybe it is ok. But I can't find the condition. Could you inform me where I can look for it if you think that the method can work?

Regards,
Kang


Time = 5.83

Courant Number mean: 0.0345364 max: 0.190813
DILUPBiCG: Solving for Ux, Initial residual = 0.00774747, Final residual = 8.90592e-06, No Iterations 9
DILUPBiCG: Solving for Uy, Initial residual = 0.00319177, Final residual = 6.57778e-06, No Iterations 8
DICPCG: Solving for p, Initial residual = 0.319986, Final residual = 9.88754e-07, No Iterations 697
time step continuity errors : sum local = 2.24078e-10, global = 2.65278e-13, cumulative = -1.59313e-09
DICPCG: Solving for p, Initial residual = 0.20015, Final residual = 9.90866e-07, No Iterations 679
time step continuity errors : sum local = 2.32697e-10, global = 5.77903e-13, cumulative = -1.59255e-09
DICPCG: Solving for p, Initial residual = 0.0774551, Final residual = 9.97572e-07, No Iterations 501
time step continuity errors : sum local = 1.95112e-10, global = 2.35326e-11, cumulative = -1.56902e-09
DICPCG: Solving for p, Initial residual = 0.0388256, Final residual = 9.92122e-07, No Iterations 627
time step continuity errors : sum local = 1.77984e-10, global = 3.19297e-14, cumulative = -1.56899e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.000940395, Final residual = 3.73465e-07, No Iterations 3
DILUPBiCG: Solving for k, Initial residual = 0.0172775, Final residual = 6.25731e-06, No Iterations 3
ExecutionTime = 118780 s ClockTime = 119358 s

Time = 5.831

Courant Number mean: 0.0345742 max: 0.190779
DILUPBiCG: Solving for Ux, Initial residual = 0.0113025, Final residual = 8.3408e-06, No Iterations 10
DILUPBiCG: Solving for Uy, Initial residual = 0.00553431, Final residual = 2.9684e-06, No Iterations 11
DICPCG: Solving for p, Initial residual = 0.391736, Final residual = 9.54103e-07, No Iterations 709
time step continuity errors : sum local = 2.42537e-10, global = -8.1824e-13, cumulative = -1.56981e-09
DICPCG: Solving for p, Initial residual = 0.212333, Final residual = 9.52418e-07, No Iterations 684
time step continuity errors : sum local = 3.06617e-10, global = -1.00651e-13, cumulative = -1.56991e-09
DICPCG: Solving for p, Initial residual = 0.0901906, Final residual = 9.996e-07, No Iterations 659
time step continuity errors : sum local = 2.25075e-10, global = -2.46648e-12, cumulative = -1.57237e-09
DICPCG: Solving for p, Initial residual = 0.0458901, Final residual = 9.7918e-07, No Iterations 434
time step continuity errors : sum local = 1.91601e-10, global = -9.75956e-12, cumulative = -1.58213e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.00162013, Final residual = 1.25043e-06, No Iterations 3
DILUPBiCG: Solving for k, Initial residual = 0.0548768, Final residual = 1.83044e-06, No Iterations 4
ExecutionTime = 118841 s ClockTime = 119418 s

Time = 5.832

Courant Number mean: 0.0346212 max: 0.190765
DILUPBiCG: Solving for Ux, Initial residual = 0.0192159, Final residual = 8.35445e-06, No Iterations 12
DILUPBiCG: Solving for Uy, Initial residual = 0.0104381, Final residual = 5.76749e-06, No Iterations 12
DICPCG: Solving for p, Initial residual = 0.494688, Final residual = 9.91065e-07, No Iterations 727
time step continuity errors : sum local = 3.11251e-10, global = 1.46556e-12, cumulative = -1.58067e-09
DICPCG: Solving for p, Initial residual = 0.440631, Final residual = 9.61121e-07, No Iterations 703
time step continuity errors : sum local = 2.48548e-10, global = -6.22841e-13, cumulative = -1.58129e-09
DICPCG: Solving for p, Initial residual = 0.132117, Final residual = 9.84063e-07, No Iterations 672
time step continuity errors : sum local = 2.28168e-10, global = 1.17158e-12, cumulative = -1.58012e-09
DICPCG: Solving for p, Initial residual = 0.0621592, Final residual = 9.96793e-07, No Iterations 451
time step continuity errors : sum local = 2.09929e-10, global = 1.46393e-11, cumulative = -1.56548e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.00599364, Final residual = 4.37729e-06, No Iterations 3
DILUPBiCG: Solving for k, Initial residual = 0.159185, Final residual = 5.23693e-06, No Iterations 4
ExecutionTime = 118904 s ClockTime = 119481 s

Time = 5.833

Courant Number mean: 0.0346847 max: 0.249257
DILUPBiCG: Solving for Ux, Initial residual = 0.0395999, Final residual = 5.73738e-06, No Iterations 15
DILUPBiCG: Solving for Uy, Initial residual = 0.0245804, Final residual = 6.08565e-06, No Iterations 15
DICPCG: Solving for p, Initial residual = 0.637416, Final residual = 9.91404e-07, No Iterations 741
time step continuity errors : sum local = 4.41093e-10, global = -3.76949e-12, cumulative = -1.56925e-09
DICPCG: Solving for p, Initial residual = 0.248487, Final residual = 9.56449e-07, No Iterations 695
time step continuity errors : sum local = 8.57304e-10, global = -6.22879e-13, cumulative = -1.56987e-09
DICPCG: Solving for p, Initial residual = 0.139874, Final residual = 9.7751e-07, No Iterations 674
time step continuity errors : sum local = 3.81153e-10, global = -1.60878e-12, cumulative = -1.57148e-09
DICPCG: Solving for p, Initial residual = 0.080979, Final residual = 9.88537e-07, No Iterations 458
time step continuity errors : sum local = 2.83428e-10, global = -2.14408e-11, cumulative = -1.59292e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.0369994, Final residual = 1.84492e-06, No Iterations 4
bounding epsilon, min: -7.10899e-06 max: 0.222664 average: 0.00197161
DILUPBiCG: Solving for k, Initial residual = 0.33783, Final residual = 9.61397e-06, No Iterations 4
ExecutionTime = 118967 s ClockTime = 119544 s

Time = 5.834

Courant Number mean: 0.0348223 max: 0.410566
DILUPBiCG: Solving for Ux, Initial residual = 0.0962465, Final residual = 4.13868e-06, No Iterations 19
DILUPBiCG: Solving for Uy, Initial residual = 0.0628333, Final residual = 6.79441e-06, No Iterations 19
DICPCG: Solving for p, Initial residual = 0.794087, Final residual = 9.78426e-07, No Iterations 751
time step continuity errors : sum local = 8.66254e-10, global = 7.53316e-12, cumulative = -1.58539e-09
DICPCG: Solving for p, Initial residual = 0.223529, Final residual = 9.59442e-07, No Iterations 695
time step continuity errors : sum local = 2.54205e-09, global = 5.26992e-12, cumulative = -1.58012e-09
DICPCG: Solving for p, Initial residual = 0.240358, Final residual = 9.83735e-07, No Iterations 688
time step continuity errors : sum local = 5.53364e-10, global = 2.32135e-13, cumulative = -1.57989e-09
DICPCG: Solving for p, Initial residual = 0.159385, Final residual = 9.96315e-07, No Iterations 674
time step continuity errors : sum local = 3.78084e-10, global = -9.80149e-13, cumulative = -1.58087e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.268663, Final residual = 8.69785e-07, No Iterations 5
DILUPBiCG: Solving for k, Initial residual = 0.577017, Final residual = 1.23792e-06, No Iterations 5
ExecutionTime = 119036 s ClockTime = 119614 s

Time = 5.835

Courant Number mean: 0.035164 max: 0.734558
DILUPBiCG: Solving for Ux, Initial residual = 0.316643, Final residual = 6.06096e-06, No Iterations 24
DILUPBiCG: Solving for Uy, Initial residual = 0.277559, Final residual = 7.66676e-06, No Iterations 24
DICPCG: Solving for p, Initial residual = 0.936223, Final residual = 9.71772e-07, No Iterations 756
time step continuity errors : sum local = 2.84294e-09, global = -2.06542e-11, cumulative = -1.60152e-09
DICPCG: Solving for p, Initial residual = 0.104541, Final residual = 9.9431e-07, No Iterations 677
time step continuity errors : sum local = 2.35243e-08, global = -9.01515e-11, cumulative = -1.69167e-09
DICPCG: Solving for p, Initial residual = 0.117558, Final residual = 9.79596e-07, No Iterations 639
time step continuity errors : sum local = 4.61154e-09, global = 7.81929e-12, cumulative = -1.68385e-09
DICPCG: Solving for p, Initial residual = 0.12689, Final residual = 9.89733e-07, No Iterations 370
time step continuity errors : sum local = 2.00022e-09, global = -1.31679e-11, cumulative = -1.69702e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.818137, Final residual = 3.26441e-06, No Iterations 5
bounding epsilon, min: -0.000260999 max: 10.6991 average: 0.00306947
DILUPBiCG: Solving for k, Initial residual = 0.736337, Final residual = 2.63032e-06, No Iterations 5
bounding k, min: -0.00158198 max: 28.2223 average: 0.00748094
ExecutionTime = 119098 s ClockTime = 119675 s

Time = 5.836

Courant Number mean: 0.0371967 max: 2.72881
DILUPBiCG: Solving for Ux, Initial residual = 0.652541, Final residual = 7.18022e-06, No Iterations 33
DILUPBiCG: Solving for Uy, Initial residual = 0.70977, Final residual = 3.40305e-06, No Iterations 34
DICPCG: Solving for p, Initial residual = 0.979211, Final residual = 9.88169e-07, No Iterations 743
time step continuity errors : sum local = 3.0035e-08, global = 2.46912e-10, cumulative = -1.45011e-09
DICPCG: Solving for p, Initial residual = 0.0213934, Final residual = 9.44145e-07, No Iterations 630
time step continuity errors : sum local = 1.20857e-06, global = 9.53865e-10, cumulative = -4.96246e-10
DICPCG: Solving for p, Initial residual = 0.0300592, Final residual = 9.66525e-07, No Iterations 227
time step continuity errors : sum local = 2.21026e-07, global = 1.09016e-09, cumulative = 5.93915e-10
DICPCG: Solving for p, Initial residual = 0.0388499, Final residual = 9.84731e-07, No Iterations 315
time step continuity errors : sum local = 7.59393e-08, global = 1.40256e-09, cumulative = 1.99647e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.985189, Final residual = 3.76879e-06, No Iterations 5
bounding epsilon, min: -0.881998 max: 1118.36 average: 0.169447
DILUPBiCG: Solving for k, Initial residual = 0.9789, Final residual = 3.07819e-06, No Iterations 5
bounding k, min: -26.2968 max: 5427.51 average: 0.972324
ExecutionTime = 119147 s ClockTime = 119724 s

Time = 5.837

Courant Number mean: 0.076781 max: 42.6264
DILUPBiCG: Solving for Ux, Initial residual = 0.601553, Final residual = 4.45295e-06, No Iterations 53
DILUPBiCG: Solving for Uy, Initial residual = 0.788351, Final residual = 5.39617e-06, No Iterations 52
DICPCG: Solving for p, Initial residual = 0.984745, Final residual = 9.6617e-07, No Iterations 765
time step continuity errors : sum local = 1.80216e-06, global = -3.21013e-09, cumulative = -1.21366e-09
DICPCG: Solving for p, Initial residual = 0.000232156, Final residual = 9.87568e-07, No Iterations 104
time step continuity errors : sum local = 0.00778383, global = -3.28305e-10, cumulative = -1.54197e-09
DICPCG: Solving for p, Initial residual = 0.000457261, Final residual = 9.8601e-07, No Iterations 317
time step continuity errors : sum local = 0.0012931, global = -1.77113e-06, cumulative = -1.77268e-06
DICPCG: Solving for p, Initial residual = 0.000687969, Final residual = 9.94039e-07, No Iterations 204
time step continuity errors : sum local = 0.000380225, global = -5.14113e-05, cumulative = -5.3184e-05
DILUPBiCG: Solving for epsilon, Initial residual = 0.998282, Final residual = 4.03772e-06, No Iterations 5
bounding epsilon, min: -5253.26 max: 4.16621e+06 average: 749.998
DILUPBiCG: Solving for k, Initial residual = 0.995783, Final residual = 3.06932e-06, No Iterations 5
bounding k, min: -8638.37 max: 1.13537e+07 average: 1955.09
ExecutionTime = 119186 s ClockTime = 119764 s

Time = 5.838

Courant Number mean: 4.08273 max: 2077.92
DILUPBiCG: Solving for Ux, Initial residual = 0.568047, Final residual = 0.306122, No Iterations 1001
DILUPBiCG: Solving for Uy, Initial residual = 0.853726, Final residual = 0.42299, No Iterations 1001
DICPCG: Solving for p, Initial residual = 0.999921, Final residual = 9.66939e-07, No Iterations 761
time step continuity errors : sum local = 1.93557, global = -0.0172725, cumulative = -0.0173257
DICPCG: Solving for p, Initial residual = 0.818883, Final residual = 9.83926e-07, No Iterations 750
time step continuity errors : sum local = 2.51364, global = 0.00888952, cumulative = -0.00843617
DICPCG: Solving for p, Initial residual = 0.629422, Final residual = 9.26936e-07, No Iterations 718
time step continuity errors : sum local = 1.5634, global = 0.00195532, cumulative = -0.00648085
DICPCG: Solving for p, Initial residual = 0.87087, Final residual = 9.88348e-07, No Iterations 690
time step continuity errors : sum local = 9.29869, global = 0.0642429, cumulative = 0.057762
DILUPBiCG: Solving for epsilon, Initial residual = 1, Final residual = 2.58979e-06, No Iterations 5
bounding epsilon, min: -2.39448e+11 max: 1.75581e+12 average: 2.93507e+08
DILUPBiCG: Solving for k, Initial residual = 0.999998, Final residual = 2.21905e-06, No Iterations 5
bounding k, min: -6.66101e+10 max: 5.891e+11 average: 1.41879e+08
ExecutionTime = 119352 s ClockTime = 119929 s

Time = 5.839

Courant Number mean: 3.08263e+07 max: 9.83796e+10
DILUPBiCG: Solving for Ux, Initial residual = 0.825051, Final residual = 0.825051, No Iterations 1001
DILUPBiCG: Solving for Uy, Initial residual = 0.885268, Final residual = 0.885268, No Iterations 1001
DICPCG: Solving for p, Initial residual = 0.999858, Final residual = 6072.14, No Iterations 1001
time step continuity errors : sum local = 5.46229e+10, global = 1127.9, cumulative = 1127.96
DICPCG: Solving for p, Initial residual = 8.77954e-11, Final residual = 8.77954e-11, No Iterations 0
time step continuity errors : sum local = 2.79992e+14, global = 3228.91, cumulative = 4356.87
DICPCG: Solving for p, Initial residual = 1.04569e-06, Final residual = 1.15242e-05, No Iterations 1001
time step continuity errors : sum local = 3.67523e+19, global = -5.45147e+12, cumulative = -5.45147e+12
DICPCG: Solving for p, Initial residual = 0.188141, Final residual = 0.28539, No Iterations 1001
time step continuity errors : sum local = 2.14157e+24, global = -5.50977e+17, cumulative = -5.50982e+17
DILUPBiCG: Solving for epsilon, Initial residual = 1, Final residual = 8.29281e-08, No Iterations 30
bounding epsilon, min: -3.41942e+53 max: 1.07685e+55 average: 3.58229e+50
DILUPBiCG: Solving for k, Initial residual = 0.000220146, Final residual = 9.61767e-06, No Iterations 1
bounding k, min: -1.16231e+35 max: 3.50973e+38 average: 4.88488e+33
ExecutionTime = 119523 s ClockTime = 120101 s

Time = 5.84

Courant Number mean: 2.12878e+24 max: 3.25561e+28
DILUPBiCG: Solving for Ux, Initial residual = 0.896029, Final residual = 0.000254773, No Iterations 1001
DILUPBiCG: Solving for Uy, Initial residual = 0.997351, Final residual = 0.000147401, No Iterations 1001
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.179192, No Iterations 1001
time step continuity errors : sum local = 6.44401e+60, global = -2.0212e+46, cumulative = -2.0212e+46
DICPCG: Solving for p, Initial residual = 8.81388e-30, Final residual = 8.81388e-30, No Iterations 0
time step continuity errors : sum local = 1.37415e+70, global = -1.22053e+54, cumulative = -1.22053e+54
DICPCG: Solving for p, Initial residual = 2.01173e-29, Final residual = 2.01173e-29, No Iterations 0
time step continuity errors : sum local = 3.13646e+70, global = -1.68498e+53, cumulative = -1.38903e+54
DICPCG: Solving for p, Initial residual = 8.09813e-29, Final residual = 8.09813e-29, No Iterations 0
time step continuity errors : sum local = 1.26256e+71, global = 4.78508e+53, cumulative = -9.10519e+53

immortality March 15, 2013 06:08

hi
Did you solve the problem?

hz283 August 27, 2013 15:33

Hi,

I also would like to output some quantities not at the Openfoam's unified frequency. For example, I would like to output k each time step. When I add the folliowing line in rhoPimple solver:

turbulence->k()().write()

I found in each time step, the following equation is written out, instead of the data:

sqr(((-(0.666667*tr(symm(grad(U))))+sqrt((sqr((0.666667*t r(symm(grad(U)))))+((4*(ce|delta))*(((2*ck)*delta) *(dev(symm(grad(U)))&&symm(grad(U))))))))|(2*(ce|d elta))))

What happen for this statement? Thank you very much. Anyone knows something about this issue??

h

Quote:

Originally Posted by guanghaowu (Post 202715)
Hi, Kang


The '' writes k every time step. So you can define 'myOutputTime' at anytime before the running blows up. If you really dont know when the running will blow up, you also can define 'myOutputTimes' as follows.

scalar myOutputTime = runTime.startTime().value();

Best regards,
Guanghao



All times are GMT -4. The time now is 10:37.