CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

application help

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 15, 2013, 11:57
Default application help
  #1
New Member
 
edoardo
Join Date: Nov 2010
Posts: 8
Rep Power: 6
albertofast is on a distinguished road
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;
}
Can you help me please? Thank you very much!
albertofast is offline   Reply With Quote

Old   May 15, 2013, 12:33
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,553
Rep Power: 23
ngj will become famous soon enoughngj will become famous soon enough
Hi Edoardo,

I cannot see that you have defined the rho variable? This for one will give you compilation errors.

Kind regards

Niels
ngj is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD Post Application Error: 'wbload' action requires parameter: 'id'. gusymtz ANSYS 2 October 20, 2014 05:28
what should we do for the application of CUDA in CFD? aerosjc Main CFD Forum 6 February 25, 2013 12:01
Others library application for OpenFoam 1.5 in Windows lcnmy OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 2 July 21, 2010 21:54
Installation of OpenFOAM15dev antonio_ing OpenFOAM Installation 34 December 18, 2009 11:06
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 8 March 12, 2008 06:58


All times are GMT -4. The time now is 11:10.