|
[Sponsors] |
May 15, 2013, 10:57 |
application help
|
#1 |
New Member
edoardo
Join Date: Nov 2010
Posts: 8
Rep Power: 15 |
Dear users, I'm using openfoam 2.1 and I need to create a post-processing application to get this filed:
acoSor=rho*fvc::div(fvc::div(U*U)) This field can be used as a source term for a FW-H acoustic solver. I already tried to modify other utilities (for example the one for vorticity) and get it done, but I always get errors. this is my code actually Code:
#include "calc.H" #include "fvc.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { bool writeResults = !args.optionFound("noWrite"); IOobject Uheader ( "U", runTime.timeName(), mesh, IOobject::MUST_READ ); if (Uheader.headerOk()) { Info<< " Reading U" << endl; volVectorField U(Uheader, mesh); Info<< " Calculating vorticity" << endl; volScalarField acoSor ( IOobject ( "acoSor", runTime.timeName(), mesh, IOobject::NO_READ ), rho*fvc::div(fvc::div(U*U)) ); Info<< " Calculating acoSor" << endl; if (writeResults) { acoSor.write(); } } else { Info<< " No U" << endl; } Info<< "\nEnd\n" << endl; } |
|
May 15, 2013, 11:33 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Edoardo,
I cannot see that you have defined the rho variable? This for one will give you compilation errors. Kind regards Niels |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD Post Application Error: 'wbload' action requires parameter: 'id'. | gusymtz | ANSYS | 5 | October 10, 2022 16:29 |
Is Playstation 3 cluster suitable for CFD work | hsieh | OpenFOAM | 9 | August 16, 2015 14:53 |
what should we do for the application of CUDA in CFD? | aerosjc | Main CFD Forum | 6 | February 25, 2013 11:01 |
Others library application for OpenFoam 1.5 in Windows | lcnmy | OpenFOAM Installation | 2 | July 21, 2010 20:54 |
Installation of OpenFOAM15dev | antonio_ing | OpenFOAM Installation | 34 | December 18, 2009 10:06 |