|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
don lenardo
Join Date: Nov 2010
Posts: 46
Rep Power: 4 ![]() |
Hello,
I am an OF Newbie and want to set up a case of a pump turbine in OF 1.6. Therefor I have to integrate some additionally variables of the Velocity in 3 different local coordinate systems, such as: U_new1=Ux*cos(10°)+Uy*sin(10°) U_new2=Ux*cos(12°)+Uy*sin(12°) U_new3=Ux*cos(30°)+Uy*sin(30°) Can anyone tell me, where I have to define this 3 velocities and in which Script I have to perform this Integration? Or do you think it's better to output the standard Velocity U and transform it later during post? Thanks in advance. Regards Markus |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 7 ![]() |
Hi Markus,
The x-component of a field, here U, is U.component(0). The y- and z-components would be U.component(1) and U.component(2), respectively. Now, the way you have written it gives a volScalarField, not a volVectorField (like U itself). For instance, you could plug the following in the solver after U is solved: Code:
scalar angle1 = mathematicalConstant::pi/6.0;
volScalarField Unew =
U.component(0) * Foam::cos(angle1)
+ U.component(1) * Foam::sin(angle1);
Code:
Info << "Reading field Unew\n" << endl;
volScalarField Unew
(
IOobject
(
"Unew",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
If you'd like to write every time step, function objects are handy. In your case probably the turboPerformance function objects. Hope this helps you on your way a bit!
__________________
Regards, Gijs |
|
|
|
|
|
|
|
|
#3 |
|
Member
don lenardo
Join Date: Nov 2010
Posts: 46
Rep Power: 4 ![]() |
Hy Gijsbert,
thank you very much for your instruction!Now, I have to think about if it's necessary to perfom the transformation during solving - in my opinion this may rise the calculation time?! For this reason I think it's much easier to output only the velocity U and to create a script in python during post,which transform it to local coordinate systems. Regards Markus |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 382
Rep Power: 7 ![]() |
Hi Markus,
Sure, the calculation, although small, will take some time. You could use the U file in the time step directories. This, however, only gives you data at write time. If you need data at every time step I suggest to either use a function object or put the above code in and write out the data in an info statement to a log file. For that simply add Code:
Info << "Unew = " << Unew << endl; Code:
somethingFoam > log &
__________________
Regards, Gijs |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| k-omega-SST model (OF 1.6) - turbulent flat plate | cboss | OpenFOAM Running, Solving & CFD | 23 | November 13, 2011 01:28 |
| Accessing other variables in defining boundary condition | Cynthia Poon | OpenFOAM Running, Solving & CFD | 0 | March 25, 2009 04:36 |
| Defining New Variables | Tim | Phoenics | 0 | September 30, 2003 14:52 |
| PHI file structure | Eugene | Phoenics | 9 | November 2, 2001 22:00 |
| Saving variables on a user patch with physical coordinates | Zoltan Turzo | CFX | 2 | April 20, 2000 15:05 |