# Adding transport equation to twoPhaseEulerFoam (OF231)

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

 February 7, 2015, 09:04 Adding transport equation to twoPhaseEulerFoam (OF231) #1 Member   A. Bernath Join Date: Jun 2011 Location: Karlsruhe, Germany Posts: 39 Rep Power: 6 Hello all, I'm struggling with the implementation of a scalar transport equation in twoPhaseEulerFoam. I've done that in various solvers before but this one seems to be "special". Also, the explanation in the wiki (http://openfoamwiki.net/index.php/Ho...sport_equation) isn't sufficient for this solver. At the moment, the psiEqn.H looks like this: Code: ```{ fvScalarMatrix psiEqn ( fvm::ddt(alpha1, rho1, psi) + fvm::div(alphaRhoPhi1, psi) - fvm::Sp(contErr1, psi) - fvm::laplacian ( fvc::interpolate(alpha1) *fvc::interpolate(thermo1.alphaEff(phase1.turbulence().mut())), psi ) == psiSource*rho1*alpha1 ); psiEqn.relax(); psiEqn.solve(); Info<< "min " <&, Foam::lduMatrix const&, Foam::Field const&, Foam::FieldField const&, Foam::UPtrList const&, unsigned char, int) at ??:? #4 Foam::symGaussSeidelSmoother::smooth(Foam::Field&, Foam::Field const&, unsigned char, int) const at ??:? #5 Foam::smoothSolver::solve(Foam::Field&, Foam::Field const&, unsigned char) const at ??:? #6 Foam::fvMatrix::solveSegregated(Foam::dictionary const&) at ??:? #7 Foam::fvMatrix::solve(Foam::dictionary const&) at ??:? #8 Foam::fvMatrix::solve() at ??:? #9 at ??:? #10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #11 at ??:?``` Does anyone have an idea what is wrong here? From what I can read from the error message it complains about signs or possibly division by zero/square root of a negative number,... but I can't figure out the origin of the problem. Would be very glad to get any help on this! Thanks in advance. Regards, Alex

 February 9, 2015, 11:08 #3 Member   A. Bernath Join Date: Jun 2011 Location: Karlsruhe, Germany Posts: 39 Rep Power: 6 Hi Ramon, thanks for the help. Does it make a difference if I declare psi like in my first post compared to the implementation through phaseModel.C/H as you mentioned? I'm trying that approach at the moment but I'm curious what could be the difference. Thanks, Alex EDIT: Actually, the results are the same :-/

 February 9, 2015, 12:49 #4 New Member   Ramon Join Date: Feb 2014 Location: Eindhoven Posts: 24 Rep Power: 3 You could first of all try leaving out any turbulence terms and other complexities, try just a simple convection/diffusion equation, and build it up from there. I know its a little trivial but it that way you can find the part of the equation that is destroying your solver. K.R. Ramon

 February 13, 2015, 10:22 #5 New Member   Mattia de\' Michieli Vitturi Join Date: Mar 2009 Posts: 23 Rep Power: 8 Hi, may I ask why are you using alphaEff coefficient for diffusion? fvc::interpolate(thermo1.alphaEff(phase1.turbulenc e().mut())) This coefficient is the thermal diffusion rate (ratio between kinematic visocsity and Prandtl number). Is this what you really want? Can you also try do add before the solve the following line? fvOptions.constrain(psiEqn); Ciao Mattia

 February 16, 2015, 10:51 #6 Senior Member   Gerhard Holzinger Join Date: Feb 2012 Location: Austria Posts: 170 Rep Power: 14 Try the PBiCG solver with none as preconditioner. From the solver output I figure that there are zones in your domain with alpha=0. In these zones the terms of your transport equation are multiplied by zero. Solving the linear equation system involves dividing terms in some cases. Since the floating point exception happens during the smoothing operation, my guess is, that you run into numerical trouble due to the zero-alpha values in parts of your domain.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post shahrbanoo AVL FIRE 0 July 24, 2014 08:52 Raijin Thunderkeg CFX 2 May 17, 2014 22:53 nikhil5490 OpenFOAM Programming & Development 0 April 30, 2014 13:28 sharonyue FLUENT 0 April 1, 2014 22:18 Tobi OpenFOAM Programming & Development 0 June 2, 2012 13:26

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