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

Trying to get kinematicCloud properties in twoPhaseSystem.C

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2019, 02:38
Red face Trying to get kinematicCloud properties in twoPhaseSystem.C
  #1
New Member
 
Bo CHEN
Join Date: Jun 2019
Posts: 2
Rep Power: 0
chenbo is on a distinguished road
Hi guys,
I'm trying to merge the solver DPMFoam with reactingTwoPhaseEulerFoam.
However, I don't know how to access basicKinematicCollidingCloud.theta() in twoPhaseSystem::solve().
In the other thread

Access particle data from functionObject

They suggested using

[CODE] const kinematicCloud& myCloud = obr_lookupObject<kinematicCloud> ("kinematicCloud"); [CODE]

However, when I include "#include basicKinematicCollidingCloud.H" in twoPhaseSystem/twoPhaseSystem.C and add that code, I get errors:

[CODE] error: 'obr_' was not declared in this scope [CODE]

So, can anyone give me some hints about how to change the code to let me get the value of "kinematicCloud.theta()" in twoPhaseSystem::solve() function, just as the theta() could be calculated in DPMFoam?
Thanks!
chenbo is offline   Reply With Quote

Old   June 3, 2019, 05:24
Default
  #2
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 4
raumpolizei is on a distinguished road
Hey chenbo,
well, it looks like the line you cited is missing a point (literally)
Code:
  const kinematicCloud& myCloud = obr_.lookupObject<kinematicCloud> ("kinematicCloud");
However, I am not sure if it is going to compile as obr_ has to be known within the class. What could be worth trying is this (mesh_ is a protected member of phaseSystem, which is the base class of twoPhaseSystem so it should be possible to access it):
Code:
#include "kinematicCloud.H"
/* ... */
const kinematicCloud& lagrangeCloud = this->mesh_.lookupObject<kinematicCloud> ("kinematicCloud");
auto lagrangeTheta = lagrangeCloud.theta();
Good luck with your task.
Cheers
RP
raumpolizei is offline   Reply With Quote

Old   June 3, 2019, 10:29
Default
  #3
New Member
 
Bo CHEN
Join Date: Jun 2019
Posts: 2
Rep Power: 0
chenbo is on a distinguished road
Quote:
Originally Posted by raumpolizei View Post
Hey chenbo,
well, it looks like the line you cited is missing a point (literally)
Code:
  const kinematicCloud& myCloud = obr_.lookupObject<kinematicCloud> ("kinematicCloud");
However, I am not sure if it is going to compile as obr_ has to be known within the class. What could be worth trying is this (mesh_ is a protected member of phaseSystem, which is the base class of twoPhaseSystem so it should be possible to access it):
Code:
#include "kinematicCloud.H"
/* ... */
const kinematicCloud& lagrangeCloud = this->mesh_.lookupObject<kinematicCloud> ("kinematicCloud");
auto lagrangeTheta = lagrangeCloud.theta();
Good luck with your task.
Cheers
RP
Dear raumpolizei,
Thanks for your kindly reply.
1. I did miss a "." in the original post, but I input it right in the code, there's still several errors while compiling, because, as you said, "obr_" is not callable (the compiler suggested using "db_", which was not working either).

2. I did your code, now it compiles well, no errors occur, thanks a lot, really appreciate your help. My research time may be halved by your help.

The forum is really a nice and warm community. I wish I could know OpenFOAM as much as you guys do, so I can post replies to help others.

Now I'll go make some experiments based on the code.
Thanks again. Have a nice day.
chenbo is offline   Reply With Quote

Reply

Tags
twophaseeulerfoam

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 22:29
Adding material to CFX material library marlon CFX 2 October 16, 2016 09:33
Setting the height of the stream in the free channel kevinmccartin CFX 10 July 9, 2015 21:36
error message cuteapathy CFX 14 March 20, 2012 06:45


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