Adding new lookup parameter to OF21
1 Attachment(s)
Hello all
I want to add a new dimensionless parameter to pimpleFoam in OF21. I know that if I add these lines to OF6 or OF7, it will work, but it does not work in OF21; Code:
dimensionedScalar FFarzad Error; Code:
pimpleFoamEpsilonGeneral.C: In function ‘int main(int, char**)’: Farzas |
The reason for that is, that the transport properties dictionary gets defined within the createFields.H file in OF6. I assume that it gets initialized somewhere else
Most probably this dictionary is defined elsewhere (after the createFields.H) file or within an object. Since I'm not familiar with the ESI version, but maybe this will work out for you: Make a reference to the dictionary Code:
const dictionary& transportProperties = db().lookupObject<IOdictionary>("transportProperties"); Code:
dimensionedScalar FFarzad It should also be possible to gain acces by following code, but I dont know exactly. Code:
dimensionedScalar FFarzad |
Thanks überschwupper. It worked, but what about scalar lookup?
I used below code and it gives me error; Code:
scalar prescribedTKE; Code:
pimpGeneral.C:217:61: error: ‘prescribedTKE’ cannot be used as a function Farzad |
This solves the problem for scalars;
Code:
IOdictionary transportProperties Quote:
|
Quote:
When you want to initialize your variable, then you need a declarator to use the direct initialization. If you want to seperate the declaration and the definition you have to use the assignment operator, otherwise it will be regocnized as a function. Code:
scalar prescribedTKE(transportProperties.lookup<scalar>("prescribedTKE")); should work fine. |
All times are GMT -4. The time now is 10:50. |