Syrthes extra questions

This forum is dedicated to Syrthes related issues, as the Syrthes tool does not have its own forum.
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Syrthes extra questions

Post by jingless »

Hi,
Although this is a Code_Saturne forum, There is no other place right now where questions can be made. I have a couple of questions, maybe somebody here can help.

1. When you have radiation, view factors must be calculated and are stored in file: mesh.fdf which is binary. I need to be able to read the view factors between surfaces in order to check them and for further use in other calculations. How can I extract view factors from Syrthes?

2. I would like to compute the heat flux with its components in a cartesian coordinate system. How can I do that?

I checked all manuals before doing the question here and didn't find any solution for both questions.
Thanks a lot and sorry for using this forum for Syrthes questions.
Regards,
Jorge
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Syrthes extra questions

Post by Yvan Fournier »

Hello,

For 1), I doubt there would be any documentation, as the file is used "internally" for restarting purposes. If I were to try to determine how things are arranged for my own use, I would find the file (in the Syrthes source code) in which that file is opened, and work from there to see how data is written/stored in that file (using the reader might be even better). The "grep" command is your friend for such things, as well as reasonable file naming.

lire_fichier_ray.c would seem a good starting point (find nomfdf in that file)...

For 2), do you need the heat flux at a Code_Saturne/SYRTHES coupled boundary, or somewhere else ? In the first case, you can postprocess it directly from Code_Saturne. In the second case, I'm not sure what is the best solution, but SYRTHES might have output options...

Regards,

Yvan
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Re: Syrthes extra questions

Post by jingless »

Hello Yvan,
Thanks for your kind response. We really appreciate your advice. I respond to both items:

1) Totally agree. If access to this data is not present in the code, we should manipulate in order to get what we need. We will do that and report back here as soon as we have some results. One question, what do you mean with "using the reader might be even better"? That finding the mesh.fdf reader function would be a better starting point?

2) I would need the directional heat flux, all components and magnitude, in the whole domain, not only in the interface with Code_Saturne. There seems to be an option in Syrthes, Output/Result Fields tab. There, you can mark 3D heat flux field, but when I plot what is computed, it is not definitively any meaningful flux, mostly crap. We checked it solving a very simple and identifiable problem where we know the flux distribution. This could be a code bug.
Definitively, there should be other ways of computing the flux using the user functions I guess. But it is hard to me to assume that a thermal code do not have the flux result as a primary output. Most of the times, you need the flux field to understand what's going on in your problem, even more if you're solving something complex.

Thank you very much for your kind help.
Best regards,
Jorge
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Syrthes extra questions

Post by Yvan Fournier »

Hello,

For 2), I'm not sure. How did you plot the Syrthes output ? A bug could be due to incorrect interleaving of vector components (though I have not checked the code). If your material properties are constant and isotropic, you can also compute a reasonably accurate gradient with external tools such as ParaView, and reconstruct the flux from that. With hetreogeneous or anisotropic properties, this is more difficult...

I'll also move this thread to "usage", even though it is not for Code_Saturne (it is not a feature discussion thread either)

Regards,

Yvan
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Re: Syrthes extra questions

Post by jingless »

Hello Yvan,

When I choose 3D heat flux field in the Syrthes GUI, there is an extra result in the MED file, named "Calcul SYRTHES" besides the temperature field. If I don't mark the 3D heat flux field, this result is not present, so we think this is the flux calculation for obvious reasons.

When I plot this, it does not make any sense. See fluxSyrthes.png atached. Besides, it has only one magnitude, and I would expect magnitude and three components, X, Y, Z.

The problem is very symple, cube with all sides adiabatic, except two opposite faces, one with 1000 W/m² and the other with convection: h=5, Text=25ºC. Therefore, the heat flux must have only component in one axis, in this case the Y axis, being zero in the other two. The temperature field attached in: temperatureField.png.

If I compute the flux with Paraview, it's ok but near the borders, results are very bad computed, I think because the interpolation lacks backward or forward node, depending on the side of the cube: see attachment: fluxParavis.png.

I can live with the paravis calculated flux for internal purposes but I can't show this kind of result in a conference or somewhere else.

Any help would be much appreciated.

Best regards,
Jorge

pd: please move the thread to wherever forum you think is more appropriate. Thanks for that.
Attachments
fluxParavis.png
temperatureField.png
fluxSyrthes.png
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Syrthes extra questions

Post by Yvan Fournier »

Hello,

The computation with ParaView probably assumes Neumann boundary conditions for the gradient, explaining the boundary issues, so there is no good solution for that.

Do you postprocess using a MED or EnSight format ? It seems (looking at the sources) that Syrthes outputs 3 different fields for the flux (one for each component x, y, z), which you should be able to assemble as a vector using the calculator under ParaView.

Regards,

Yvan
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Re: Syrthes extra questions

Post by jingless »

Hello,

The computation within paraview, Filter: Gradient, uses central differences, so at the boundaries, the computation it's not very good, they should use there backward and forward differences.

In any case, I found how to compute the flux properly. It was there, we didn't realized but it was there sorry for wasting your time with this question. I'll report here how to do it, just in case someone else find it useful. So there we go: How to compute heat flux components in Syrthes and have this data available for Paraview postprocessing:

When you tick in the syrthes GUI the 3D/2D Heat Flux Fields, it is stored in results.add, assuming "results" is the keyword selected. So this information is not in the results.res or results.rdt. And therefore, it is not converted directly to MED or Ensight format and put in the POST directory. You have to do so manually. For that, you need to have the mesh.syr file and results.add in the same directory and issue the following command:
syrthes4med30 -m mesh.syr -r results.add -o flux.med, where the flux is stored in flux.med ready to be processed in Paraview, because it is MED compatible format. That's it.
It was very strange that a thermal code does not calculate heat flux directly.

Best regards and thank you very very much for your kind help.
Jorge
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Re: Syrthes extra questions

Post by jingless »

Hello,

With respect to question 1, view factors, we are still trying to figure out how to compute them. I just write now to highlight the importance of this. Thermal radiation depends deeply on the view factors value. And view factors are mesh-dependent. So, you really need to compute them and check their values in order to be sure that your mesh is ok for thermal radiation calculations. If you don't have the opportunity to do this type of checking on the view factors, more severe if your model is complex geometry, you never know if your calculations are accurate. Taking into account that thermal radiation goes with temperature to the forth, if your view factors are slightly incorrect, your temperature field could be totally wrong. So, for a thermal code to be reliable, you need a way to check the values of your view factors in order to validate your mesh. Most of the times, some tricks in the mesh apply. We learn those based on experience, but nobody can assure us that it's all good without a thoroughly investigation on the values of this factors.
I hope I explained myself correctly.

Best regards,
Jorge
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Syrthes extra questions

Post by Yvan Fournier »

Hello,

I don't understand how you want to check the view factors without an external computation of those same view factors (i.e. code verification). If you have advanced enough routines for this, I assume you should be able to plug them inside the code (grep'ing in addition should help you find where those factors are computed relatively easily) instead of comparing a file (as this adds the opportunity of modifying the mesh or view factors.

Regards,

Yvan
jingless
Posts: 13
Joined: Mon Feb 08, 2016 1:40 pm

Re: Syrthes extra questions

Post by jingless »

Hello Yvan,

It's about mesh verification, not code verification. I assume the code it's ok and the view factors computation is correct within Syrthes. Actually, there is a validation manual with many numerical versus analytical view factors computation demonstrating that Syrthes can compute correctly those values. And it surely does it very well!!

View factors are geometrical properties that must fulfil certain geometrical conditions:
1. Reciprocity
2. Summation of view factors in a closed enclosure must equal unity.

With those at hand, you can make further checkings when you don't have analytical solutions, in order to check how adequate is your mesh for the radiation calculation.

We keep trying to analyse the Syrthes code in order to write down view factors to a readable file. I'll post our experience when done with this issue.

Regards,
Jorge
Post Reply