CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Lift force modeling in bubbleFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 8, 2007, 08:15
Default Hello there, I have some pr
  #1
Senior Member
 
Holger Marschall
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 124
Rep Power: 11
holger_marschall is on a distinguished road
Send a message via Skype™ to holger_marschall
Hello there,

I have some problems with the implementation of lift force models in bubbleFoam, hopefully someone can help me: Basically what I'm trying to do is to implement a lift model in the bubbleFoam solver analogical to the drag model implemented in the twoPhaseEulerFoam solver. I've added the drag model from twoPhaseEuler to BubbleFoam before and it's working fine. Then I've created a folder "liftModels" with subfolders "liftModel" and "Tomiyama", including liftModel.H, liftModel.C and so on, everything exactly like it's done for the drag (also updated lnInclude and the files and options in the make directory). Lastly I duplicated the drag model files and renamed all "drag" with "lift". In createFields.H I added the runtime-selection pointer
autoPtr<liftmodel> lift = liftModel::New
(
interfacialProperties,
alpha,
phasea,
phaseb
);
My liftDragCoeffs looks like this at the moment:

volVectorField Ur = Ua - Ub;
volScalarField magUr = mag(Ur);

volScalarField Ka = draga->K(magUr);
volScalarField dragCoef = Ka;

volScalarField Clift = lift->L(magUr);
scalar Cl=0.5;
volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U));
'L' is implemented like 'K' for the drag in twoPhaseEulerFoam (e.g. interfacialModels/dragModels/SchillerNaumann.C),
the correlating part in my Tomiyama.C file is

Foam::tmp<foam::volscalarfield> Foam::Tomiyama::L
(
const volScalarField& Ur
) const
{
volScalarField Re = (Ur*phasea_.d()/phaseb_.nu());
volScalarField II = 0.288*tanh(0.121*Re);
return II;
(I've skipped some lines here too keep my text from getting even longer, of course the above is not really Tomiyama)


Now my two problems:

1. If I comment out the line "volScalarField Clift = lift->L(magUr);" in liftDrafCoeffs.H everything works fine, if I don't I can compile the code but starting the solver brings up the following error

Time = 0.01

Courant Number mean: 0 max: 0.0455581
Max Ur Courant Number = 0.455581
deltaT = 0.01
Max Ur Courant Number = 0.455581
DILUPBiCG: Solving for alpha, Initial residual = 1.24905e-05, Final residual = 8.9929e-22, No Iterations 1
DILUPBiCG: Solving for alpha, Initial residual = 8.99302e-22, Final residual = 8.99302e-22, No Iterations 0
Dispersed phase volume fraction = 0.502812 Min(alpha) = 0 Max(alpha) = 1


--> FOAM FATAL ERROR : LHS and RHS of - have different dimensions
dimensions : [0 -3 6 0 0 0 0] - [0 -2 4 0 0 0 0]
#0 Foam::error::printStack(Foam:: Ostream&) in "/home/user/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/user/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::operator-(Foam::dimensionSet const&, Foam::dimensionSet const&) in "/home/user/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#3 Foam::dimensioned<double> Foam::operator-<double>(Foam::dimensioned<double> const&, Foam::dimensioned<double> const&) in "/home/user/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libEulerianInterfacialMo dels.so"
#4 Foam::Tomiyama::L(Foam::GeometricField<double,> const&) const in "/home/user/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libEulerianInterfacialMo dels.so"
#5 main in "/home/user/OpenFOAM/user-1.4.1/applications/bin/linux64GccDPOpt/bubbleFoamExt"
#6 __libc_start_main in "/lib64/libc.so.6"
#7 Foam::regIOobject::readIfModified() in "/home/user/OpenFOAM/user-1.4.1/applications/bin/linux64GccDPOpt/bubbleFoamExt"


From function operator-(const dimensionSet& ds1, const dimensionSet& ds2)
in file dimensionSet/dimensionSet.C at line 395.

FOAM aborting
Obviously is has to do something with the volScalarField Clift = lift->L(magUr); What I don't understand here is how left and right hand side can have different dimensions and how it can happen at all if Clift is not further used?

2. Regarding the lift implementation my code doesn't make too much sense like this, what I really want to do is get back a dimensionedScalar from the function 'L' (like dimensionedScalar Clift=lift->L(magUr); and then have 'L' calculating the liftCoefficient as dimensionedScalar. However if I change the syntax to

Foam::tmp<foam::dimensionedscalar> Foam::Tomiyama::L
I get the error message (Of course I've changed the syntax not only in Tomiyama.C but also in liftModel.H, Tomiyama.H and liftModel.H):

/home/user/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H: In destructor ‚&euro;&tilde;Foam::tmp<t>::~tmp() [with T = Foam::dimensioned<double>]‚&euro;&trade;:
liftDragCoeffs.H:35: instantiated from here
/home/user/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:82: error: ‚&euro;&tilde;struct Foam::dimensioned<double>‚&euro;&trade; has no member named ‚&euro;&tilde;okToDelete‚&euro;&trade;
/home/user/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:89: error: ‚&euro;&tilde;struct Foam::dimensioned<double>‚&euro;&trade; has no member named ‚&euro;&tilde;operator--‚&euro;&trade;
make: *** [Make/linux64GccDPOpt/bubbleFoamExt.o] Fehler 1
So how can I have a function give back a "dimensionedScalar" value? Also, to avoid further problems like this, where could I look it up, I've looked for other OpenFoam functions doing something similar but what I found wasn't very helpful.


Hope my description isn't too confusing, any help is appreciated.

Best Regards
Holger
__________________
Holger Marschall
web: http://www.holger-marschall.info
mail: holgermarschall@yahoo.de
holger_marschall is offline   Reply With Quote

Old   December 10, 2007, 14:44
Default Any idea as to what might be c
  #2
Senior Member
 
Holger Marschall
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 124
Rep Power: 11
holger_marschall is on a distinguished road
Send a message via Skype™ to holger_marschall
Any idea as to what might be causing this?
What went wrong?

---
Holger
__________________
Holger Marschall
web: http://www.holger-marschall.info
mail: holgermarschall@yahoo.de
holger_marschall is offline   Reply With Quote

Old   December 10, 2007, 16:24
Default 2. the dragModels have been de
  #3
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 17
mattijs is on a distinguished road
2. the dragModels have been defined to return a tmp<volscalarfield> so your model will have to adhere. It can be a uniform volScalarField though.

1. From the traceback your model does a '-' somewhere. If you recompile your model with full debugging (-g -O0) it should show you the exact line number.
mattijs is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgently Need the code of Lift force and VM force Kai Yan Main CFD Forum 0 July 16, 2008 07:07
Lift force alvio CFX 0 March 12, 2008 18:53
Lift force or coefficient of lift Rola FLUENT 1 November 12, 2006 14:29
how to calculate prssure force & lift force in CFX zaidun CFX 4 March 28, 2006 02:06
Lift Force Min-Hua Wang CFX 0 December 2, 2003 19:21


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