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

Struggling to add custom ParticleCollector to RuntimeSelectionTable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2023, 04:48
Default Struggling to add custom ParticleCollector to RuntimeSelectionTable
  #1
New Member
 
Carl Kohrs
Join Date: Sep 2019
Posts: 22
Rep Power: 7
cckohrs is on a distinguished road
Hi All

I'm using OpenFoam 10 and need to make a custom ParticleCollector. As a first step I copied the standard ParticleCollector and renamed everything myParticleCollector and it compiles. I do add the library to my controlDict but the solver still can't find myParticleCollector to use.

I believe I need to use addToRunTimeSelectionTable for which CloudFunction appears to have a macro: makeCloudFunctionObjectType, which is used in the form: makeCloudFunctionObjectType(ParticleCollector, CloudType); However, when I try to use this (as makeCloudFunctionObjectType(myParticleCollector, CloudType); added to the end of myParticleCollector.C) I get a lot of errors, starting out with CloudType does not name a type. I tried to move the line to the myParticle constructor with the idea that it can use the template argument CloudType and that it gets executed when myParticleCollector is created, but this did not work.

I'm sure I'm missing something simple. Should I start higher up in die code hierarchy instead of just trying to compile my library, i.e. start modifying something that includes the standard particleCollector and replace it with myParticleCollector?
cckohrs is offline   Reply With Quote

Old   October 8, 2023, 14:58
Default
  #2
New Member
 
Carl Kohrs
Join Date: Sep 2019
Posts: 22
Rep Power: 7
cckohrs is on a distinguished road
OK simpler question: I got it to compile by going up the code hierarchy somewhat to makeReactingParcelSubmodels.C. I'm still not getting it in the list. One question I have: how do I know which CloudType my solver uses? I've tried reactingParcel (which didn't work) but there are also collidingParcel, momentumParcel, mppicParcel, reactingMultiphaseParcel, sprayParcel and thermoParcel in the lagranian section of the directory.

I'm using buoyantReactingFoam.

Edit: It's part of the log: "Selecting parcelCloud reactingMultiphaseCloud"

Last edited by cckohrs; October 8, 2023 at 15:07. Reason: Found answer.
cckohrs is offline   Reply With Quote

Old   October 16, 2023, 12:11
Default Answer!
  #3
New Member
 
Carl Kohrs
Join Date: Sep 2019
Posts: 22
Rep Power: 7
cckohrs is on a distinguished road
For any future strugglers: In OpenFoam 10 (and possibly past and future versions, I did not check), the templated (by cloudtype) cloud submodels are used in various make(CloudType)ParcelSubmodels.C file, makeReactingMultiphaseParcelSubmodels.C in my case. What ended up working for me is make my own mymakeReactingMultiphaseParcelSubmodels.C, within which I included only the modified versions of files to compile my custom myParticleCollector, whilst deleting the files for the other submodels (to avoid duplication at runtime).
cckohrs is offline   Reply With Quote

Reply

Tags
programming, runtimeselection


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
Custom Lagrangian Phase Change Model craven.brent OpenFOAM Programming & Development 4 December 25, 2022 20:22
How to add speed of sound (c) into turbulent kinetic energy eqn quarkz OpenFOAM Programming & Development 2 May 3, 2020 22:25
[snappyHexMesh] refineWallLayer vs add layer Astan OpenFOAM Meshing & Mesh Conversion 0 March 18, 2019 13:03
How do I install a custom solver? NJG OpenFOAM Programming & Development 5 January 30, 2013 20:03
Add Measure Markings or Coordinates to the Contour Colin FLUENT 4 August 25, 2004 10:54


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