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/)
-   -   Fixed heat flux BC in buoyantPimpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/86728-fixed-heat-flux-bc-buoyantpimplefoam.html)

bhh March 31, 2011 09:10

Fixed heat flux BC in buoyantPimpleFoam
 
Hi,

I am running buoyantPimpleFoam with a built-in boundary condition for heat transfer based on heat transfer coefficient (aphaWall) and outside temperature (Tinf) like this:

window
{
type wallHeatTransfer;
alphaWall uniform 1.5;
Tinf uniform 263;
value uniform 293.;
}

This work perfectly.

Now I want to impose a fixed heat flux ( eg 50 W/sq m) on a patch (radiator). How do I do this in the solver? Is there a built-in BC condition for this. I know that the solver demands boundary conditions for temperature but the enthalpy is used for solving the energy equation.

Can anybody give me a hint?

Regards
Bjorn

mabinty March 31, 2011 10:26

Hi!

Check out this BC (for RAS turbulence models): src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature. It applies for the heated boundary patch as a temperature boundary condition like that:

Code:

heatedPatch
{
    type              compressible::turbulentHeatFluxTemperature;
    heatSource    power;
    q                  uniform 65.0;
    value            uniform 293.0;
}

cheers,
Aram

bhh March 31, 2011 11:18

Hi Aram!

It works like a charm! Thank you very much

rgds
Bjorn

bhh March 31, 2011 21:54

Hi Aram,

One thing that is unclear about the BC: is power q given in Watts or Watts per sq m for the patch in question?

rgds

Bjorn

mabinty April 1, 2011 03:28

hi bjorn!

see src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C lines 176 - 202. if you set

Code:

heatSource  power;
q stands for power (W); in case of

Code:

heatSource  flux;
q is taken as power density (W/m2).

cheers!
aram

bhh April 1, 2011 04:52

Hi Aram,

Thanks again! This clarified the situation
rgds
Bjorn

chandramurthy April 1, 2011 22:41

Dear Aram,
In the calculation of gradient() [ turbulentHeatFluxTemperatureFvPatchScalarField.C, lines 180 and 185 ], effective thermal conductivity is calculated as (Cp*alphaEff). I guess it should have been (Cp*alphaEff.Rho).

chandramurthy April 1, 2011 22:44

Please read (Cp*alphaEff.Rho) as (Cp*alphaEff*Rho)

mabinty April 4, 2011 04:02

hi!

alpha = a*rho = k/cp (kg/s/m) denotes the effective enthalpy (energy) diffusivity, whereas "a" (m^2/s) stands for the thermal diffusivity. hence, conductivity k = cp*alpha.

cheers,
aram

murrdpirate June 7, 2011 00:36

Code:

heatedPatch
{
    type              compressible::turbulentHeatFluxTemperature;
    heatSource    power;
    q                  uniform 65.0;
    value            uniform 293.0;
}

What exactly is the temperature value for? Does it change the flux value? I implemented this bc into one of my projects, but I forgot to change the temperature and I ended up with a wall that was at a lower temperature than the internal field. Is it still transferring 65 W to the internal field?

mabinty June 7, 2011 02:51

Quote:

Originally Posted by murrdpirate (Post 310780)
Code:

heatedPatch
{
    type              compressible::turbulentHeatFluxTemperature;
    heatSource    power;
    q                  uniform 65.0;
    value            uniform 293.0;
}

What exactly is the temperature value for? Does it change the flux value? I implemented this bc into one of my projects, but I forgot to change the temperature and I ended up with a wall that was at a lower temperature than the internal field. Is it still transferring 65 W to the internal field?

Hi,

Code:

value            uniform 293.0;
is used as initial value at the respective patch. To check wall heat fluxes use the "wallHeatFlux" utility.

Aram

matthi June 10, 2011 05:24

Setting a variable heat flux for laminar flow
 
Hello,

Im relatively new in applying OpenFoam.

My question is if anyone can give me an advice where I have to search if I want to apply a heat flux to walls in case of laminar flows (solver rhoSimpleFoam). I`d like to have access to all wall cells and want to set a different heat flux for every cell according to values which I get from somewhere else (measured or calculated data).

I think an approach like using
src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature

would be right. But I can use this only for turbulent flows ?
Or do you think that I could use a RAS-code for laminar flow and replace the values Ap, Cpp, alphaEffp in such a manner that I get the desired heat flux?

Thanks in advance for any information

Matthias

chandramurthy June 10, 2011 08:44

Nearest matching BC for your requirement is timeVaryingMappedFixedValue. You have to tweak around slightly to make it timeVaryingMappedFixedHeatFlux. in base class inherit fixedGradient instead fixedValue.
Quote:

Originally Posted by matthi (Post 311426)
Hello,
I`d like to have access to all wall cells and want to set a different heat flux for every cell according to values which I get from somewhere else (measured or calculated data).
Matthias


matthi June 10, 2011 09:38

Hi Chandramurthy,

many thanks for your reply. I got also an other advice from Aran (see above). He wrote me, that I should govern the laminar heat flux with the temperature gradient (Fourier's law) on the respective patch (fixedGradient).
I`ll search in both ways ... but ... as I`m a beginner it will take a lot of time to succeed. If I will be successful I will post the result in the forum.

Greetings Matthias

murrdpirate June 14, 2011 17:11

It appears that the turbulentHeatFluxTemperature only works for heat gains and not heat losses, is that correct? Or am I doing something wrong? I just tried making the "q" value a negative number, but I get a heat gain. Is there a way to make this work or am I stuck with temperature gradients?

matthi June 15, 2011 09:48

Hi Kevin,

it should work in both ways (for positive and negative gradient). This would be physically and numerically right. Maybe, the code uses somewhere only the absolute value of and nobody tried it before, or you made something wrong. The flux is not independent from your coordinate system ! Be sure that you "think" in the right direction.

Greetings Matthias

murrdpirate June 29, 2011 23:14

Matthais,

Sorry, I forgot that I never got back to you. You are correct that this BC handles negative heat transfer. At one point, I did see what appeared to be heat gain, but I think somehow my turbulence model was causing it to create pockets of heat (and a heat loss overall). Thanks for your help.

murrdpirate June 30, 2011 00:18

It looks like this boundary condition has changed in ver 2.0. I now get the error "Keyword K is undefined in [my boundary condition]" Anyone know what that means?

mabinty June 30, 2011 01:18

Quote:

Originally Posted by murrdpirate (Post 314153)
It looks like this boundary condition has changed in ver 2.0. I now get the error "Keyword K is undefined in [my boundary condition]" Anyone know what that means?

That means you did not specify how the conductivity fied "K" shoud be calculated. Look at the top of src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H:

Code:

hotWall
        {
            type            compressible::turbulentHeatFluxTemperature;
            heatSource      flux;        // power [W]; flux [W/m2]
            q              uniform 10;  // heat power or flux
            K              basicThermo; // calculate K by alphaEff*thermo.Cp
            value          uniform 300; // initial temperature value
        }

Cheers,
Aram

murrdpirate June 30, 2011 02:00

Thanks. I didn't realize there were examples in the code for these things.

Issue now is that it's saying "KName is undefined." As you showed, that's not listed in the example. I see somewhere online that it's "CHARACTER*(*) array of species names," but I don't know what that means :(


All times are GMT -4. The time now is 16:21.