/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2506                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     rhoCentralFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.00108;

deltaT          0.000000001;

writeControl    adjustable;

writeInterval   0.000001;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

graphFormat     raw;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           0.5;

maxDeltaT       1;

/*functions
{
    MachNo
    {
        type            MachNo;
        libs            ("libfieldFunctionObjects.so");
        writeControl    runTime;
        writeInterval   0.00001;
    }

    
   
}*/

functions
{
    // Mach number field (optional but useful)
    MachNo
    {
        type            MachNo;
        libs            ("libfieldFunctionObjects.so");
        writeControl    runTime;
        writeInterval   0.000001;
    }

    // Total (stagnation) pressure p0 field
    p_total
    {
        type            pressure;
        libs            ("libfieldFunctionObjects.so");

        mode            total;      // static | total | isentropic | ...

        p               p;          // static/thermodynamic pressure
        U               U;          // velocity
        rho             rho;        // density
        pRef            0;

        // write p0 at normal write times
        writeControl    writeTime;
    }

    // Total temperature T0 field
    T_total
    {
        type            exprField;
        libs            ("libfieldFunctionObjects.so");

        field           T0;
        action          new;
        dimensions      [0 0 0 1 0 0 0];

        // Cp ≈ 1004.5 J/(kg K) for air (gamma=1.4, R=287)
        expression      "T + magSqr(U)/(2*1004.5)";

        // create/update T0 each time step and write with normal output
        autowrite       true;
        executeControl  timeStep;
        executeInterval 1;
        writeControl    writeTime;
    }
}



// ************************************************************************* //
