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

Cht tutorial in 15

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2010, 14:23
Default
  #101
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
Hi all,

I have a question related to the "usage" of the modified solver (see link provided by madalena ):

I do not understand why we need an entry:
Code:
gradient                   uniform 0;
and what represents.

So if I have correct understood one has to replace:
Code:
    FLUID_BOTTOM
    {
        type            solidWallHeatFluxTemperature;
        K               K;
        q               uniform 25e04; // [W m⁻2]
    value           uniform 293; // initial Temp [K]
    }
with:
FLUID_BOTTOM
{
type solidWallHeatFluxTemperature;
K K;
q uniform 25e04; // [W m⁻2]
value uniform 293; // initial Temp [K]
gradient uniform 0;
}
where FLUID_BOTTOM is the name of the patch where i set the heat flux.

Is that entry relatedt to the heat flux or to the temperature?

However the simulation start but the time step il of the order of 1e-9!
Someone has an idea how to increase it without compromiss stability ?
I have already set the maxCourantNumber = 0.5 instead of 0.3!
In the end I'm interested in the stationary solution...

Many thanks

Michea

PS: Maddalena I attach the boundary conditions of my case, maybe can help you to understand where the interfaces are and where I have set the heat flux. You can maybe understand my geometry using the pictures I have attached in previous posts...
Attached Files
File Type: gz 0.tar.gz (2.1 KB, 18 views)
mik is offline   Reply With Quote

Old   June 25, 2010, 03:35
Default chtMultiRegionSimpleFoam
  #102
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Michea,
unfortunately my experience with cht is really really small: I have been using it for two weeks only ! In any case, I will look at them...
If you are interested in the stationary results, maybe you can decide to switch to chtMultiRegionSimpleFoam: it is a new solver of OF1.6.x and it is the steady version of chtMultiRegionFoam!
Cheers,

mad
maddalena is offline   Reply With Quote

Old   June 25, 2010, 04:07
Default
  #103
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
Hi Maddalena,

I have attach the my boundary conditions to help you to understand what you have ask above (heat flux combined with the interface), in any case if you find an error or you can help me, it would be fantastic!

In any case, many thanks for the hints about chtMultiRegionSimpleFoam, where have you found this solver?
I didn't know it!
Super, thank you

There is a tutorial case related to this ?
It works exactly like chtMultiRegionFoam ?
I have only to change in fvSchemes:
Code:
ddtSchemes
{
    default         Euler;
}
into
Code:
ddtSchemes
{
    default         steadyState;
}
and the change chtMultiRegionFoam into chtMultiRegionSImpleFoam in controldDict?

Many thanks

Best Regards

Michea

Last edited by mik; June 25, 2010 at 09:09.
mik is offline   Reply With Quote

Old   June 25, 2010, 05:24
Default
  #104
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by mik View Post
I have attach the my boundary conditions to help you to understand what you have ask above (heat flux combined with the interface), in any case if you find an error or you can help me, it would be fantastic!
Ops... I should have thanked you before! I read your sentence badly...
In regards your BC, have you seen this thread? http://www.cfd-online.com/Forums/ope...implefoam.html Maybe you will get some ideas as well...

Quote:
Originally Posted by mik View Post
In any case, many thanks for the hints about chtMultiRegionSimpleFoam, where have you found this solver?
I didn't know it!
Super, thank you
I found it simply exploring the new folders in new of1.6.x...

Quote:
Originally Posted by mik View Post
There is a tutorial case related to this ?
It works exactly like chtMultiRegionFoam ?
I have only to change in fvSchemes:
Code:
ddtSchemes
{
    default         Euler;
}
into
Code:
ddtSchemes
{
    default         steadyState;
}
and the change chtMultiRegionFoam into chtMultiRegionSImpleFoam in controldDict?
Yes, there is a tutorial, at a first glance it seems that it works like chtMultiRegionFoam, only with the changes you posted above...
Let me know how it goes... cheers,

mad
maddalena is offline   Reply With Quote

Old   June 25, 2010, 13:52
Default
  #105
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
Hi Maddalena,

can you please attach the tutorial case for the chtMultiRegionSimpleFoam to a post ?
Because i am interested in the system folder.

Many thanks

Regards

Michea
mik is offline   Reply With Quote

Old   June 25, 2010, 17:10
Default
  #106
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Michea,
I will do it on monday: I have OF installed on my pc at work.
Have a nice weekend!
cheers,

mad
maddalena is offline   Reply With Quote

Old   June 26, 2010, 13:09
Default
  #107
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
Hi Pawel, hi all,

an explanation of my case is attached to the nexts post, I hope is enough to understand my case ans many thanks for the help!
There is a file named "explanation" to read!

Cheers

Michea

PS: the simulation starts and runs (since the endTime) the problem is that results are not reliable and it runs with a deltaT of 1e-9!!!
Not reliable because the hotter zone is the one of the the most distant zones of the cylinder and other things...
To reach endTime (1e-3) I need a cluster using 32 processors for many hours! And the problem is that theoretically I am interested at a steadyState solution
But this problem is theoretically easier to solve using the solver introduced by Maddalena

Last edited by mik; June 26, 2010 at 13:15. Reason: The tar was to big ...
mik is offline   Reply With Quote

Old   June 26, 2010, 13:13
Default
  #108
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
I can not attach the tar because it is to "big" I attach the single files.

Cheers

Michea
Attached Images
File Type: jpg fluidRegion.jpg (11.5 KB, 20 views)
File Type: jpg solidRegion.jpg (13.7 KB, 16 views)
File Type: jpg mesh.jpg (97.5 KB, 19 views)
File Type: jpeg patchesFluidRegion.jpeg (37.6 KB, 22 views)
File Type: jpeg patchesSolidRegion.jpeg (33.8 KB, 12 views)
mik is offline   Reply With Quote

Old   June 26, 2010, 13:17
Default
  #109
mik
Member
 
Michea Ferrari
Join Date: Mar 2010
Location: Switzerland
Posts: 30
Rep Power: 16
mik is on a distinguished road
And finally...
Attached Images
File Type: jpg vectors1.jpg (54.1 KB, 44 views)
Attached Files
File Type: pdf explanation.pdf (19.7 KB, 32 views)
mik is offline   Reply With Quote

Old   June 26, 2010, 13:25
Default
  #110
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Quote:
Originally Posted by mik View Post
the simulation starts and runs (since the endTime) the problem is that results are not reliable and it runs with a deltaT of 1e-9!!!
In my opinion you simply have too fine mesh. With such small elements, and by using standard material coefficients (like for air, copper, steel etc.) you will for sure be required to use very small time steps. There is no way around...

It would greatly speed up your work if you would simplify the geometry to 2D. In the end, I believe that would be sufficient for the problem you are dealing with.

Best,
Pawel
psosnows is offline   Reply With Quote

Old   June 28, 2010, 06:29
Default
  #111
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by mik View Post
Hi Maddalena,

can you please attach the tutorial case for the chtMultiRegionSimpleFoam to a post ?
Because i am interested in the system folder.

Many thanks

Regards

Michea
Hi Michea,
here it is! there is also a chtMultiRegionSimpleFoam tutorial (I guess the same) on the brand new OF 1.7 version.
enjoy,

mad
Attached Files
File Type: gz chtMultiRegionSimpleFoam.tar.gz (5.4 KB, 26 views)
maddalena is offline   Reply With Quote

Old   July 6, 2010, 12:22
Default
  #112
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by psosnows View Post
In my opinion you simply have too fine mesh. With such small elements, and by using standard material coefficients (like for air, copper, steel etc.) you will for sure be required to use very small time steps. There is no way around...
Hi Pawel,
do you mean that, if the mesh is too fine, the simulation is not able to capture the heat transfer? Or only that it will take longer to reach steady state?
I am looking for information on how to generate a good mesh for cht simulations, do you have some good references on that? The books I am used to look up give hints only for standard aerodynamic simulations and not on cht...
cheers

mad
maddalena is offline   Reply With Quote

Old   July 6, 2010, 13:04
Default
  #113
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
I am just pointing that the time scale has to match the length scale of the problem.

Simple example: you have a iron rod with 10cm length and want to see the evolution in time of temperature of this rod supposing you heat up one end. It seems obvious that you will make measurements with interval around a second. Choosing an interval of one hour would be simply pointless.

Getting back to our mesh problem. Consider that (in veeeery general approach) one can think of two points of a mesh as "ends" of a 1D rod with some thermal diffusivity coeff.

In the end, if you want to have a good working time step, do the following:
1) find the smallest cell in the mesh
2) check what is the distance between its centre and its boundary, call it Lm
3) write down thermal diffusivity coeff K (in m^2/s)
4) calc the MAX time step that you can use for your problem:
dTime = Lm^2/K
5) round it down to a nice value (if you got dTime = 0.04645 set dTime = 0.04 or even 0.01)

One remark- this is just thermal time scale. At the same time one has to consider advective time scales, and always choose the smallest obtained time step.

The worst part is- for sure you will get very small values of dTime... And the only way around is to change K or Lm. Sorry

Hope it helps you a bit. Best,
Pawel

ps
The reasoning I presented is very rough and basic. I am sure that any book of computational FD which has a heat transfer chapter will cover this subject more precisely.
psosnows is offline   Reply With Quote

Old   July 7, 2010, 05:04
Default
  #114
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Thanks for your fast and clear answer, Pawel!
However... with the 1.6.x modification pointed out here, there should be no need of fix the time step depending on thermal diffusivity. Indeed, I can choose the maxDi as the maxDi of the region materials, and OF should adjust the time step accordingly.
But what about the mesh size? Is there any relation between the solid material properties and the grid size?

cheers

mad

Last edited by maddalena; July 7, 2010 at 05:46. Reason: wrong link
maddalena is offline   Reply With Quote

Old   July 7, 2010, 06:03
Default
  #115
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Hello Maddalena,

Quote:
Originally Posted by maddalena View Post
with the 1.6.x modification (...) there should be no need of fix the time step depending on thermal diffusivity. Indeed, I can choose the maxDi as the maxDi of the region materials, and OF should adjust the time step accordingly.
I must disagree. The only time step control in chtMultiRegionFoam that I know of is in line 74 of chtMultiRegioFoam.C. And this only takes care of setting time step depending on advection.

If you are interested only in stationary solution, you do not have to worry much about thermal diffusive time scale- it will simply take longer (but it may crash).
But! If you want to have a transient solution- mark my words- you need to set the time step with regard to thermal diffusivity and mesh size.
Quote:
Originally Posted by maddalena View Post
But what about the mesh size? Is there any relation between the solid material properties and the grid size?
Recall that each cell is treated to be homogeneous with constant properties of values stored in the center point. Thats the only relation.

Once again the time step. Lets think of 3 points on a line, lets say x=0, x=1, x=2. We know that that the material's diffusivity of some property is 2m^2/s. Let the source of disturbance be at point x=0. If you set the time step to be 1s, then, after this second, the property should diffuse up to the point x=2. But x=0 is only connected with x=1, so point x=2 does not "feel" the change from point x=0. In the end, amount of property that should go to x=2 from x=0 is lost! To have proper results, the maximum time step allowed in this system is 0.5s.

Someone may write codes that consider "further neighbours" of a cell, but here we use standard methods, and consider only closest neighbours. In that case, there is no way around- you have to corelate time step, smallest mesh size and diffusivity.

Best,
Pawel
psosnows is offline   Reply With Quote

Old   July 7, 2010, 07:10
Default
  #116
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Pawel,
Quote:
Originally Posted by psosnows View Post
I must disagree. The only time step control in chtMultiRegionFoam that I know of is in line 74 of chtMultiRegionFoam.C. And this only takes care of setting time step depending on advection.
Ok, probably this is true for OF 1.6. In OF 1.6.x, chtMultiRegionFoam.C says:
Code:
    while (runTime.run())
    {
        #include "readTimeControls.H"
        #include "readSolidTimeControls.H"
        #include "readPIMPLEControls.H"


        #include "compressibleMultiRegionCourantNo.H"
        #include "solidRegionDiffusionNo.H"
        #include "setMultiRegionDeltaT.H"

        runTime++;

        Info<< "Time = " << runTime.timeName() << nl << endl;
thus the time step is set in setMultiRegionDeltaT.H, which shows:
Code:
    runTime.setDeltaT
    (
        min
        (
            min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
            maxDeltaT
        )
    );
And I would say that the time step depends both on solid and fluid region.
So, since the time step depends on both the solid (limited by the maxDi) and the fluid (limited by the maxCo), and usually maxDi << maxCo, the time step size depends on solid mainly. So that's why I am looking for some kind of relations that help to fix the mesh size depending on solid properties...

Quote:
Originally Posted by psosnows View Post
If you are interested only in stationary solution, you do not have to worry much about thermal diffusive time scale- it will simply take longer (but it may crash). But! If you want to have a transient solution- mark my words- you need to set the time step with regard to thermal diffusivity and mesh size.
Yes, I am interested only on the steady state, but I guess that, for having a good temperature distribution, I need to simulate the heating properly from the beginning. What I am thinking to do is to use a coarse mesh in the first stage, let the temperatures increase a bit from the initial value, and then change the grid with a finer one to get the detailed temperature distribution. For such a process, I would like to understand properly maxCo, maxDi and mesh size influence on my results. This is what I am missing.

mad
maddalena is offline   Reply With Quote

Old   July 7, 2010, 08:29
Default
  #117
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Hello Maddalena,
Quote:
Originally Posted by maddalena View Post
(...) And I would say that the time step depends both on solid and fluid region.
ehh, its time to upgrade my OF release... seems I am getting out of track of course I take back what I said- new chtMRFoam truly takes care of time step itself.

Quote:
Originally Posted by maddalena View Post
What I am thinking to do is to use a coarse mesh in the first stage, let the temperatures increase a bit from the initial value, and then change the grid with a finer one to get the detailed temperature distribution.
This is a very good idea.

I also had a problem with acquiring steady state, but I could not change the mesh. What I did was the following:
(1) I run the simulation only for fluid regions using some laminar solver (like icoFoam).
(2) turn off the velocity and pressure calculation in chtMRFoam and calculate only the temperature (using acquired laminar velocity field).
(3) When you arrive to steady state of (2), turn on the velocity calculations in chtMRFoam and run the simulation for some time (until velocity field gets to some stable position).
(4) if you "like" the velocity enough, you can speed up the calculations by turning off the velocity once again.

It is the velocity and pressure calculations that mostly cause the simulation to run so slow. If you use the "cheat" above, you will not have to solve hard velocity-temperature-pressure systems until step 3. This will save you a lot of computational time during "transient" state of the simulation.

Hope it helps you a bit,
Pawel
psosnows is offline   Reply With Quote

Old   July 7, 2010, 09:29
Default
  #118
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Pawel,
Quote:
Originally Posted by psosnows View Post
ehh, its time to upgrade my OF release (...) I run the simulation only for fluid regions using some laminar solver
So I guess you are still running OF 1.6. Could you do a simple test for me?
I need to know if there is a bug or something wrong on the new 1.6.x setInitialMultiRegionDeltaT.C: it seems that you are not allowed to run a simulation with a uniform (0 0 0) velocity, while this would be really interesting for flows with buoyancy. What I would like to ask you is to set U as
Code:
internalField   uniform (0 0 0);
and
Code:
 minX
            {
                type            fixedValue;
                value           uniform ( 0 0 0 );
            }
in the bottomAir and topAir regions of the multiRegionHeater tutorial? Using 1.6.x, this gives a Co = 0 and thus an error (that is logical), but what about the old way of defining the initial time step?
Quote:
Originally Posted by psosnows View Post
This is a very good idea.
Thank you! What I suggested is really necessary in a simulation where the temperature is not know a priori and the system is heated only by volume heat generation...

One more question concerning the fluid region. In a standard aerodynamic calculation not involving heat transfer, I am used to place the outer boundary as far as possible to not affect the inlet value of simulation. However, when starting to use cht, I noticed that the internalField temperature starts to decrease when increasing the flow velocity due only to buoyancy. That is true if I place the outer boundary far away from the warm region and fix a zeroGradient or inletOutlet or fixedValue BC for temperature. But it does not happen for a boundary that is closer. Have you noticed something similar? Suggestions about that?

Thank you,

mad
maddalena is offline   Reply With Quote

Old   July 7, 2010, 10:12
Default
  #119
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by maddalena View Post
One more question concerning the fluid region. In a standard aerodynamic calculation not involving heat transfer, I am used to place the outer boundary as far as possible to not affect the inlet value of simulation. However, when starting to use cht, I noticed that the internalField temperature starts to decrease when increasing the flow velocity due only to buoyancy. That is true if I place the outer boundary far away from the warm region and fix a zeroGradient or inletOutlet or fixedValue BC for temperature. But it does not happen for a boundary that is closer. Have you noticed something similar? Suggestions about that?
This is solved: I did not get that I needed a pressure waveTransmissive bc on those outer boundaries...
maddalena is offline   Reply With Quote

Old   July 7, 2010, 10:18
Default
  #120
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
I set things up just as you asked. Zero velocities everywhere. The simulation runs without any problems.
In OF-1.6 before main loop there is:
Code:
    if (fluidRegions.size())
    {
        #include "compressibleMultiRegionCourantNo.H"
        #include "setInitialDeltaT.H"
    }
And this does the trick. setInitialDeltaT.H is standard file. Here is a link to documentation:
http://foam.sourceforge.net/doc/Doxy...8H_source.html
I believe the if() part (CoNum > SMALL) prevents the crash.

Regarding the second question.
We are dealing with a specific system here. We can characterize it with Rayleigh number (Ra). For small enough values of Ra, the flow acts as "solid conductor". If Ra exceeds a critical value- we have instability: heat convection. There are some specific features of this kind of phenomena:
- we can find specific conductive boundary layer near the heated (cooled) wall
- all temperature drop (or increase) happens inside this boundary region
- temperature inside the convective cell is almost constant, equal to average of the boundaries
- depending on stability of the system one can observe hot or cold "plumes" ripped off from boundary layer traveling in the cell.
Good description can be found in the book of P.K. Kundu ("Fluid Mechanics") chapter 11, section 3.

That is why I believe if you have a temperature drop due to the flow, it is a result of this "averaging" effect, since probably you have an unstable system.

Best,
Pawel
psosnows 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
---------Tutorial help mech FLUENT 4 May 16, 2007 03:43
tutorial 6 in Fluent 6.2 tutorial and Mesh pilli4u FLUENT 2 April 2, 2007 06:09
3D Tutorial MJ FLUENT 0 January 16, 2007 09:45
tutorial masood yooceframandi FLUENT 1 January 25, 2005 13:28
tutorial adil FLUENT 0 March 8, 2004 04:48


All times are GMT -4. The time now is 01:35.