Hi all,
as stated in the topic i’m interested in find a way to use code_saturne as a cfd topological optimizer. If you search something on youtube there are some solutions made by commercial software. It could be interesting for applications such designing pipes and collectors. Similar on what is possible to do in FEM software for TO in SIMP algorithms, where the density is function of the material stresses, i would try to set a user density function of the local velocity module. Is it possible to do something similar in CS ? Or do you have any other idea capable to perform TO in CFD with CS ?
I am not too familiar with they way you compute a density function, but you should be able do to just about anything in the cs_user_extra_operations function, which is called at the end of every time step.
As to how you drive the optimization process itself, I assume you need to drive a succession of computations. The built-in autovnv framework might be sufficient for this. Otherwise, SALOME has some features for parametric studies, or you can roll your own scripts, depending on what fits best.
Hi Yvan,
after some studying about the principles of topological optimization, now i’m a little bit more conscious of what I should do. My goal is to maximize the heat transfer at the wall in a water cooling circuit defining the best flux shape. According to theory, in first instance, i should increase the overall turbulence inside my channel to increase the thermal exchange between fluid layers. This means that i should maximise “k” of my k-omega model inside my domain. In order to do that i should “penalise”, after a computation, the cells where lower is the k value. Penalise means that i should sediment such small k fluid domain, considering such regions as solid.
I’m thinking of raising the viscosity to quasi-solid values and to have a thermal conductivity similar to the wall material. Next to this another computation should be made where only the remaining fluid domain (water viscosity) will be solved; then again the penalisation step and so on until i’ll find a good and homogenenus heat exchange at my wall. computation → penalisation → computation → penalisation … and the ratio fluid domain/overall volume will be (in example) 1 → 0,96 → 0,92 → … → 0,5
For what i know about Code_saturne i suppose this is quite feasible, however i’m low skilled in coding. I.e. i should:
at the end of every computation: load the entire k-distribution among the cells (i suppose as an array), find the max, min and average k values;
set the viscosity and conductvity value of the x% lower k distribution values to solid behaviour
restart the computation with such values
re-do the loop
Any advice/ documents / related example on how to do tihis ?
This seems possible. In parallel, you need to make sure the minimum and maximum values are the global ones (so synchronize those). Most arrays such as temperature, turbulence variables, etc are accessed as “fields”. The Doxygen user documentation has quite a few examples with this.
Also, setting a “solid-like” viscosity might have some numerical effects in case of strong jumps, so you may want to increase the value progressively. You could also use head losses for a similar purpose. In any case, wall laws are only handled at walls, not at boundaries between marked cells and others, so this may limit the precision of the approach.
Hi,
following your advice i’m trying an optimization following the SIMP algorithm (esponential behaviour from max to min viscosity) instead of a BESO algorithm (0-1 viscosity).
I’m running some slow single core simulations just to test the algorithm. However i want to scale to fully parallel. As you pointed before i have to find the real maximum in the entire domain and not N local min and max.
my actual code is :
do iel = 1, ncel
if (cvar_k(iel).gt.vkmax) then
vkmax = cvar_k(iel)
endif
if (cvar_k(iel).lt.vkmin) then
vkmin = cvar_k(iel)
endif
varkmed = varkmed+cvar_k(iel)
enddo
varkmed = varkmed/ncel
Is there any tutorial on how to perform such action for the entire domain ?
Thank you in advance. I hope to show you some results in the next days.
Hi Yvan, i’m trying to further investigate what you told me about the autovnv framework to set a succession of computations. Is there any documentation to read or any example / tutorial ??
Hi all,
as you said before, the strong jumps that i impose have a very strong influence on simulation convergence and stability. Is there any theoric advice you can give me to increase code stability ? i’m already using upwind schemes with SIMPLEC.
Are you following th advice of Yvan (“…you may want to increase the value progressively”)? This will allow that the fluid flow adapt to the new viscosity distribution, avoiding strong jumps in the velocity.
Is your penalization function continuos in terms of “k”? This will give you smooth transitions.
Thank you Luciano,
for the moment i tried the easy solution : playing with head losses instead of density and increase relaxation. Avoiding storng jumps is quite difficult because of the algorithm nature, i’m using BESO that has only logic conditions ( in solid BESO top-opt it has only density = 1 or 0 ). I’m trying to find a good value of head loss coefficients to prevent fluid motion and avoiding convergence issues. There are some initial results that i would like to share with you all:
Hi, every X iterations i increase the head loss in the cells i want to penalise. During this X iterations the flow adapts and then i penalise again. Now i want to add a kind of filter to prevent “chequered” zone.