CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   TwoPhaseEulerFoam and Boundary conditions (https://www.cfd-online.com/Forums/openfoam-solving/57767-twophaseeulerfoam-boundary-conditions.html)

 raagh77 March 13, 2009 16:12

Hi.. my task is to simulate a

Hi..
my task is to simulate air particle being injected (at the center) to the water as continuous medium. (Becker case)

(Domain being simple 2D rectangular region sides and bottom (except at the center) being walls. Velocity inlet at the center and pressure outlet at the top)

Boundary conditions

1) alpha 0 gradients at the wall
2) inlet uniform 1
3) 3/4 th water (continous phase) filled so alpha being eual to 0 and remaining 1/4 air(discrete phase) and alpha being 1
4) alpha being 1 at the "top" where pressure outlet boundary conditions are set

top
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}

5) at the inlet region alpha being 1

velocity-inlet
{
type fixedValue;
value uniform 1;
}

am using twoPhaseEulerFoam solver also I would like to know which could be the best solver when compare with bubbleFoam (turbulence being on)

Simulation errors:
When I try with these boundary conditions for alpha and with 0.9 m/s velocity at the inlet (air velocity) diameter of the particle being 0.00003 m

after few iterations courant number increase (around thousands!!) though the grid is not that fine also very small time step being employed.

I want to know whether boundary conditions are to be altered or there I have to modify the solver and recompile again!!??

Awaiting for replies!

Regards
Raghavendra

 alberto March 14, 2009 13:21

Hi,

you have already asked your question here, you repeated it http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/6412 and you wrote it personally to me, at least. I can understand you need the answer, but

- You should not write multiple posts about the same problem, by simply cutting and pasting you question.

- You should not hijack a thread asking something not related to the topic in the title.

- You should _wait_. People is here on a volunteer basis, and these behaviours are a good way NOT to get an answer.

- To obtain answers from me there is an additional condition: you need to put a working email contact in your _public_ profile, so that if someone else has a similar problem, he can contact you eventually. We should be a community of users, and help each other in the end, and not just ask and run away.

About your problem, bubbleFoam and twoPhaseEulerFoam are very similar. In twoPhaseEulerFoam you can select different drag laws and other submodels, but the basic algorithm is exactly the same.

For the simulation setup, you might want to take a look at H. Rusche PhD thesis, that can be downloaded from www.foamcfd.org website.

Regards,
A.

 raagh77 March 14, 2009 13:35

Hello Alberto Passalacqua..and

Hello Alberto Passalacqua..and others.

Yes I repeated the same question in other thread also hoping I get some replies..

yeah ..now I understand I have to wait
and this kind of mistakes wont be repeated again.

Also regarding the email contact you mentioned, am a student and that is the reason I have give my personal mail ID.

I was very much new to the forum and OpenFOAM that made me to put my queries in other thread also.

I wont hesitate to ask "sorry" regarding this and I this kind of mistakes wont be repeated again..

Regards
Raghavendra

 raagh77 March 14, 2009 13:38

and coming back to the topic.

and coming back to the topic.

thanks for the H. Rusche PhD thesis I think this will be quite useful to perform my task..

thanks a lot Alberto Passalacqua

Regards
Raghavendra

 alberto March 14, 2009 15:34

No problem, and sorry if I sou

No problem, and sorry if I sounded too rough :-)

What is the order of the time step you are using?

Check if the lift force and the virtual mass coefficients are set correctly for your case too.

P.S. About the email, I meant your contact is not visible in your profile here http://www.cfd-online.com/cgi-bin/OpenFOAM_Discus/board-profile.cgi?action=view_profi le&profile=raagh77-users ;-)

 raagh77 March 14, 2009 17:35

Hi Alberto Passalacqua, Tim

Hi Alberto Passalacqua,

Timestep I am using is 1e-4
Cvm as 0.5
Cl 0
Ct 1
(which I copied from bubbleColumn tutorial)

also this time I included relaxation factors but even that didn't work
simulation got crashed with high timestep continuity error..

I checked the pressure values and it was in the range of 1e14 surprisingly !!

these are my boundary conditions

parameters-----inlet----outlet----walls
Ua-------------0--------0---------fixed value 0
Ub-------------0.1m/s---0---------fixed value 0

finally in my profile settings accidentally Do not display my real e-mail address with my profile was checked..
now my email id is visible http://www.cfd-online.com/OpenFOAM_D...part/happy.gif thanks for notifying me about that http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Regards
Raghavendra

 alberto March 14, 2009 23:22

Hi, I'm running a simple t

Hi,

I'm running a simple test case like this

base = 0.2m
height = 1m
initial liquid height = 0.45

I'm using your data and an inlet 4cm wide just to try to see what happens, and the solution is very stable with dt = 0.001s also on a poor quality grid.

What is you geometric setup?

About relaxation factors, you should not use them in bubbleFoam/twoPhaseEulerFoam or you will delay your solution in time.

Regards,
A.

 raagh77 March 15, 2009 08:50

Hello Alberto Passalacqua,

Hello Alberto Passalacqua,

my simulation domain details are
.> base 0.5m
.> height 2.5m
.> initial liquid height 2m
.> inlet 4mm (probably this could be the problem!!?)
.> velocity inlet 0.9m/s.

Is it possible to share the test case files with me? so that I can compare with mine..

Regards
Raghavendra

 raagh77 March 15, 2009 08:53

Hello Alberto Passalacqua,

Hello Alberto Passalacqua,

my simulation domain details are
base 0.5m
height 2.5m
initial liquid height 2m
inlet 4mm (probably this could be the problem!!?)
velocity inlet 0.9m/s.

Is it possible to share the test case files with me? so that I can compare with mine..

Regards
Raghavendra

 alberto March 15, 2009 22:17

Hi,

no, the problem is not the small inlet. It is the turbulence model. If you switch it off, the simulation proceeds without problems. I didn't play with its parameters, but the problem is there. You might want to consider other approaches instead than a mixture turbulence model based on transport equations. For example:

• Y. Sato, K. Sekoguchi, 1975, Liquid velocity distribution in two-phase bubble flow. International Journal of Multiphase Flow 2 (1), pp 79.
• S. M. Monahan, V. S. Vitankar, R. O. Fox, 2005, CFD Predictions for Flow-Regime Transitions in Bubble Columns, AIChE Journal, Vol. 51, No. 7, pp 1897.

Do you take the gas velocity at the injection from the experiments? I didn't check Becker's work, but it seems high, considering you have 0.45 cm of water.

 raagh77 March 16, 2009 07:22

Hi Alberto Passalacqua,

Yes as you said the gas velocity at the inlet was not same as in Becker case.

I made the following changes (corrected mistakes)
. increased inlet width (4cm)
. reduced velocity at the inlet (0.1 m/s)
. and the direction of gravity force was wrong, it was in z-direction

and the simulation is stable now :)
(with turbulence being on)

Now I will try to simulate with the exact dimensions as in the Becker case (my test case was not with the same dimensions as of Beckers' case)

I think it shouldn't create problems

Finally the references you quoted is quite useful, I will go through it before simulating with the exact dimensions as in Becker case..

I am really thankful for your support

Regards
Raghavendra

 alberto March 16, 2009 11:13

Hi,

happy to here it's working! Are you going to do a validation against experiments of the code? It would be interesting to see the results if/when possible!

Regards,
A.

 raagh77 March 16, 2009 16:06

Yes, am trying to simulate Becker case and compare the results experimentally done by D. Pfleger and S. Becker .
Moreover am very much new to the OpenFOAM and what I do could be very much simple to others :)
I will definitely share the results with the community if something interesting :)

yeah my test case was quite successful but now am trying to simulate with the exact dimensions as mentioned in the "Becker case".

0.2 m width
0.6m width (0.45 m hegith of the liquid column)
1mm inlet
air velocity 0.17cm/s

other parameters being absolutely same.

but after 2 or 3 iterations i ll get some error msg
(this time even cournat number is well with in the limit and even timestep continuity error is with in the limit)

I will copy paste the error message what I get..

Courant Number mean: 2.32789e-05 max: 0.0723331
Max Ur Courant Number = 0.222155
Calculating averages

Time = 0.016

DILUPBiCG: Solving for alpha, Initial residual = 3.06836e-07, Final residual = 2.36065e-11, No Iterations 1
Dispersed phase volume fraction = 0.257994 Min(alpha) = -1.0429e-20 Max(alpha) = 1.0026
DILUPBiCG: Solving for alpha, Initial residual = 3.05854e-09, Final residual = 1.83218e-13, No Iterations 1
Dispersed phase volume fraction = 0.257994 Min(alpha) = -9.43671e-20 Max(alpha) = 1.0026
#0 Foam::error::printStack(Foam::Ostream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb80e3400]
#3 Foam::GAMGSolver::scalingFactor(Foam::Field<double >&, Foam::Field<double> const&, Foam::Field<double> const&, Foam::Field<double> const&) const in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::GAMGSolver::scalingFactor(Foam::Field<double >&, Foam::lduMatrix const&, Foam::Field<double>&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::fvMatrix<double>::solve(Foam::Istream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#8 main in "/home/ragh/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#9 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
[1]+ Done paraFoam
Floating point exception

Is the real problem is with the small inlet (sorry I am repeating) and small grid size at the inlet ??
as all parameters except small inlet are same

Regards
Raghavendra

 alberto March 16, 2009 16:39

Does it run switching the turbulence model off? Could you post the case or email it to me so I can check it?

Thanks,
Alberto

 raagh77 March 16, 2009 16:58

Hi..
Yes I switched off turbulence and gave a run
but again I am getting the same error.

I will send you the case file to your mail

Regards
Raghavendra

 alberto March 16, 2009 17:38

Hi,

I remeshed the domain because you splitted the inlet face in three, but you did not project it on the outlet face, so the mesh is not perfectly orthogonal. In GAMBIT simply build two rectangles: one big as the bubble column (0.2 x 0.6m) and the other (0.001 x 0.6m). Move the second along x of 0.0995 so to have it in the centre, and then use the split function. Your bubble column is now divided in three.
At this point create a non-uniform mesh on the base, but not along the height. In my example I put six cells inside the inlet and used the bell-shaped distribution on the inlet sides, with a base step of 0.002m. Pay attention to specify the nodes also on the outlet at the same time, or the mesh generation will not give rise to a perfectly orthogonal mesh!

With this mesh, I can run the laminar case without any problem, but the turbulent one doesn't work. You might want to check the parameters.

Btw, I changed also the outlet boundary conditions to have a "cleaner" solution, especially for the velocity fields. There is no backflow at the outlet (and if there is you can avoid it by increasing the height a bit), so you do not need the InletOutlet. Simply use a fixedValue for pressure, and a zeroGradient for the other quantities.

Check your email for the updated case.

I hope this helps.

 raagh77 March 17, 2009 06:02

Hi Alberto Passalacqua,

Yes, as you said the simulation is quite stable with turbulence being off (even I tried with my earlier mesh in both bubbleFoam solver and twoPhaseEulerFoam solver).

Now, in order to include turbulence I thought to map the results from laminar case and start that as my initial conditions.
(According to the tutorial cavityFine in userguide).

Hope it will work :)

Regards
Raghavendra

 raagh77 March 17, 2009 10:43

Hi ..

am back
unfortunately with probelms again..

I tried to simulate the case with turbulence being "on" so that it can be compared with experimental results..

As I said in the previous post I started with mapFields (mapping results from laminar case to the turbulent case and using this as my initial solution).

When I switch on turbulence after few iterations its the same old problem..simulation crashes with the following error

Time = 0.005

DILUPBiCG: Solving for alpha, Initial residual = 1.45502e-06, Final residual = 1.68436e-12, No Iterations 1
Dispersed phase volume fraction = 0.25 Min(alpha) = -5.92206e-08 Max(alpha) = 1.00039
DILUPBiCG: Solving for alpha, Initial residual = 1.21911e-09, Final residual = 2.57683e-16, No Iterations 1
Dispersed phase volume fraction = 0.25 Min(alpha) = -4.0857e-15 Max(alpha) = 1.00039
GAMG: Solving for p, Initial residual = 0.000977288, Final residual = 8.85769e-09, No Iterations 14
time step continuity errors : sum local = 1.81087e-08, global = -2.49117e-10, cumulative = -1.17943e-09
GAMG: Solving for p, Initial residual = 7.59477e-05, Final residual = 6.43625e-09, No Iterations 12
time step continuity errors : sum local = 6.608e-08, global = -1.14294e-08, cumulative = -1.26088e-08
DILUPBiCG: Solving for epsilon, Initial residual = 0.873223, Final residual = 7.10405e-06, No Iterations 56
DILUPBiCG: Solving for k, Initial residual = 0.999832, Final residual = 0.00272598, No Iterations 1001
ExecutionTime = 7.93 s ClockTime = 8 s

Courant Number mean: 0.0664316 max: 61.9321
Max Ur Courant Number = 63.6085
Calculating averages

Time = 0.006

DILUPBiCG: Solving for alpha, Initial residual = 0.00329163, Final residual = 1.74616e-11, No Iterations 10
Dispersed phase volume fraction = 0.25 Min(alpha) = -0.230798 Max(alpha) = 3.05932
DILUPBiCG: Solving for alpha, Initial residual = 0.017891, Final residual = 8.03225e-12, No Iterations 17
Dispersed phase volume fraction = 0.25 Min(alpha) = -0.0448055 Max(alpha) = 1.54693
GAMG: Solving for p, Initial residual = 0.879569, Final residual = 2.32629e+47, No Iterations 1000
time step continuity errors : sum local = 1.87375e+48, global = 1.79721e+45, cumulative = 1.79721e+45
GAMG: Solving for p, Initial residual = 0.826277, Final residual = 2.57506e+46, No Iterations 1000
time step continuity errors : sum local = 1.35281e+95, global = 1.29755e+92, cumulative = 1.29755e+92
#0 Foam::error::printStack(Foam::Ostream&) in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#4 Foam::fvMatrix<double>::solve(Foam::Istream&) in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#5 main in "/apps/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
#6 __libc_start_main in "/lib64/libc.so.6"
Floating exception
\$

As it can be seen the the error could be because of maximum courant number (also with timestep continuity error..)

I made the following changes as compared to my laminar case

. decreased velocity 100 times! (from 0.17cm/s to 0.17e-2 cm/s)
. also decreased timestep considerably
. changed the default ddT schemes

but none of these changes doesn't contribute for the stable simulation

Am really wondering what could be the error that has occured by just switching on the turbulence...!!

Regards
Raghavendra

 alberto March 17, 2009 12:04

Hi,

this line should show you what you need to check:
• DILUPBiCG: Solving for k, Initial residual = 0.999832, Final residual = 0.00272598, No Iterations 1001 --> The equation for the turbulent kinetic energy is not converging.
In particular, plot and check the turbulent quantities (k, eps, turbulent viscosity) and see where they give problems.

 raagh77 March 17, 2009 17:16

Hello Alberto,

There was some problem with nutb because of its very high value (1e+10) the simulation used to crash. To correct this I initialized very low value of epsilon (1e-08..previous value was 0.1) and the simulation was quite stable for around 3 seconds and now the same problem ..

Courant number suddenly increases from a value 0.0342002 at Time T=3.441seconds

part of the log file is pasted below

Courant Number mean: 0.00419636 max: 0.964209
Max Ur Courant Number = 1.17271
Calculating averages

Time = 3.443

DILUPBiCG: Solving for alpha, Initial residual = 1.24005e-05, Final residual = 1.12019e-12, No Iterations 3
Dispersed phase volume fraction = 0.249998 Min(alpha) = -1.09456e-25 Max(alpha) = 1.00728
DILUPBiCG: Solving for alpha, Initial residual = 1.45091e-06, Final residual = 6.05932e-11, No Iterations 2
Dispersed phase volume fraction = 0.249998 Min(alpha) = -1.09456e-25 Max(alpha) = 1.00163
GAMG: Solving for p, Initial residual = 0.000133255, Final residual = 8.68084e-09, No Iterations 47
time step continuity errors : sum local = 6.08486e-06, global = -2.17887e-06, cumulative = -7.01493e-06
GAMG: Solving for p, Initial residual = 2.98824e-12, Final residual = 2.98824e-12, No Iterations 0
time step continuity errors : sum local = 0.000581419, global = -2.30176e-06, cumulative = -9.31669e-06
DILUPBiCG: Solving for epsilon, Initial residual = 1, Final residual = 7.62948e-06, No Iterations 4
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 7.48601e-06, No Iterations 6
ExecutionTime = 1167.96 s ClockTime = 1172 s

Courant Number mean: 0.0110784 max: 5.80792
Max Ur Courant Number = 16.9409
Calculating averages

Time = 3.444

DILUPBiCG: Solving for alpha, Initial residual = 0.000897952, Final residual = 1.44798e-11, No Iterations 7
Dispersed phase volume fraction = 0.250028 Min(alpha) = -1.4176e-06 Max(alpha) = 1.52832
DILUPBiCG: Solving for alpha, Initial residual = 0.00051464, Final residual = 3.42879e-12, No Iterations 6
Dispersed phase volume fraction = 0.249998 Min(alpha) = -1.08619e-25 Max(alpha) = 1.18786
GAMG: Solving for p, Initial residual = 0.000202578, Final residual = 8.51716e-09, No Iterations 7
time step continuity errors : sum local = 1.62171, global = 0.25112, cumulative = 0.251111
GAMG: Solving for p, Initial residual = 2.76714e-08, Final residual = 8.22339e-09, No Iterations 1
time step continuity errors : sum local = 0.540509, global = 0.169541, cumulative = 0.420652
#0 Foam::error::printStack(Foam::Ostream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb7ff7400]
#3 Foam::DILUPreconditioner::calcReciprocalD(Foam::Fi eld<double>&, Foam::lduMatrix const&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::DILUPreconditioner::DILUPreconditioner(Foam: :lduMatrix::solver const&, Foam::Istream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::lduMatrix::preconditioner::addasymMatrixCons tructorToTable<Foam::DILUPreconditioner>::New(Foam ::lduMatrix::solver const&, Foam::Istream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::lduMatrix::preconditioner::New(Foam::lduMatr ix::solver const&, Foam::Istream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#8 Foam::fvMatrix<double>::solve(Foam::Istream&) in "/home/ragh/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#9 Foam::fvMatrix<double>::solve() in "/home/ragh/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#10 main in "/home/ragh/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#11 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"