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

Accessing sprayCloud functions from parcelCloud read from objectRegistry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2022, 16:34
Default Accessing sprayCloud functions from parcelCloud read from objectRegistry
  #1
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Hey all,

In cloudInfo functionObject the cloud is read from the object registry as a base class parcelCloud, and some information is printed out. I want to extend this functionObject to print out more information about my cloud, which is a SprayCloud, a child class of parcelCloud. There are functions and methods defined only in the child class, and I cannot access them from the parent object. I tried dynamic casting to a SprayCloud type but it did not work. How can I access the methods and functions of a child cloud type by using the parent cloud type object I read from the objectRegistry?

https://github.com/OpenFOAM/OpenFOAM...gian/cloudInfo

Thanks!

Bulut
blttkgl is offline   Reply With Quote

Old   September 27, 2022, 12:28
Default
  #2
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Dear all,

Quick update. Following dynamic_cast assignment did the trick:

Code:
const sprayCloud& cloud = dynamic_cast<const sprayCloud&>(obr_.lookupObject<parcelCloud>(cloudName));
Hope this helps someone,

Bulut
blttkgl is offline   Reply With Quote

Reply


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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
999999 (../../src/mpsystem.c@1123):mpt_read: failed:errno = 11 UDS_rambler FLUENT 2 November 22, 2011 09:46
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 14:37


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