CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Modified twoPhaseEulerFoam (http://www.cfd-online.com/Forums/openfoam-solving/59767-modified-twophaseeulerfoam.html)

alberto November 7, 2006 07:40

I can finally release the modi
 
I can finally release the modified version of twoPhaseEulerFoam.
It includes:

- Two additional drag models for gas-particle flows (Gidaspow, Syamlal-O'Brian).

- Additional radial distribution functions for the kinetic theory and their derivative.

- Additional granular pressure models and derivatives of the granular pressure coefficient.

- Additional frictional stress models.

- Variable averaging.

- Implementation of a "packing limiter" algorithm to try to stabilize the solution when the kinetic theory is used.
The implemented algorithm is just a trick to avoid numerical instabilities due to the discontinuity in the radial distribution function at the packing limit. However it requires quite a small time step. I think a more refined, less intrusive and robust method is needed such as some sort of relaxation of the granular pressure coupled to an implicit limitation on the particle-phase volume fraction similar to what done when the normal stress modulus is used in the same solver. Ideas and volunteers are welcome ;-)

- Correction of the zeroGradient BC proposed by Henry Weller and sent to me by Rasmus (thanks!).

I attach the code, an example and a detailed list of changes.







dbxmcf March 25, 2007 17:27

Is there anything wrong with t
 
Is there anything wrong with this forum? all attachments seemed unable to be clicked and download

hjasak March 25, 2007 17:32

I just downloaded one - works
 
I just downloaded one - works fine.

Hrv

dbxmcf March 25, 2007 20:08

So are the above three downloa
 
So are the above three download links in this post (twoPhaseEulerFoam, BubblingBed, Changes) dead already? I can only see three icons but no links:-(

dbxmcf March 25, 2007 20:57

The reason I found this old po
 
The reason I found this old post is that when I was trying the default twoPhaseEulerFoam cases: bed and bubbleColumn, when the execution ends, the terminal gives a "Segmentation fault" when the program stops
*********************************
Starting time loop

End

Segmentation fault
***********************************
I wonder if there is some bug inside this solver and if there is already someone that has fixed ithttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif, thanks!

alberto March 26, 2007 07:19

Look here: http://www.cfd-o
 
Look here:

http://www.cfd-online.com/OpenFOAM_D...es/1/3349.html

I made some mistake when I posted the code because the archives were too big to be uploaded.

The original code contains some bugs, yes. Some of them are reported in the bug discussion board. I link them here (hopefully all):

http://www.cfd-online.com/OpenFOAM_D...tml?1173086743
http://www.cfd-online.com/OpenFOAM_D...tml?1171048500
http://www.cfd-online.com/OpenFOAM_D...tml?1170065229
http://www.cfd-online.com/OpenFOAM_D...tml?1170064625
http://www.cfd-online.com/OpenFOAM_D...tml?1169210617

However the segmentation fault at the end of the time loop is new to me.

Regards,
Alberto

dbxmcf March 26, 2007 22:06

Thanks a lot, Alberto, I have
 
Thanks a lot, Alberto, I have figured out that the segmentation fault at the end of the time loop is due to gcc version, I changed the gcc version to 4.0.2, after I recompiled the twoPhaseEulerFoam, the error no long exits, although I don't know why.

N. A. July 16, 2010 14:03

TwoPhaseEqulerFoam
 
Hi Alberto and friends,

I am interested in the TwoPhaseEulerFoam and the relevent documentation of the two new drag models. Can you please reconfirm the links where both the solver, source code and the documentation can be downloaded.

Thanks,
Nir

Kanarya March 8, 2012 06:07

PackingLimiter
 
Hi Foamers,

I am using OpenFoam 210 and twoPhaseEulerFoam and it seems like packing limiter or maxAlpha does not work. my max Alpha is 0.62 I am getting higher results like 0.67. Do you have any suggestions?

thanks

alberto March 9, 2012 04:52

Hi Recep: what you obtain is normal. The packing limiter there is a hack I implemented long time ago, and not really the best way to deal with the problem. You should try to extend the approach used with the ppMagf model to the kinetic theory approach (include the force balance into alphaEqn) to have a physically correct and more reliable code.

About the JJ BC's you are having issues with, they were written for OF 1.7.x, so some change to the code is likely to be required.

Kanarya March 9, 2012 13:23

PackingLimiter
 
Hi Alberto,

thanks a lot for the information...

Best!

recep

alberto March 9, 2012 16:05

Warning, marketing my stuff. You find the details of the derivation in my paper on the implementation of multi-fluid equations into OF. You'll have to change it since twoPhaseEulerFoam does not use the conservative form for the momentum equation, and the PEA algorithm, but this makes things easier in terms of derivation/implementation.

Kanarya March 12, 2012 13:06

ppMagf model
 
Hi Alberto,
I am getting this error because I used maybe ppMagf(alpha) there is another way to define the function. I took your twoPhaseEulerPimpleFoam as an example to modify my TwoPhaseEulerFoam.
I do not understand really what is the function of "kineticTheory.ppMagf(alpha)"?
PS: I am using OF 210.


Making dependency list for source file twoPhaseEulerFoam.C
SOURCE=twoPhaseEulerFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I../bubbleFoam -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseEulerFoam.o
In file included from twoPhaseEulerFoam.C:81:0:
alphaEqn.H: In function ‘int main(int, char**)’:
alphaEqn.H:50:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
alphaEqn.H:56:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
In file included from twoPhaseEulerFoam.C:92:0:
alphaEqn.H:50:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
alphaEqn.H:56:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/twoPhaseEulerFoam.o] Error 1

Thanks in advance for your time and patience to answer!
Best!

Recep

alberto March 13, 2012 12:37

ppMagf is just the first derivative of the particle pressure. In the momentum equation you can write

grad(pa) = G(alpha)grad(alpha),

being G(alpha) = d(pa)/d(alpha).

P.S. twoPhaseEulerPimpleFoam is obsolete (twoPhaseEulerFoam was modified after my release to replace PISO with PIMPLE) and was written for OF 1.7.x and never adapted. I re-wrote the whole solver and I got rid off of the phase-intensive form of the momentum equation, and made the drag treatment more implicit, as discussed in a paper of mine, but I haven't released the code.

Kanarya March 13, 2012 12:45

Thanks Alberto,

your code will be available soon or at least 1 year you need?because I should decide which software I should use to simulate CFB. I have a feeling that with OF twoPhaseEulerFoam I will get trouble in high velocities. nevertheless, I am insisting in OF and I am going to try to modify it in my case...

Best!

Recep

alberto March 13, 2012 14:54

Quote:

Originally Posted by Kanarya (Post 349213)
Thanks Alberto,

your code will be available soon or at least 1 year you need?because I should decide which software I should use to simulate CFB. I have a feeling that with OF twoPhaseEulerFoam I will get trouble in high velocities. nevertheless, I am insisting in OF and I am going to try to modify it in my case...

Best!

Recep

I have no actual plan to release the code at the moment, mostly because releasing the code means receiving support requests and spending a lot of time answering to them. At the moment my policy is to share codes only with people interested in doing some research work together (this means a co-authored publication) and/or contribute to the code development.

For what concerns twoPhaseEulerFoam, with the appropriate modifications, it can be used for CFB simulations.

Kanarya March 13, 2012 16:17

hi Alberto,

Thanks a lot. I can understand you.
my last question is: alphaEqn.H should remain same and I should include in UEqns.H derivative of the particle pressure right?

thanks,

Recep

alberto March 13, 2012 16:32

Quote:

Originally Posted by Kanarya (Post 349265)
hi Alberto,

Thanks a lot. I can understand you.
my last question is: alphaEqn.H should remain same and I should include in UEqns.H derivative of the particle pressure right?

thanks,

Recep

The alphaEqn changes as shown here (lines 46 - 66):

https://github.com/AlbertoPa/twoPhas...ter/alphaEqn.H

The momentum equation for phase a will have a term due to pa (line 110):

https://github.com/AlbertoPa/twoPhas...master/UEqns.H

The term is included also in the pEqn, since it is based on the global continuity (lines 27 - 30):

https://github.com/AlbertoPa/twoPhas.../master/pEqn.H

Finally, ppMagf for the kinetic theory is defined here (lines 390 - 429):

https://github.com/AlbertoPa/twoPhas...cTheoryModel.C

and you should use CarnhanStarling radial distribution function to avoid stability issues in dense regions. Note that ppMagf uses Schaeffer's frictional pressure anyway (This idea comes from the MFIX code).

Best,

Kanarya March 13, 2012 17:17

Thanks Alberto,

I will try this!

thanks a lot again!

best!

Recep

Kanarya March 14, 2012 07:10

Hi Alberto,

I did same steps you gave except step 2 (momentum equation) before and I had error like in post 13. so now I include in momentum equation as well and I got more errors:

Step 2:
The momentum equation for phase a will have a term due to pa (line 110):

https://github.com/AlbertoPa/twoPhas...master/UEqns.H


errors like:


/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:1972:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam:perator-(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam:imensionedField<Type, Foam::volMesh>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:1985:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::tmp<Foam:imensionedField<Type, Foam::volMesh> >&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:1999:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2013:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::fvMatrix<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2027:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam:imensionedField<Type, Foam::volMesh> >&, const Foam::fvMatrix<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2042:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::fvMatrix<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2057:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::tmp<Foam::fvMatrix<Type> >&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2071:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam:imensionedField<Type, Foam::volMesh> >&, const Foam::tmp<Foam::fvMatrix<Type> >&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2086:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::tmp<Foam::fvMatrix<Type> >&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2153:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam:perator-(const Foam::fvMatrix<Type>&, const Foam::dimensioned<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2166:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::dimensioned<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2179:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::dimensioned<Type>&, const Foam::fvMatrix<Type>&)
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:2193:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foamerator-(const Foam::dimensioned<Type>&, const Foam::tmp<Foam::fvMatrix<Type> >&)
In file included from twoPhaseEulerFoam.C:92:0:
alphaEqn.H:50:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
alphaEqn.H:56:24: error: ‘class Foam::kineticTheoryModel’ has no member named ‘ppMagf’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/twoPhaseEulerFoam.o] Error 1




Do you have any idea?

thanks again!

Best!

Recep


All times are GMT -4. The time now is 14:15.