CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   An additional pressure term in two phase flow (

enoch April 10, 2012 12:27

An additional pressure term in two phase flow
I've been struggling with the below problem, but it is still unsolved. I started from modiftication of pEqn.H in bubbleFoam. There is no comilation error, but when it runs, it blows off due to high Courant number.

The momentum equations for phase1 and phase 2 are defined,
=-grad(p)/rhoa - p*grad(alpha)/rhoa + ...
=-grad(p)/rhob - p*grad(beta)/rhob + ...

There are additional pressure terms in the momenturm euqations for each phase: p*grad(alpha)/rhoa, p*grad(beta)/rhob

The face fluxes for alpha phase is defined.
phia = phia* - 1/(rhoa*Aa).f*S.f*grad(p).f - 1/(rhoa*A).f*S.f*(grad(alpha)/alpha).f*p

phib = ...

where phia* = (Ha/Aa).f*S.f + phiDraga, phib*=...
phiDraga = (explict-term drag) + (g&S.f)/Aa.f, phiDragb=...

In the pEqn.H,
Coefficents, Dp and Dpp for the lagrangian and divergence are defined in line 42 and 54, respectively.

Solve fvm::laplacian(Dp, p) + fvm::div(Dpp, p)== fvc::div(phi)

Update phia, phib, Ua and Ub in line 75, 78, 86 and 91, respectively.

Did I make any mistakes when addint the additional pressure terms in pEqn.H?

Below is a screen when the code run a case file. source and case files are linked below too.

Courant Number mean: 1.18108e+17 max: 6.18938e+19
Time = 0.01
Max Ur Courant Number = 1.53306e+21
DILUPBiCG: Solving for alpha, Initial residual = 0.064977, Final residual = 0.306707, No Iterations 1001
#0 Foam::error::printStack(Foam::Ostream&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#1 Foam::sigFpe::sigHandler(int) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#2 in "/lib/x86_64-linux-gnu/"
#3 Foam::DILUPreconditioner::calcReciprocalD(Foam::Fi eld<double>&, Foam::lduMatrix const&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#4 Foam::DILUPreconditioner::DILUPreconditioner(Foam: :lduMatrix::solver const&, Foam::dictionary const&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#5 Foam::lduMatrix::preconditioner::addasymMatrixCons tructorToTable<Foam::DILUPreconditioner>::New(Foam ::lduMatrix::solver const&, Foam::dictionary const&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#6 Foam::lduMatrix::preconditioner::New(Foam::lduMatr ix::solver const&, Foam::dictionary const&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#7 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
#8 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/lib/"
in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/bin/bubbleFoamMod"
in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/bin/bubbleFoamMod"
#11 __libc_start_main in "/lib/x86_64-linux-gnu/"
in "/home/OpenFOAM/openfoam210/platforms/linux64GccDPOpt/bin/bubbleFoamMod"
Floating point exception

All times are GMT -4. The time now is 12:44.