CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

Mach number in openFOAM

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

Like Tree2Likes
  • 1 Post By immortality
  • 1 Post By immortality

Reply
 
LinkBack Thread Tools Display Modes
Old   August 27, 2013, 17:50
Smile Mach number in openFOAM
  #1
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 181
Rep Power: 5
Alhasan is on a distinguished road
Dear all,

i have done a RANS simulation using KWSST model with temperature.

now i want to see the mach fields around my aircraft so, when i type Mach its asking for thermophysicalProperties ?

so has any body used the Mach function in openFOAM and how does this work what is this thermophysicalproperties ? i dunno what are the values within that mean.

it will be very helpful if someone tells me what is happening

Thanks,
Hasan.
Alhasan is online now   Reply With Quote

Old   August 28, 2013, 04:08
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
which solver do you use?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 28, 2013, 04:11
Default
  #3
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 181
Rep Power: 5
Alhasan is on a distinguished road
boutantboussiqsimplefoam

please temme if i have to use some thing else..
Alhasan is online now   Reply With Quote

Old   August 28, 2013, 04:58
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
I haven't used this solver,tell me whats your case to run exactly.
and put the error you get.but it seems that a field that is needed for Mach utility isn't there in time folders.
what files are there in your time folders?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 28, 2013, 13:07
Default
  #5
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 181
Rep Power: 5
Alhasan is on a distinguished road
K, Kappat, Nut, T, P, P_rgh, Omega, U

and i want to know what are the things that is gonna be there in the thermodynamics properties ! folder and how do i find these things that i need for mach

when i put
R 287;
Cp 1005;
Cv 716;
Hf 0; (i dunno whats Hf) just got from some where !! don rem where do i need it ?

its saying unknown value for 287
just what should be there on thermodynamics properties i wanna know

Thanks for your time

Hasan K.J.
Alhasan is online now   Reply With Quote

Old   August 28, 2013, 15:22
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
its Mach utility code.send your case to have a look into it if you could.
Code:
Application
    Mach

Description
    Calculates and optionally writes the local Mach number from the velocity
    field U at each time.

    The -nowrite option just outputs the max value without writing the field.

\*---------------------------------------------------------------------------*/

#include "calc.H"
#include "fluidThermo.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
    );

    IOobject Theader
    (
        "T",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ
    );

    // Check U and T exists
    if (Uheader.headerOk() && Theader.headerOk())
    {
        autoPtr<volScalarField> MachPtr;

        volVectorField U(Uheader, mesh);

        if
        (
            IOobject
            (
                "thermophysicalProperties",
                runTime.constant(),
                mesh
            ).headerOk()
        )
        {
            // thermophysical Mach
            autoPtr<fluidThermo> thermo
            (
                fluidThermo::New(mesh)
            );

            volScalarField Cp(thermo->Cp());
            volScalarField Cv(thermo->Cv());

            MachPtr.set
            (
                new volScalarField
                (
                    IOobject
                    (
                        "Ma",
                        runTime.timeName(),
                        mesh
                    ),
                    mag(U)/(sqrt((Cp/Cv)*(Cp - Cv)*thermo->T()))
                )
            );
        }
        else
        {
            // thermodynamic Mach
            IOdictionary thermoProps
            (
                IOobject
                (
                    "thermodynamicProperties",
                    runTime.constant(),
                    mesh,
                    IOobject::MUST_READ_IF_MODIFIED,
                    IOobject::NO_WRITE
                )
            );

            dimensionedScalar R(thermoProps.lookup("R"));
            dimensionedScalar Cv(thermoProps.lookup("Cv"));

            volScalarField T(Theader, mesh);

            MachPtr.set
            (
                new volScalarField
                (
                    IOobject
                    (
                        "Ma",
                        runTime.timeName(),
                        mesh
                    ),
                    mag(U)/(sqrt(((Cv + R)/Cv)*R*T))
                )
            );
        }

        Info<< "Mach max : " << max(MachPtr()).value() << endl;

        if (writeResults)
        {
            MachPtr().write();
        }
    }
    else
    {
        Info<< "    Missing U or T" << endl;
    }

    Info<< "\nEnd\n" << endl;
}


// ************************************************************************* //
Alhasan likes this.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 28, 2013, 15:37
Talking
  #7
Senior Member
 
Alhasan's Avatar
 
Hasan K.J.
Join Date: Dec 2011
Location: Bristol, United Kingdom
Posts: 181
Rep Power: 5
Alhasan is on a distinguished road
R R [0 -2 2 0 0 ] 287;
Cp Cp [0 -2 2 0 0 ] 1005;
Cv Cv [0 -2 2 0 0 ] 716;
Hf Hf [0 0 0 0 0 ]; this one is not needed.... supposedly lol.. dint know where i even got that from

I just kept playing around and it worked... with the above values, thanks for your initiative to help

- i have small Question what does this [0 -2 2 0 0 ] mean..? when i Put [0 0 0 0 0] for all it dint work by some shear luck i copy pasted something and it worked, i know there are called dimensions are some thing

can u please explain if u know what it is, coz i have sorted out the problem by luck i wanna know what it is

Thanks
Alhasan is online now   Reply With Quote

Old   August 28, 2013, 16:22
Default
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi
see about dimensions in guide in doc folder of OpenFOAM.there its explained.in some solvers you should add dimensions too.I haven't worked with the solver you said.
Alhasan likes this.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Stable boundaries marcoymarc CFX 33 March 13, 2013 07:39
Mesh Refinement Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Mesh Utilities 41 January 17, 2013 03:43
plotting/monitoring maximum Mach number alpha754293 CFX 7 June 25, 2012 20:40
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37


All times are GMT -4. The time now is 15:31.