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

why I can not lookupObject using db()?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By kebsiali

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 8, 2015, 20:41
Default why I can not lookupObject using db()?
  #1
New Member
 
wenhaopu
Join Date: Apr 2015
Posts: 2
Rep Power: 0
paulpu318 is on a distinguished road
In twoPhaseEulerFoam, I want to use
"const twoPhaseSystem& fluid = db().lookupObject<twoPhaseSystem>" to get the dispersed phase, but it can not be compiled. the error is : ‘db’ was not declared in this scope const twoPhaseSystem& fluid = db().lookupObject<twoPhaseSystem>
^
I do not know why? Would you like to give me some suggestions?
paulpu318 is offline   Reply With Quote

Old   June 9, 2015, 04:56
Default
  #2
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
not sure but try U_.db()
paulpu318 likes this.
kebsiali is offline   Reply With Quote

Old   June 11, 2015, 19:45
Thumbs up
  #3
New Member
 
wenhaopu
Join Date: Apr 2015
Posts: 2
Rep Power: 0
paulpu318 is on a distinguished road
Quote:
Originally Posted by kebsiali View Post
not sure but try U_.db()
Thank you for your suggestions. I had used alpha1.db() in the expression, and the error message disappeared.But some other error messages appeared.
In fact, I want to add a viscosity model into the kinetic theory model, and it would use the drag force coeff. in the expression, which I do not know how to obtain. So I used the following methods which was used in derivedFvPatchFields,

const twoPhaseSystem& fluid = alpha1.db().lookupObject<twoPhaseSystem>
(
"phaseProperties"
);

const phaseModel& phased
(
fluid.phase1().name() == dimensionedInternalField().group()
? fluid.phase1()
: fluid.phase2()
);

volScalarField beta(phased.fluid().drag(phased).K());//obtain the drag coeff.

Now, the error is :
(1) error: ‘dimensionedInternalField’ was not declared in this scope;
(2) error: invalid use of incomplete type ‘const class Foam::dragModel’
(3) error: forward declaration of ‘const class Foam::dragModel’ class dragModel;

Would you like to give me some more suggestions on how to get the drag coeff.?
By the way, can you give me more explaination on alpha1.db().lookupObject<twoPhaseSystem>? how to understand the expression?
paulpu318 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
lookupObject nimasam OpenFOAM Running, Solving & CFD 3 June 15, 2012 12:23
lookupObject nimasam OpenFOAM Bugs 0 July 3, 2011 07:55
dynamic_cast and lookupObject kev4573 OpenFOAM Programming & Development 0 December 10, 2009 18:12


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