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/)
-   -   Inconsistency in wallHeatFlux utility (https://www.cfd-online.com/Forums/openfoam-solving/136031-inconsistency-wallheatflux-utility.html)

zfaraday May 21, 2014 14:53

Inconsistency in wallHeatFlux utility
 
Hello FOAMers!

I am studying a simple case with chtMultiRegionSimpleFoam (just to practice the set up for radiation and heat generation) consisting of 2 cubic solid regions (one is generating heat power, actually its temperature is defined as a constant of 600K because I still don't know how to set up a volumetric heat source) surrounded by a bigger cubic region of air. All of the boundary faces for the air region are isolated (using externalWallHeatFluxTemperature wit q=0) except one (defined as externalWallHeatFluxTemperature with Ta=293K and h=1).

The purpose of this simple case is, of course, study what happens when the heating region heats the whole system, either considering radiation or not.

Then, here comes the point! I executed the wallHeatFlux utility to check the energy balance in the system and I found something that is making me crazy. Below you can see the results I got.

Code:

air
Wall heat fluxes [W]
maxY -63.0738
minX -0.003706714
maxX -0.009187714
minY -0.0116676
bottom -0.002245114
top -0.002884371
air_to_heater 141.7464
air_to_object -73.04159

Code:

heater
Wall heat fluxes [W]
bottom 0
heater_to_air -141.74

Code:

object
Wall heat fluxes [W]
object_to_air 24.3712

As you can see the heat absorbed by the object (yes, I know, it's the most original name for a region anyone has ever heard) is not the same that goes from the air to the object. Furthermore, right now I realised that the energy in the air is also unbalanced since there is a difference of 5W between then energy coming in and going out of the air domain.

Have anyone experinced something similar any time? Am I doing anything wrong? Is there something going wrong with the utility? Any hint or advice will be more than welcome!


Thanks in advance!


Alex

PS: The results are extracted fom a case without radiation, but the same occurs adding the radiation component.

Jean El-Hajal May 21, 2014 15:39

Dear Alex,

I did not check you post in details, but today we made a simulation with chtMultiRegionSimpleFoam solver and the externalWallHeatFluxTemperature boundary condition with Ta and h. It did not work for us. Nothing happened it was just like an adiabatic wall. :confused:

Hope it help.

Best Regards,

Jean

zfaraday May 21, 2014 15:48

Quote:

Originally Posted by Jean El-Hajal (Post 493431)
Dear Alex,

I did not check you post in details, but today we made a simulation with chtMultiRegionSimpleFoam solver and the externalWallHeatFluxTemperature boundary condition with Ta and h. It did not work for us. Nothing happened it was just like an adiabatic wall. :confused:

Hope it help.

Best Regards,

Jean

I don't understand what you mean when you say "Nothing happened". Did you get an error? An adiabatic wall doesn't make sense at all. Look at my results, my wall that isn't isolated is the one called "maxY" and, as you can see, is not adiabatic (maxY -63.0738).

Check the values you gave to Ta and h. If Ta is close to the wall temperature then the heat flux will be close to 0. Likewise if you gave h a value close to 0.

Regards,

Alex

olivierG May 22, 2014 04:56

hello,

Which OF version do you use ?
Because there where some bug in 2.2 and 2.3 corrected in 2.3.x.
See http://www.openfoam.org/mantisbt/view.php?id=1258
and http://www.openfoam.org/mantisbt/view.php?id=1108

regards,
olivier

zfaraday May 22, 2014 04:59

I using 2.2.1 version. Does it mean that I need to install 2.3.x in order to be capable to get the correct results?

Thanks olivierG

olivierG May 22, 2014 05:02

the 2.2.x and 2.3.x should work.

regards,
olivier

zfaraday May 22, 2014 05:40

Thank you so much olivier for your information. I will try to install ot when I have time for that.
By the way, in the bugs reported im your links above it is said that this occurs with the externalWallHeatFlux BC. However my main problem occurs in the interface between a solid region and a fluid region and the BC in there is turbulent::TemperatureCoupledBaffleMixed (written from memory, maybe the spelling is not correct). Would your approach solve that issue aswell?

Many thanks!

olivierG May 22, 2014 05:55

I don't know for turbulentTemperatureCoupledBaffleMixed, but there where improvement in 2.3 about that (see http://www.openfoam.org/version2.3.0/thermal.php ).

regards,
olivier

GDTech May 22, 2014 08:08

Hi Alex,

From my experience, chtMultiRegionSimpleFoam takes sometimes a really large number of iterations to reach thermal convergence (correct energy balance). I suggest you to set probes on walls between fluid and solid regions to monitor temperature. Add this to your controlDict :

Code:

functions
{
    probes
    {
        type            probes;
        functionObjectLibs ("libsampling.so");
        outputControl  timeStep;
        outputInterval  1;
        probeLocations
        (
            ( 0 9.95 19.77 )
            ( 0 -9.95 19.77 )
        );
        fields
        (
            T
        );
    }
}

Energy balance will be correct when interface temperature do not change anymore.

If this temperature is converged and energy balance is still wrong, your BCs are probably not correct.

Laurent.

zfaraday May 22, 2014 11:57

Thanks for your advices Olivier and Laurent!

@Laurent, I would like to be able to understand the piece of code you posted because it's the first time I add something like that to the controlDict file and I am getting errors all the time when I try to run the case.

Could you please explain briefly the use and meaning of every field within probes, mainly the probeLocation one. Otherwise, if you can, give me some link or site where I can reveiw some useful documentation.

Thanks again!


Alex

GDTech May 23, 2014 03:06

Hi,

Here is some general information about functionObjects :

http://foam.sourceforge.net/docs/cpp/a00002.html

ProbeLocation is a set of points (x, y, z coordinates) where you want to measure the field written in the "fields" token ("T" in my example).
2 points are set in my example, but you can add more if you want.

Laurent.

zfaraday May 23, 2014 03:14

Thank you so much Laurent, that was exactly what I needed!! I will take a look into it later

zfaraday May 27, 2014 17:43

After some days away from OpenFOAM, finally today I got back on track. I could run the case using probes function object, but I didn't see anything. Is it supposed to create some files with the requested results, isn't it? Although I couldn't get anything from function objects functionality, I tried something more visual, that is, I displayed the patches between both surfaces and I found out that the temeprature distribution is the same in both patches. So, where can be the error in my case? What can be wrong in my setup? Or is it something related to the issue mentioned above in the wallHeatFlux utility?

Thanks in advance, any hint will be welcome!

Regards,

Alex

zfaraday May 28, 2014 15:32

Dear Laurent,

sorry for my previous response, I wrote too quick. After looking a little further into the case folder I found the info inside the PostProcessing folder and, indeed, you were right, the temperature seems not to be equal in the same point.

These are the results in the latest time of my simulation for the air region
Code:

417.9127      423.2814        -1e+300      428.8006
and here are the results for the object region
Code:

350.2071      350.2188      350.1326        -1e+300
The two first values are the important ones. They come from the same points (two different points belonging both to the boundary) in the boundary between both regions. As it is shown, they are not even similar. Thus, finally I could verify that the problem was the thermal convergence in the walls, so what do I need to do to solve that?

On the other hand, as I said in my previous post, I tried to check the temperature values in the walls by using ParaView, this is, I displayed the temperature distribution in the boundary faces (air_to_object and object_to_air) but both distributions were equal! Did I do anything wrong? Is this method not able to identify this issue with thermal convergence?

Many thanks in advance!

Alex

GDTech May 30, 2014 02:55

Hi Alex,

Quote:

Originally Posted by zfaraday (Post 494583)
Thus, finally I could verify that the problem was the thermal convergence in the walls, so what do I need to do to solve that?

Well ! So, you need to restart your simulation for a few more iterations until your probes report the same temperature on both sides. It is sometimes really slow to reach thermal convergence, then I also suggest you to follow this tip :

http://www.cfd-online.com/Forums/ope...tml#post338430

Quote:

On the other hand, as I said in my previous post, I tried to check the temperature values in the walls by using ParaView, this is, I displayed the temperature distribution in the boundary faces (air_to_object and object_to_air) but both distributions were equal! Did I do anything wrong? Is this method not able to identify this issue with thermal convergence?
I don't know exactly what's happening but my guess is that paraview reads the boundary condition in T file which is the same in both regions ... boundary conditions are equal but not field values just next to the boundary since convergence is not reached ...

Laurent.

zfaraday May 30, 2014 07:55

Quote:

Originally Posted by GDTech (Post 494792)
Hi Alex,

Well ! So, you need to restart your simulation for a few more iterations until your probes report the same temperature on both sides. It is sometimes really slow to reach thermal convergence, then I also suggest you to follow this tip :

http://www.cfd-online.com/Forums/ope...tml#post338430

I actually tried it right after posting the comment (again I posted it too fast :P) and, indeed, it was a matter of time, after a few minutes I reached thermal convergence and everything was fine. But then I tried the same case but adding radiation to the case and something weird occurred (at least to my eyes...). It seems to reach steady state, since temperature shown with probes function object remains constant for the last iterations, but the temperature is not the same in both boundaries. When I get home I will upload the results of my case to se if I can get some help.

Quote:

I don't know exactly what's happening but my guess is that paraview reads the boundary condition in T file which is the same in both regions ... boundary conditions are equal but not field values just next to the boundary since convergence is not reached ...

Laurent.
I don't get what you mean, Laurent. You say that BC are equal in both regions. However, as you can see in the results shown above extrated from probes, in the same point (belonging to the BC of both regions) the temperature is diferent for each region.

Thanks for your explanations, Laurent

Alex


All times are GMT -4. The time now is 03:34.