|
[Sponsors] |
invoking volVectorField class parameter which exist in "0" folder |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 8 ![]() |
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 07:38. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 8 ![]() |
no body no suggestion?
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
|
Hi Kasra,
Maybe you can try const label patchI = U.mesh().boundaryMesh().findPatchID("inlet"); const vectorField Uinlet = U.boundaryField()[patchI]; |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 8 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Kasra
Join Date: Aug 2014
Posts: 29
Rep Power: 8 ![]() |
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 |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 06:38 |
[PyFoam] running pyFoam(Plot)Runner.py in parallel | Studi | OpenFOAM Community Contributions | 10 | September 6, 2015 17:38 |
meshing of a compound volume in GMSH | shawn3531 | OpenFOAM | 4 | March 12, 2015 11:45 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |