|
[Sponsors] |
June 8, 2015, 20:41 |
why I can not lookupObject using db()?
|
#1 |
New Member
wenhaopu
Join Date: Apr 2015
Posts: 2
Rep Power: 0 |
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? |
|
June 9, 2015, 04:56 |
|
#2 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
not sure but try U_.db()
|
|
June 11, 2015, 19:45 |
|
#3 |
New Member
wenhaopu
Join Date: Apr 2015
Posts: 2
Rep Power: 0 |
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? |
|
|
|
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 |