CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Temperature is not calculated in modified CHTMultiregion (https://www.cfd-online.com/Forums/openfoam-programming-development/138038-temperature-not-calculated-modified-chtmultiregion.html)

Gennaro June 27, 2014 04:28

Temperature is not calculated in modified CHTMultiregion
 
Dear all,

I'm working on a modified CHTMultiregion solver in which the energy equation of the fluid part (EEqn.H file) is replaced with:
Code:

{   
    Info<< " ** Calculating CpEff          **\n";       
    CpEff = Cp*pow(T/Tlambda, 5.7);

    Info<< " ** Calculating gT              **\n";       
    gT = pow(rho, 2)*pow(Slambda, 4)*pow(Tlambda, 3)/Alambda; // Instead of Foam::pow

    Info<< " ** Calculating hK              **\n";       
    hK = 4*Sigma*pow(T, 3)*dimensionedScalar("Lref", dimensionSet(0,1,0,0,0), 1);        // Lref is just to have the dimensions of a thermal conductivity
   
    Info<< " ** Calculating fInv            **\n";
    fInv = gT*pow(pow(T/Tlambda, 5.7)*(1 - pow(T/Tlambda, 5.7)), 3);

    Info<< " ** Calculating magSqrGradT    **\n";       
    magSqrGradT = magSqr(fvc::grad(T)) + SMALL;

    Info<< " ** Calculating KEff            **\n";   
    KEff = pow(fInv/magSqrGradT, scalar(1)/scalar(3))/(rho*CpEff);

    Info<< " ** Solving EEqn                **\n";   
    fvScalarMatrix EEqn
    (
        fvm::laplacian(KEff, T)
    );

    Info<< " ** EEqn.relax()                **\n";   
    EEqn.relax();

    Info<< " ** fvOptions.constrain(EEqn)  **\n";   
    fvOptions.constrain(EEqn);

    Info<< " ** EEqn.solve()                **\n";   
    EEqn.solve();

    Info<< " ** fvOptions.correct(T)        **\n";       
    fvOptions.correct(T);

    Info<< " ** thermo.correct()            **\n";
    thermo.correct();

    rad.correct();

    Info<< "Min/max T:" << min(thermo.T()).value() << ' '
        << max(thermo.T()).value() << endl;
}

The solver doesn't crash and the fluid interacts with the solid part.

Unfortunately, the temperature distribution is not calculated! T completely uniform all across the fluid part!

Can anyone help?

I'm happy to send the whole code plus a test case

Thanks

Gennaro

tjliang September 25, 2014 11:55

hello Gennaro,

have you solved your problem? I am also encountering the same problem as to implement temperature in chtmultiregionfoam. If you please, could you please show me how to add one or more temperature equations into chtmultiregionfoam? Thanks.

Peng

Gennaro December 18, 2014 11:16

Hi Peng,

Yes, problem solved! I had to get rid of the code related to the thermophysical properties (they don't apply to helium) in order to have the T field properly written. If you need tips don't hesitate to ask.

Gennaro


All times are GMT -4. The time now is 13:28.