|
[Sponsors] |
invoking volVectorField class parameter which exist in "0" folder |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 14, 2016, 16:15 |
invoking volVectorField class parameter which exist in "0" directory to .c file drag
|
#1 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 11 |
Hi dears,
I want to lookup or invoke Ub (inflow air velocity at inlet) to drag model (.c file). Ub is valued in "0" directory and is volVectorField type but its not important for me to keep type class, in other word scalar output is better for me. I apply "twoPhaseEulerFoam" solver of 2.1.1 OF and drag model is "GidaspowErgunWenYu". Would you please guide me. Last edited by k.farnagh; June 22, 2016 at 06:38. |
|
June 23, 2016, 06:44 |
|
#2 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 11 |
no body no suggestion?
|
|
June 23, 2016, 23:01 |
|
#3 |
New Member
|
Hi Kasra,
Maybe you can try const label patchI = U.mesh().boundaryMesh().findPatchID("inlet"); const vectorField Uinlet = U.boundaryField()[patchI]; |
|
June 24, 2016, 06:55 |
|
#4 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 11 |
Hi Dear Jianzhi,
Thanks for reply, As I'm newcomer in coding would you please explain where should I put them. .c file of drag model --> member function or somewhere else? furthermore should I include some .H file, change Constructor or ...? Sincerely Yours Kasra |
|
June 24, 2016, 10:25 |
|
#5 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 11 |
Hi,
I've added below code to end of Member Function of "GidaspowErgunWenYu.c" and nothing else. Code:
Info<< "Looking up field Ub\n" << endl; const volVectorField& Ub = Ub.mesh().lookupObject<volVectorField>("Ub"); Info<< "Reading inlet velocity uInlet\n" << endl; scalar UInlet = 0.0; const label inletI = Ub.mesh().boundaryMesh().findPatchID("inlet"); const fvPatchVectorField& fvp = Ub.boundaryField()[inletI]; if (fvp.size()) { UInlet = fvp[0].y(); } reduce(UInlet, maxOp<scalar>()); Code:
dragModels/GidaspowErgunWenYulogvelo/GidaspowErgunWenYulogvelo.C:98:36: warning: ‘Ub’ may be used uninitialized in this function [-Wmaybe-uninitialized] const volVectorField& Ub = Ub.mesh().lookupObject<volVectorField>("Ub"); would you please guide me to solve it. thanks again Jianzhi. Sincerely Yours, Kasra |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The udf.h headers are unable to open- in VISUAL STUDIO 13 | sanjeetlimbu | Fluent UDF and Scheme Programming | 4 | May 2, 2016 05:38 |
[PyFoam] running pyFoam(Plot)Runner.py in parallel | Studi | OpenFOAM Community Contributions | 10 | September 6, 2015 16:38 |
meshing of a compound volume in GMSH | shawn3531 | OpenFOAM | 4 | March 12, 2015 10:45 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 22:03 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |