CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

turbulentHeatFluxTemperature doesn't work with buoyantBoussinesqPimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2018, 15:28
Default turbulentHeatFluxTemperature doesn't work with buoyantBoussinesqPimpleFoam
  #1
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Dear all,

I am using OF 1612 on Centos 7, it was installed by following the tutorial on OFWiki.

I am currently modifying the hotRoom tutorial case under solver buoyantBoussinesqPimpleFoam to specify a constant heat flux at the floor. The modified BC for T is as below:

Code:
boundaryField
{
    floor
    /*{
        type            fixedValue;
        value           uniform 300; // Original
    }*/
    {
        type            compressible::turbulentHeatFluxTemperature; 
        heatSource      flux;
        q               uniform 10e5;
        value           uniform 293.15;
        kappaMethod     fluidThermo;
        kappa           none;
        Qr              none;
    }
    ceiling
    {
        type            fixedValue;
        value           uniform 300;
    }
    fixedWalls
    {
        type            zeroGradient;
    }
}
I think I followed the example set in the source code of compressible::turbulentHeatFluxTemperature. But when I run the simulation, it shows following error message:

Code:
Starting time loop

Courant Number mean: 0 max: 0
Time = 2

PIMPLE: iteration 1


--> FOAM FATAL ERROR:
Kappa defined to employ fluidThermo method, but thermo package not available

    From function Foam::tmp<Foam::Field<double> > Foam::temperatureCoupledBase::kappa(const scalarField&) const
    in file turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C at line 142.

FOAM exiting
I checked the source code of temperatureCoupledBase.C, the relevant source code associated with this error message is:

Code:
case mtFluidThermo:
        {
            typedef compressible::turbulenceModel turbulenceModel;

            word turbName(turbulenceModel::propertiesName);

            if
            (
                mesh.foundObject<turbulenceModel>(turbName)
            )
            {
                const turbulenceModel& turbModel =
                    mesh.lookupObject<turbulenceModel>(turbName);

                return turbModel.kappaEff(patchi);
            }
            else if (mesh.foundObject<fluidThermo>(basicThermo::dictName))
            {
                const fluidThermo& thermo =
                    mesh.lookupObject<fluidThermo>(basicThermo::dictName);

                return thermo.kappa(patchi);
            }
            else if (mesh.foundObject<basicThermo>(basicThermo::dictName))
            {
                const basicThermo& thermo =
                    mesh.lookupObject<basicThermo>(basicThermo::dictName);

                return thermo.kappa(patchi);
            }
            else
            {
                FatalErrorInFunction
                    << "Kappa defined to employ " << KMethodTypeNames_[method_]
                    << " method, but thermo package not available"
                    << exit(FatalError);
            }

            break;
        }
The lines of code after the first if statement suggests that the this BC will look into the turbulenceProperties dictionary at the constant directory. Then select the turbulence model specified in turbulenceProperties, then evaluate the kappa = kappaEff. (Please correct me if I understand it incorrectly). So I suppose it will evaluated kappa automatically rather than jumping to the final error message under the else statement.

So can anybody give me some ideas on where has gone wrong, or do you have any idea how to apply a constant heat flux at the wall.


Many thanks,
Yeru
shang is offline   Reply With Quote

Old   July 21, 2018, 16:55
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
From the error message it looks like the bc would pull kappa from thermo. However, the boussinesq class of solvers does not actually create thermo. Additionally an incompressible turbulence model is created. So I'm not sure that you'll be able to use this bc with buoyantBoussinesqPimpleFoam.

Caelan
clapointe is offline   Reply With Quote

Old   July 21, 2018, 18:57
Default
  #3
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Hi Caelan,


Even though the solver doesn't create thermo, from the first few lines of source code of temperatureCoupledBase.C as shown in my thread, it should automatically evaluate kappa = kappaEff. I think your second point is very valid, as this BC may only work for compressible solver. So if I can't use this BC with buoyantBoussinesqPimpleFoam, do you know which BC can I use to set a constant heat flux?


Kind regards,
Yeru
shang is offline   Reply With Quote

Old   July 21, 2018, 20:03
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I'd mentioned the thermo bit because the error mentioned thermo -- perhaps it didn't try to get kappaEff from the turbulence model because it's not a compressible one?

In any case, if it's a constant heat flux you can compute the associated temperature gradient using q = k*A*dt/dx.

Caelan
clapointe is offline   Reply With Quote

Old   July 21, 2018, 20:29
Default
  #5
Senior Member
 
Peter Baskovich
Join Date: Jul 2014
Posts: 127
Rep Power: 11
pete20r2 is on a distinguished road
Quote:
Originally Posted by clapointe View Post
I'd mentioned the thermo bit because the error mentioned thermo -- perhaps it didn't try to get kappaEff from the turbulence model because it's not a compressible one?

In any case, if it's a constant heat flux you can compute the associated temperature gradient using q = k*A*dt/dx.

Caelan
That would be a simple fixedGradient btw
pete20r2 is offline   Reply With Quote

Old   July 22, 2018, 07:35
Default
  #6
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Quote:
Originally Posted by pete20r2 View Post
That would be a simple fixedGradient btw
Thanks, Caelan and Peter,

Does is mean I just need to use fixedGradient at the wall for the temperature? Can you tell me which kappa I should use in the calculation, is it the the thermal diffusivity of the fluid? Or the kappaEff calcuated incorporating the turbulence?


Many thanks,
Yeru
shang is offline   Reply With Quote

Old   July 22, 2018, 10:05
Default
  #7
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Yes, this would mean that you could use a fixed temperature gradient. This is Fourier's Law (https://en.wikipedia.org/wiki/Thermal_conduction), where k is the fluid's thermal conductivity in this case. However, now that I think about it, this would only be appropriate if you are resolving the boundary layer (where conduction is the dominant mode of heat transfer).

Caelan
clapointe is offline   Reply With Quote

Old   July 23, 2018, 15:48
Default
  #8
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Hey Caelan,

Yes, I am solving the wall as I am running LES without wall modelling. I suppose my dT/dx should be negative as the heat flux is from the wall to the internal fluid?

Also, a silly question, I suppose conduction, based on Fourier's Law, is normally governing the heat transfer in the solid, why it is applicable here?

Yeru
shang is offline   Reply With Quote

Old   July 23, 2018, 16:43
Default
  #9
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I suppose it is often associated with solids, but on a macro scale conduction through a gas is still the same -- the thermal conductivity is just a lot lower. I agree that the gradient will be negative. This is the first thing I thought of to approximate a gradient -- If any one else has a better idea I'd invite them to step in.

Caelan
clapointe is offline   Reply With Quote

Old   July 24, 2018, 06:17
Default
  #10
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Thanks Caelan, I will try the fixedGradient for now. Yeru
shang is offline   Reply With Quote

Old   December 2, 2018, 14:58
Default
  #11
New Member
 
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8
kakkapriyesh is on a distinguished road
Hi,Yeru did you get the correct constant wall heat flux using the k of fluid? also what can we use to calculate wall heat flux for a turbulent case here(for wall at constant temp), my alphat file is not genrating number = nut/prt . am i missing something. i am running buoyantBoussinesqPimpleFoam for LES, and wall is fully resolved so i have not used any wall functions here.
kakkapriyesh is offline   Reply With Quote

Old   January 14, 2019, 08:50
Default
  #12
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Yes, this would mean that you could use a fixed temperature gradient. This is Fourier's Law (https://en.wikipedia.org/wiki/Thermal_conduction), where k is the fluid's thermal conductivity in this case. However, now that I think about it, this would only be appropriate if you are resolving the boundary layer (where conduction is the dominant mode of heat transfer).

Caelan
Is k not the thermo conductivity of metirials but fluid? The thermo conductivity of fluid(kappa) is not constant and I use wallHeatFlux to check heat flux after simulation, I found the result is not the same as the setting one.

So how can I really set the constant heat flux BC? Maybe kappaMethod:fluid is not suitable for my case.Thank you.
calf.Z is offline   Reply With Quote

Old   January 14, 2019, 09:17
Default
  #13
Senior Member
 
Peter Baskovich
Join Date: Jul 2014
Posts: 127
Rep Power: 11
pete20r2 is on a distinguished road
Could you use something a bit more derivative like patch mass flow, temp etc and do energy balance?
pete20r2 is offline   Reply With Quote

Old   January 14, 2019, 09:25
Default
  #14
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by pete20r2 View Post
Could you use something a bit more derivative like patch mass flow, temp etc and do energy balance?
I use (h*phi)out - (h*phi)int = q*s to check energy balance, but it is not correct. So I doubt that the actual q is not the same as the setting one and the result of using wallHeatFlux makes me more confused.
calf.Z is offline   Reply With Quote

Old   January 14, 2019, 12:15
Default
  #15
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Let's back up. What solver are you using and what is your problem. Where are you checking the heat flux/energy balance? To your question, yes kappa would be the thermal conductivity of your fluid. In the absence of radiation (are you including it?), conduction would be the dominant mode of heat transfer in the boundary layer so setting a temperature gradient sounds like a good way to set a constant heat flux (how much is kappa of your fluid actually changing?).

Caelan
clapointe is offline   Reply With Quote

Old   January 17, 2019, 22:47
Default
  #16
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Let's back up. What solver are you using and what is your problem. Where are you checking the heat flux/energy balance? To your question, yes kappa would be the thermal conductivity of your fluid. In the absence of radiation (are you including it?), conduction would be the dominant mode of heat transfer in the boundary layer so setting a temperature gradient sounds like a good way to set a constant heat flux (how much is kappa of your fluid actually changing?).

Caelan
Thank you for replying me.

I am using buoyantSimpleFoam to solve the heat tranfer of supercritical CO2 flows in a vertical pipe. The walls have 3 parts: the start and the end are isothermo walls and the middle wall is given constant heat flux q.

I use tabular method to get these thermoproperties e.g. kappa rho Cp H... so that kappa is changing with T and P and is read from tabulated tables.

I want to check the heat flux on the wall after simulation. I found the utility:wallHeatFlux gives different values in post-Processing and on-running, whcih makes me very confused.

Then I want to check the energy balance between INLET and OUTLET. So I calculated (h*phi)out - (h*phi)in and q*s and found that they are not equal.

The thermoproperties close to critical point of CO2 is changing rapidly.From 298.15K to 310K, kappa is changing from 0.0888 to 0.076.
I am using externalWallHeatFluxTemperature BC and not sure if kappaMethod:fluidThermo is suitable for my case.

I have no idea about these questions above. Any hint is highly appreciated.
calf.Z is offline   Reply With Quote

Old   January 17, 2019, 23:26
Default
  #17
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Fair warning -- I have not worked with supercritical fluids before. However, I might be able to address a few points :

- for the wallHeatFlux utility : how much different are the values? I am not sure why they would be different, but a quick scan of the code suggests they shouldn't be.

- for the energy balance : I'd recommend writing down energy terms at each boundary and making sure everything is all accounted for.

Caelan
clapointe is offline   Reply With Quote

Old   January 18, 2019, 02:56
Default
  #18
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Fair warning -- I have not worked with supercritical fluids before. However, I might be able to address a few points :

- for the wallHeatFlux utility : how much different are the values? I am not sure why they would be different, but a quick scan of the code suggests they shouldn't be.

- for the energy balance : I'd recommend writing down energy terms at each boundary and making sure everything is all accounted for.

Caelan
I set q=26784W/m2, when multiplied by area, it is 16.83W.
If I use postProcess -func wallHeatFlux, I will get : min/max/integ(WALL) = 21240.6, 65211.9, 28.4312. 28.4312W >> 16.83W.
If I use #include wallHeatFlux to get value when running. It presents :WALL 1.725975e+04 3.073739e+04 1.693862e+01. 16.93W is closer to 16.83W.

So I am confused about the different results.

In my case, there are inlet and outlet and two interiors. I am not sure if openfoam will recognize interior and I think it will have no influence.
So (h*phi)out - (h*phi)in = q*s is the right method to check energy terms? are there other terms which may be ignored easily?
calf.Z is offline   Reply With Quote

Old   January 18, 2019, 16:19
Default
  #19
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Are the runTime values from the end of your simulation? Re the energy balance is this a 2d simulation?

Caelan
clapointe is offline   Reply With Quote

Old   January 18, 2019, 21:31
Default
  #20
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Are the runTime values from the end of your simulation? Re the energy balance is this a 2d simulation?

Caelan
I compared the runTime value of latestTime and the postProcess value of latestTime by using wallHeatFlux utility. The result is a lot different.

My case is 3D simulation. It is a vertical pipe with constant heat flux on the middle wall and the start and end of the wall are isoThermo walls.
calf.Z is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RP_Set_Integer does not work in parallel 86lolo Fluent UDF and Scheme Programming 2 July 3, 2014 11:37
Does CX_Interpret_String work in parallel? 86lolo Fluent UDF and Scheme Programming 2 June 30, 2014 04:36
Companies that lease software & hardware for cloud-based work? Catthan ANSYS 0 June 18, 2014 10:53
Why do the Plant library cases don't work? Alumna Phoenics 6 June 22, 2004 12:08
why my In-Form doesn't work? green Phoenics 2 May 27, 2004 21:03


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