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/)
-   -   B.C.:externalWallHeatFluxTemperature - different treatment of inand out heatflux? (https://www.cfd-online.com/Forums/openfoam-solving/130229-b-c-externalwallheatfluxtemperature-different-treatment-inand-out-heatflux.html)

wc34071209 February 21, 2014 15:36

B.C.:externalWallHeatFluxTemperature - different treatment for in and out heatflux
 
Hello Foamers,

I took a look at the source code of B.C.externalWallHeatFluxTemperature

and I find that there is a different treatment for inflow heat flux and outflow heat flux.

Does anybody know the theory behind this?

Thanks.

The code is copied here:

Code:


    if (oldMode_ == fixedHeatFlux)
    {
        q = q_;
    }
    else if (oldMode_ == fixedHeatTransferCoeff)
    {
        q = (Ta_ - *this)*h_;
    }
    else
    {
        FatalErrorIn
        (
            "externalWallHeatFluxTemperatureFvPatchScalarField"
            "::updateCoeffs()"
        )  << "Illegal mode " << operationModeNames[oldMode_]
            << exit(FatalError);
    }


    forAll (*this, i)
    {
        if (q[i] > 0) //in
        {
            this->refGrad()[i] = q[i]/KWall[i];
            this->refValue()[i] = 0.0;
            this->valueFraction()[i] = 0.0;
        }
        else //out
        {
            this->refGrad()[i] = 0.0;
            this->refValue()[i] = q[i]/KDelta[i] + patchInternalField()()[i];
            this->valueFraction()[i] = 1.0;
        }
    }


wc34071209 February 22, 2014 08:32

It seems when heat flux is in a fixedGradient b.c. is applied, whereas when heat flux is out, a fixedValue b.c. is applied.

I am totally confused for what reasons OF employs such a strategy.

wc34071209 February 26, 2014 07:19

nobody is interested? I am eager to know.


All times are GMT -4. The time now is 20:43.