CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Help with the units of enthalpy (h) in chtMultiRegionFoam (https://www.cfd-online.com/Forums/openfoam/137567-help-units-enthalpy-h-chtmultiregionfoam.html)

zfaraday June 18, 2014 14:11

Help with the units of enthalpy (h) in chtMultiRegionFoam
 
Hello everybody,

I'm struggling to understand how to set up a heat source in a solid region using the fvOptions framework with chtMultiregionFoam solver. However, I need to understand the governing equation used by the program. This is the equation found in the solveSolid.H file:

Code:

        tmp<fvScalarMatrix> hEqn
        (
            fvm::ddt(betav*rho, h)
          - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
          ==
            fvOptions(rho, h)
        );

The first doubt that came to my mind at first was the meaning of betav, I think it is a coefficient that switches between 0 and 1 when the region is a fluid or a solid domain, am I right? Otherwise I can't figure out its meaning...

Now, here come the main doubts I have:
  • Is alpha equal to kappa/(rho*cp)? If so, How is its value retrieved by the program? Because it is not defined in constant/thermoProperties file...
  • Does the exression fvOptions(rho, h) mean that the value of h is multipied by rho somewhere? I was told something like that a few days ago but I don't see it...
  • And finally, what are the units of h within the equation? I started assuming that they were J/kg but I can't find it after taking some notes on paper.

That's all by now, I will appreciate any hint provided.

Many thanks in advance! :)


Alex

Martin_K_lalelu June 24, 2014 02:33

Hi Alex,

did you yet manage to solve your problem?

I got stuck on the same issue, how do I include a heat source in the hEqn and what are the enthalpy`s dimensions?

If you were able to make any progress, I would really appreciate if you could share some Infos!

Best regards,

Martin


Edit: The dimension seems to be J/kg. Info << mag(h) << provides a dimension set of [0 2 -2 0 0 0 0]

zfaraday June 24, 2014 10:04

Quote:

Originally Posted by Martin_K_lalelu (Post 498380)
Hi Alex,

did you yet manage to solve your problem?

I got stuck on the same issue, how do I include a heat source in the hEqn and what are the enthalpy`s dimensions?

If you were able to make any progress, I would really appreciate if you could share some Infos!

Best regards,

Martin


Edit: The dimension seems to be J/kg. Info << mag(h) << provides a dimension set of [0 2 -2 0 0 0 0]

Hello Martin!

I wish I could give you a positive message, but no, I'm still waiting for any hint. Whenever I find a solution I will let you know. I hope you do the same in case you find it first :P

Thanks for what you said about about the dimensions of enthalpy, where did you find it out? I have been lookig for it like crazy with no success.

Cheers


Alex

Martin_K_lalelu June 25, 2014 03:27

Hi,

I saved the Enthalpy in solveSolid.H into a custom variable and made an output with
Code:

Info << "myEnthalpy= " << myEnthalpy << nl << endl;
during runtime. There the dimension set was printed, too.

alexeym June 25, 2014 04:38

Hi,

Quote:

Is alpha equal to kappa/(rho*cp)? If so, How is its value retrieved by the program? Because it is not defined in constant/thermoProperties file...
If you take a look at solid/setRegionSolidFields.H, you can see

Code:

tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();

So alpha is acquired from thermophysical model. And in most of them it is defined as kappa/Cp.

Quote:

Does the exression fvOptions(rho, h) mean that the value of h is multipied by rho somewhere? I was told something like that a few days ago but I don't see it...
Well, almost. Here's the code for the operator:

Code:

template<class Type, class RhoType>
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
    const RhoType& rho,
    GeometricField<Type, fvPatchField, volMesh>& fld,
    const word& fieldName
)
{
    checkApplied();
   
    const dimensionSet ds = rho.dimensions()*fld.dimensions()/dimTime*dimVolume;

    tmp<fvMatrix<Type> > tmtx(new fvMatrix<Type>(fld, ds));

    fvMatrix<Type>& mtx = tmtx();
...

Quote:

And finally, what are the units of h within the equation? I started assuming that they were J/kg but I can't find it after taking some notes on paper.
If you again look at solid/setRegionSolidFields.H

Code:

...
solidThermo& thermo = thermos[i];
...
volScalarField& h = thermo.he();
...

and then if you look at thermophysicalModels/basic/basicThermo/basicThermo.H (parent of solidThermo)

Code:

            //- Enthalpy/Internal energy [J/kg]
            //  Non-const access allowed for transport equations
            virtual volScalarField& he() = 0;


zfaraday June 25, 2014 16:56

Thank you so much Alexey, that was exactly what I was looking for! :)

Quote:

Originally Posted by alexeym (Post 498569)
Hi,



If you take a look at solid/setRegionSolidFields.H, you can see

Code:

tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();

So alpha is acquired from thermophysical model. And in most of them it is defined as kappa/Cp.

Then alpha is not exactly the thermal diffusivity, since thermal diffusivity (aka alpha) is kappa/(rho*Cp), am I right?

Quote:

Well, almost. Here's the code for the operator:

Code:

template<class Type, class RhoType>
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
    const RhoType& rho,
    GeometricField<Type, fvPatchField, volMesh>& fld,
    const word& fieldName
)
{
    checkApplied();
   
   const dimensionSet ds = rho.dimensions()*fld.dimensions()/dimTime*dimVolume;

    tmp<fvMatrix<Type> > tmtx(new fvMatrix<Type>(fld, ds));

    fvMatrix<Type>& mtx = tmtx();
...


Well, that's quite scary at first sight when you have no strong skills with C++... :P

I understand that I was pointing at the right direction, I only forgot to divide it by the time and multiply it by the volume, right? I guess that the field called fld in my case would be h(J/kg), then what is given by fvOptions would be Watts, is it right?



Quote:

If you again look at solid/setRegionSolidFields.H

Code:

...
solidThermo& thermo = thermos[i];
...
volScalarField& h = thermo.he();
...

and then if you look at thermophysicalModels/basic/basicThermo/basicThermo.H (parent of solidThermo)

Code:

            //- Enthalpy/Internal energy [J/kg]
            //  Non-const access allowed for transport equations
            virtual volScalarField& he() = 0;


As I said before, many thanks for your clarifying explanations. You helped me a lot understanding it.

Regards,


Alex

alexeym June 26, 2014 07:21

Quote:

Originally Posted by zfaraday (Post 498693)
Then alpha is not exactly the thermal diffusivity, since thermal diffusivity (aka alpha) is kappa/(rho*Cp), am I right?

Well, I'd say here it's implicitly divided by rho. As you can see in ddt operator, it's not ddt(h), it's ddt(rho, h), while in laplacian term it's just h.

Quote:

I understand that I was pointing at the right direction, I only forgot to divide it by the time and multiply it by the volume, right? I guess that the field called fld in my case would be h(J/kg), then what is given by fvOptions would be Watts, is it right?
Yes.


All times are GMT -4. The time now is 01:58.