CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   dpdt-term in energy equation of buoyantPimpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/131319-dpdt-term-energy-equation-buoyantpimplefoam.html)

JensP March 13, 2014 03:53

dpdt-term in energy equation of buoyantPimpleFoam
 
Hello all,

I am simulating a buoyancy-driven flowcase with large temperature gradients using the buoyantPimpleFoam solver in OF2.3. The fluid (water) is between 15C and 285C and its thermophysical properties are set using polynoms to have them vary with temperature:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
    type            heRhoThermo;
    mixture        pureMixture;
    transport      polynomial;
    thermo          hPolynomial;
    equationOfState icoPolynomial;
    specie          specie;
    energy          sensibleEnthalpy;
}
 
dpdt off;
 
// coefficients for water @ 70 bar
mixture
{
        specie
    {
        nMoles          1;
        molWeight      18;
    equationOfState
    {
          rhoCoeffs<8>    (-652.130039068252 17.3072281049247 -0.0530706424954250 -4.46788703056841e-05 6.61015720039410e-07 -1.70342449898889e-09 1.94284389663358e-12 -8.64283583580195e-16);
    }
    thermodynamics
    {
        Hf              0; //heat of formation, input in J/kg
        Sf              0; //standard entropy J/kg/K
        //cp (J/kg) by definition not a function of pressure.
  CpCoeffs<8>    (-123868.395198191 2386.30977759511 -18.8516975602727 0.0819407624259010 -0.000211924050467349 3.26503697953756e-07 -2.77731495587309e-10 1.00765751262485e-13);
    }
    transport
    {
//dynamic viscosity kg/ms
      muCoeffs<8>    (0.907124928631493 -0.0143820511516075 9.76703409945348e-05 -3.67596758496769e-07 8.27176723626825e-10 -1.11210240552212e-12 8.26794094903911e-16 -2.62140652993808e-19);
//Thermal conductivity W/mK
  kappaCoeffs<8>  (44.3118446931015 -0.773151693822239 0.00570642822582130 -2.29415112216040e-05 5.45444040085740e-08 -7.69316563660768e-11 5.97198703640727e-14 -1.97170654681780e-17);
    }
}

I know 8 coefficients is a bit much, but let's ignore that for a moment.
Since the equationOfState is set as icoPolynomial, this means we will have no compressibility in the fluid, which is fine since it is water we're dealing with here. However, simulating this WITHOUT the flag "dpdt off;" as seen above, leads to divergence almost for all cases I've tried.
Simulating WITH the flag "dpdt off;" gives good results, and I'm happy with using that.

My question is: where does this dpdt term come from? If we take a look at the source code for solving the energy equation in the buoyantPimpleFoam solver:

Code:

{
    volScalarField& he = thermo.he();
    fvScalarMatrix EEqn
    (
        fvm::ddt(rho, he) + fvm::div(phi, he)
      + fvc::ddt(rho, K) + fvc::div(phi, K)
      + (
            he.name() == "e"
          ? fvc::div
            (
                fvc::absolute(phi/fvc::interpolate(rho), U),
                p,
                "div(phiv,p)"
            )
          : -dpdt
        )
      - fvm::laplacian(turbulence->alphaEff(), he)
    ==
        radiation->Sh(thermo)
      + fvOptions(rho, he)
    );
    EEqn.relax();
    fvOptions.constrain(EEqn);
    EEqn.solve();
    fvOptions.correct(he);
    thermo.correct();
    radiation->correct();
}

we find the dpdt term implemented in the energy equation. The problem is, I can't find the term in any theory books. Am I looking in the wrong places, or is this dpdt term a rewritten form of something else? What is actually happening when I set "dpdt off"? I just want to make sure I can do it in good confidence.

Any input on this matter, or the general apporoach of this problem, is appreciated.

// Jens

jherb March 13, 2014 09:39

dpdt is a field defined in createFields.H of the solver.
Code:

    Info<< "Creating field dpdt\n" << endl;
    volScalarField dpdt
    (
        IOobject
        (
            "dpdt",
            runTime.timeName(),
            mesh
        ),
        mesh,
        dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
    );

In pEqn.H it is updated after the pressure equation is solved:
Code:

    if (thermo.dpdt())
    {
        dpdt = fvc::ddt(p);
    }

If dpdt is set to off (or false) then nothing is done here. Otherwise the (explicit) time derivative of p is saved in this field.

JensP March 13, 2014 10:55

Thank you for your reply Joachim.

Yes, I understand how the dpdt term is implemented in the code, but I guess this question is more about how theory is implemented in OpenFOAM.

So to clarify, why does buoyantPimpleFoam have the dpdt term in the energy equation AT ALL? Again, I could be looking in the wrong places, but I simply can't find it in any books on fluid dynamics.

jherb March 13, 2014 11:24

E.g. the derivation of the (total) enthalpy equation (equation 2.27) in Versteeg et Malalasekera, An Introduction to Computational Fluid Dynamics - The Finite Volume Method (2nd edition) or equation 1.86 in the Theory Manual of CFX.

Or here: http://www.cfd-online.com/Forums/ope...-enthalpy.html

JensP March 14, 2014 07:15

Ah, thank you. Now i feel stupid, I was looking at the completely wrong equation. That is exactly what I needed to know, thanks!


All times are GMT -4. The time now is 00:02.