CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Count breakup events per cell

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2015, 10:39
Post Count breakup events per cell
  #1
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 11
a.weber is on a distinguished road
Hello everyone,

I'm currently working on some changes on the sprayFoam solver to do different breakup and coalescence models.

It would be great to visualize areas of higher breakup/coalescence frequency. Therefore I create scalarfields (e.g. n_bu for breakup and n_coal) just as a counter for each cell. If breakup occurs in a cell, the value should just count up. Later on I could calculate the breakup freqeuncy easily with this field.

Breakup is mainly defined in
...../src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C

What do I have to add there, to get my counter working?
Since SprayParcel.C is meant to only treat the particles fields, there is no direct access to the mesh fields (in some way read-only through interpolation of velocity Uc_ = td.UInterp().interpolate(....); )

The Idea is really easy, but I was not able to find a solution yet.

Best regards,
Andy
a.weber is offline   Reply With Quote

Old   February 5, 2015, 11:47
Default
  #2
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
dkxls will become famous soon enough
Quote:
Originally Posted by a.weber View Post
Therefore I create scalarfields (e.g. n_bu for breakup and n_coal) just as a counter for each cell. If breakup occurs in a cell, the value should just count up.
Why would you want to get the breakup count per cell, why not per parcel?

Well, actually both could be quite interesting.

There is a unused "user" variable in the SprayParcel class. You could use that as a counter. The problem here is just that you determine the breakup event inside the BreakupModel classes, which don't have access to the "user" variable, or the mesh for that matter.

I'm not sure if it works, but you could try to pass the user variable to:
Code:
bool Foam::BreakupModel<CloudType>::update
This requires you to also change all breakup models, but that would be my best bet right now.

Quote:
Originally Posted by a.weber View Post
Since SprayParcel.C is meant to only treat the particles fields, there is no direct access to the mesh fields (in some way read-only through interpolation of velocity Uc_ = td.UInterp().interpolate(....); )
If you really start coding inside the SprayParcel template then you have access to the mesh. Can't remember where the mesh is kept, but I would probably check the KinematicParcel or KinematicCloud class first.
Once you have access to your fields you can also pass them to the breakup models and get your counter per cell.

I just saw that you have access to the cell number and TrackData already inside the void Foam::SprayParcel<ParcelType>::calcBreakup function.
You should get access to the mesh like this (haven't tested it though):
Code:
 const polyMesh& mesh = td.cloud().pMesh();

Last edited by dkxls; February 5, 2015 at 12:01. Reason: add info on mesh access
dkxls is offline   Reply With Quote

Old   February 9, 2015, 07:29
Default
  #3
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 11
a.weber is on a distinguished road
Quote:
Why would you want to get the breakup count per cell, why not per parcel?
Using Breakup AND Coalescence Events together would end in a loss of information since one of the coalescing droplets/parcels will be deleted in the process.
a.weber is offline   Reply With Quote

Old   February 10, 2015, 07:43
Default
  #4
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 11
a.weber is on a distinguished road
Thank you for the quick reply!

I'm trying to define n_bu trough an IOobject, somehow like this:

Quote:
const polyMesh& mesh = td.cloud().pMesh();

volScalarField n_bu
(
IOobject
(
"n_bu",
td.cloud().db().time().timeName(),
td.cloud().db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
But that wont work because I need the fvMesh to create an IOobject (but only have the polyMesh). I hope I've understood that right....

So I think what I have to do is to pass the fvMesh down to SprayParcel.C (e.g. from KinematicCloud.C).

Or is there a easier/faster solution to obtain the fvMesh???
a.weber is offline   Reply With Quote

Old   April 29, 2015, 04:56
Default
  #5
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 11
a.weber is on a distinguished road
Still haven't found a solution yet.

You're right so far, i can make use of
td.cloud().pMesh();
in
Foam::SprayParcel<ParcelType>::calcBreakup
but so far I have only managed to get read-only access to the field values (e.g. to my counter-field "n_bu" with lookupObject<volScalarField>("n_bu")).

So is there a way to get write access somehow to that field, probably with a Pointer?
a.weber is offline   Reply With Quote

Reply

Tags
breakup model, coalescence, counter, particle


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell Reynolds Number laliong Main CFD Forum 12 September 17, 2019 03:18
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15
monitoring cell Jane Siemens 2 March 4, 2004 21:01
cell to cell relation CMB Siemens 1 December 4, 2003 04:05


All times are GMT -4. The time now is 10:30.