|
[Sponsors] |
Implementation: Break-up model of Coulaloglou and Tavlarides |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 25, 2014, 07:15 |
Implementation: Break-up model of Coulaloglou and Tavlarides
|
#1 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
Hello everyone,
I'm currently working on my own solver for bubbly flows. I want to be able to calculate breakup and coalescence of bubbles rising in a fluid. This is all done by a Euler-Lagrange approach, which is working well so far. I'm now trying to get the breakup-model of Coulaloglou and Tavlarides running in my code. [COULALOGLOU, C. A.; TAVLARIDES, L. L. Description of interaction processes in agitated liquid-liquid dispersions. Chemical Engineering Science, 1977, 32. Jg., Nr. 11, S. 1289-1297.] My problem is, that the model uses the turbulent energy (epsilon), which is not availiable in the standard break-up models. (.../src/lagrangian/spray/submodels/BreakupModel/...) There is no direct connection to the fields of the mesh, so it's also not possible to get the value of epsilon at the particle's position. The only thing there is the list of variables, that are connected to the single parcel, for example: Code:
bool Foam::ETAB<CloudType>::update ( const scalar dt, const vector& g, scalar& d, scalar& tc, scalar& ms, scalar& nParticle, scalar& KHindex, scalar& y, scalar& yDot, const scalar d0, const scalar rho, const scalar mu, const scalar sigma, const vector& U, const scalar rhoc, const scalar muc, const vector& Urel, const scalar Urmag, const scalar tMom, scalar& dChild, scalar& massChild ) How can I invoke the variables needed from the mesh? Kind regards, Andy |
|
August 25, 2014, 10:11 |
|
#2 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Jep, you don't get these fields like this.
But what you can do is to look them up from the object registry. I'm not quite sure if the turbulence fields are tmp-fields or registered objects, but in any case you can look-up the turbulence model from there, which will give you access to the fields you want. Now, if you haven't done much coding in OpenFOAM, this might not sound too straight forward, but actually it's not that complicated either. You can have a look at the dispersion models, there they also look-up the turbulence fields from the registry. Code:
src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/DispersionRASModel |
|
August 26, 2014, 05:39 |
|
#3 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
Ok, thanks, done copy-pasting.
But still one problem: DispersionRASModel makes use of [cellI], that i don't have in my breakupmodel.... How can I solve this? |
|
August 26, 2014, 07:08 |
|
#4 | |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Quote:
Sorry, I didn't think it totally through when I gave you the first hint. I actually wouldn't know how you get the cell ID inside a break-up model. An option, which I think is very bad, but possible would be to copy and recompile the spray library. You then have to link also your solver against this re-compiled library, rather cumbersome, but would work. This way you can change the variables that are passed to the break-up model. (In fact I do the exact same thing for the 2.2.x spray library to fix some bugs that the upstream developers didn't fix yet.) You only have to copy the folder src/lagrangian/spray to somewhere and change the name of the library, i.e. in somewhere/spray/Make/files Code:
LIB = $(FOAM_USER_LIBBIN)/liblagrangianSprayXXX Code:
EXE_INC = \ -Isomewhere/spray/lnInclude \ .... EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ -llagrangianSprayXXX\ ... |
||
August 28, 2014, 10:43 |
|
#5 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
At first: Thank you for the great help!!
OK, did a lot of trial and error...finnaly almost got it. I now have my epsilon-field ready to use at the desired point of my code. The [cellI] is now taken from src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C (by just adding it to the Table of Parameters): Code:
.... td.cloud().breakup().update ( dt, g, ... dChild, massChild, cellI ) ) So far, so good, but still.... I get an Error because the given cellI in the SprayParcel.C is not defined as some kind of Code:
const parcelType& p = iter(); const label cellI = p.cell(); Code:
const parcelType& p = static_cast<const parcelType&>(*this); This surely can't be used by: Code:
const scalar epsilon = epsilonPtr_->internalField()[cellI]; Any suggestions? Kind regards, Andy |
|
August 28, 2014, 12:34 |
|
#6 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
Sorry I don't understand where your error comes from. As far as I see it in the source code (src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C), you have the cell number readily available in the calcBreakup function.
You can just take that one and pass it on as a const label to the BreakupModel<CloudType>::update (i.e. td.cloud().breakup().update). Should be straight forward, at least I think so. If you don't get it solved, can you attach your SprayParcel.C and BreakupModel.C? -Armin P.S.: Just to make sure, you are using the latest git version of OpenFOAM 2.3.x, right? |
|
August 29, 2014, 04:58 |
|
#7 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
It works!
I've just recompiled all my modifications again... and the cellI gives me the right label now. I'll now start working on the coalescence model by Coulaloglou and Tavlarides which also makes use of epsilon. Thanks to your help I can now do that on my own I'll post my results here when everything is ready Best regards Andy PS: Yes, i'm using version 2.3.x |
|
September 8, 2014, 05:43 |
|
#8 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
Done!
Here's my code. |
|
Tags |
breakup, turbulence |
Thread Tools | Search this Thread |
Display Modes | |
|
|