|
[Sponsors] |
April 6, 2010, 04:33 |
Power draw of a mixer
|
#1 |
New Member
Andreas
Join Date: May 2009
Location: Germany
Posts: 13
Rep Power: 16 |
Hi all,
my goal is to evaluate the power draw of a mixer (mixer3D) via the integration of the forces acting on the moving or non-moving parts over the relevant patch. I am an absolute Newbie in OpenFOAM and threw together some Code from the wallShearStree, wallGradU, patchIntegrate utilities and some things i read in the forum. I try to get the velocity gradient with Code:
IOobject Uheader ( "U", runTime.timeName(), mesh, IOobject::MUST_READ ); Info<< " Reading U" << endl; volVectorField U(Uheader, mesh); Info<< " Calculating wallGradU" << endl; volVectorField wallGradU ( IOobject ( "wallGradU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector ( "wallGradU", U.dimensions()/dimLength, vector::zero ) ); forAll(wallGradU.boundaryField(), patchi) { wallGradU.boundaryField()[patchi] = U.boundaryField()[patchi].snGrad(); } Code:
Info<< " Calculating Stress" << endl; volScalarField wallForces ( IOobject ( "wallForces", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), //dynVis*sqrt(sqr(wallGradU.component(vector::X)) + sqr(wallGradU.component(vector::Y))+sqr(wallGradU.component(vector::Z))) dynVis*mag(wallGradU) ); wallForces.write(); Now i want to integrate tau over the faces of the patch, or not? Code:
IOobject fieldHeader ( "wallForces", runTime.timeName(), mesh, IOobject::MUST_READ ); // Check field exists if (fieldHeader.headerOk()) { mesh.readUpdate(); label patchi = mesh.boundaryMesh().findPatchID(patchName); if (patchi < 0) { FatalError << "Unable to find patch " << patchName << nl << exit(FatalError); } const polyPatch& cPatch = mesh.boundaryMesh()[patchi]; const surfaceScalarField& magSf = mesh.magSf(); scalar Power = 0; volScalarField field(fieldHeader, mesh); forAll(cPatch, facei) { Power += magSf.boundaryField()[patchi][facei] * field.boundaryField()[patchi][facei]; } Info<< " Power = " << Power << endl; Can someone give me a hint how i bring this "element" into my code? Or point me to a source where i can find the formula to calcualte the power draw via this method. Thanks in advance. Andi |
|
April 6, 2010, 14:51 |
|
#2 |
Senior Member
|
Hi Andi,
welcome to this board... You might want to have a look at Handbook of Industrial Mixing (page 314)This should give a first approximate number (if one neglects the shear). Hope this helps. best,
__________________
Holger Marschall web: http://www.holger-marschall.info mail: holgermarschall@yahoo.de |
|
April 7, 2010, 15:56 |
|
#3 |
New Member
Andreas
Join Date: May 2009
Location: Germany
Posts: 13
Rep Power: 16 |
Thank you .
Unfortunately I am stuck at the next phase. But now it is more a problem of the OpenFOAM Programming syntax i dont really geht. I try to get torque by summing up the Area of every Face * Pressure on that face * Distance to the Center (= lever arm) My Syntax for that is Code:
##Read the calculated pressure from the corresponding file IOobject pressureHeader ( "p", runTime.timeName(), mesh, IOobject::MUST_READ ); volScalarField pressure(pressureHeader, mesh); #Find IF for the Patch, in that case the Impeller label patchi = mesh.boundaryMesh().findPatchID(patchName); const polyPatch& cPatch = mesh.boundaryMesh()[patchi]; #I guess this reads the areasizes const surfaceScalarField& magSf = mesh.magSf(); forAll(cPatch, facei) { Torque += magSf.boundaryField()[patchi][facei] * mag(pressure.boundaryField()[patchi][facei])* Foam::sqrt( sqr(pressure.mesh().boundary()[patchi].Cf()[facei][0])+ sqr(pressure.mesh().boundary()[patchi].Cf()[facei][1]) ); } mag(pressure.boundaryField()[patchi][facei]) = pressure on that face? pressure.mesh().boundary()[patchi].Cf()[facei][0] = The x-Coordinate of the Center of the face? The results i get are to low by arround 1E-2 so i guess i have a missunderstanding in the Syntax of OpenFOAM, if someone could lighten me up i would be very grateful. Andi |
|
April 8, 2010, 05:38 |
|
#4 |
New Member
Andreas
Join Date: May 2009
Location: Germany
Posts: 13
Rep Power: 16 |
If somebody is interested:
I wrote a little Tool for turbulent flows which calculates the powerdraw from the Epsilon-Term, P = rho * Integral(Epsilon dV) andi |
|
June 14, 2010, 15:43 |
|
#5 |
New Member
Join Date: Jun 2010
Posts: 14
Rep Power: 15 |
Hi!
I'm a beginner at OpenFOAM and I'd like some help if possible. I have to calculate the circulation in a vortex. My code is as follows: Code:
#include "calc.H" #include "fvc.H" void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { volScalarField magVorticity // Imports the results of the vorticity of the vortex ( IOobject ( "magVorticity", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); scalar circulation = 0.0; scalar r = 0.0; const volScalarField& magSf = mesh.magSf(); forAll(magVorticity, cellI) { if (distance < r[cellI]) // If the radius (distance) stays lower than the critical radius (r)... { circulation += magSf.magVorticity[cellI]; // ...calculation of the circulation. } } } Code:
SOURCE=MaxVorCirc.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/postProcessing/postCalc -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MaxVorCirc.o MaxVorCirc.C: In function ‘void Foam::calc(const Foam::argList&, const Foam::Time&, const Foam::fvMesh&)’: MaxVorCirc.C:89: error: invalid types ‘Foam::scalar[Foam::label]’ for array subscript MaxVorCirc.C:94: error: ‘magSf’ was not declared in this scope make: *** [Make/linux64GccDPOpt/MaxVorCirc.o] Error 1 Thank you in advance! Maxime |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Non-Newtonian Power Law for Viscosity | John | FLUENT | 16 | September 12, 2015 06:18 |
Wind Power | Frank Grassi | FLUENT | 0 | October 12, 2007 11:20 |
power curve of windmills with CFD | sayid | FLUENT | 2 | March 28, 2007 09:55 |
Non newtonian power law model in pipe annulus | Poly | FLUENT | 0 | March 24, 2005 15:12 |
Intl Conf Computational Methods in Fluid Power | Jacek Stecki | Main CFD Forum | 0 | November 10, 2002 05:49 |