2D axisymmetric steady state flow with moving wall heat transfer

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by lorenzo.iron »

Hello Yvan,

- what are the requirements to have access to code_neptune? It coule be very interesting also for our other applications.

- for now, with code_saturne I'm making considerations on the heat exchange based on the Reynolds number, shear stress and also the available dimensionless_heat_flux output, but for the last one I'd need to assess the formula ans his relation with the Nusselt number. Can you kindly advice?

- regarding the y+, it goes from 0.75 to 1.84. Is it OK for the purpose?

Thank you in advance.
Lorenzo
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by Yvan Fournier »

Hello,

Access to neptune_cfd is mostly done through "in kind" exchanges with partner labs (which make it interesting for large collaborations, but difficult to get permission for on our side for small projects).
There is also a homogeneous 2-phase model in code_saturne itself, but I do not know much about its valididy/application domain.

For your other question, with a y+ around 1, the best option is probably to avoid wall functions alltogether, as you are wall-resolved.

Best results,

Yvan
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by lorenzo.iron »

Thank you Yvan for your replies.

If getting neptune_cfd is not easy, is there any possibility to find someone able to run simulations for us? (for sure, terms are to be agreed)

I've a question unanswered, sorry if I bother you. Is the following the formula for the dimensionless_heat_flux?
Tstar.png
(5.21 KiB) Not downloaded yet
In that case, it would depend on the friction velocity (uk) and I have to make some calculations because in my case the speed of the fluid is ciclically changing along the pipe.

Thank you.
Lorenzo
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by Yvan Fournier »

Hello,

I'll try to think about who would be interested in running simulations with you for neptune_cfd.

The formula for T* seems correct.

Best regards,

Yvan
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by lorenzo.iron »

Dear Yvan,
hope you're doing well!

Concerning the bulk velocity in the sliding walls to simulate heat transfer (using a user-subroutine but staying on the simple side as per your trailing messages) is there any news?

Thank you thousand!
Have a nice day.
Lorenzo
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by Yvan Fournier »

Hello,

I just looked briefly at your case and mesh. To use internal coupling (in which case we can try to force the bulk velocity), you would need to add the solid part of the mesh. One issue though is that although it would probably be easy to add convection through a bulk solid velocity, the solid boundaries (i.e. ends of the steel bar) would not actually move.

Otherwise, using a separate mesh, which slides, adapting the old boundary-condition-only coupling might be better, as you could mesh the full length of the bar, and model heat exchange in all dimensions, but this would require a bit of adaptation to that coupling. I could help you with this using the "master" (development) branch of code_saturne, but you would at least need a first initial configuration with both meshes.

Finally, an alternative solution would be for you to model the behavior inside the steel bar (if its shape is simple enough) using a simple heat diffusion model, which could be coded entirely inside the user subroutine for boundary conditions. Which does amount to writing a simple code for that... If you already have a thermal model for the bar you could couple, that could be a good option.

Best regards,

Yvan
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by lorenzo.iron »

Dear Yvan,

I think that your second option would be fine, since the bar shape is simple and the calculation would be faster.
To begin with, I'd like to model each longitudinal section of the the bar like a uniform radial temperature field (Biot number < 0.1) in order to learn how to implement the subroutine. When the subroutine will be working, I will try to figure out how to extend it implementing finite difference model for bigger diameter bars.
So, the idea would be to implement the following classical heat exchange model for each bar section:
h*A*(T-Twater)dt = -m*cp*dT
The inlet bar section will always be at a T=T0 temperature, whereas the following moving sections shall take the temperature of the previous section and apply the dT according to the above formula.

Can you kindly show me how this can be coded into the boundary conditions subroutines?

Thank you.
Lorenzo
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by Yvan Fournier »

Hello,

There is a 1d wall thermal model in code_saturne, which basically handles the equivalent of your first step (1 bar per section), but is not adapted to extension to longitudinal exchange or to addition of sliding movement.

But you can always check the code for ideas.

Otherwise, if you model your bar as a 2d-Cartesian grid, even adding the movement, it will be very easy for a given code_saturne boundary face to determine the matching face of the solid grid. Then you can use the solid temperature as a Dirichlet condition for the Fluid, and compute the matching heat flux to provide to the solid (the second part is a bit trickier if you want to do it in the beginning of the time step, easier if you do it at the end, so we can proceed by stages)..

Do you prefer to code your solid model in C or Fortran (in the future, we will try to move to C only, but for now, both options are equivalent) ? Depending on the choice, I can provide you and point you to examples with the correct syntax.

Best regards,

Yvan
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by lorenzo.iron »

Good morning.

I can use both C or Fortran, but since in the future you will move to C only then I'd prefer to study a C example.

Thank you very much.
Lorenzo
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: 2D axisymmetric steady state flow with moving wall heat transfer

Post by Yvan Fournier »

Hello,

The simplest C example for boundary conditions is cs_user_boundary_conditions-notebook.c.

You can add pieces progressively; in the loop over the selected (zone) faces:

Code: Select all

for (cs_lnum_t ielt = 0; ielt < nelts; ielt++) {
    cs_lnum_t face_id = lstelt[ielt];

    icodcl[var_id*n_b_faces + face_id] = 1;
    rcodcl[var_id*n_b_faces + face_id] = t_bnd;
  }
The example simply showh how to apply boundary condition values (see the user documentation pdf or Doxygen examples for the meaning of icodcl and rcodcl).

Give a face id, you can get the matching face coordinates using cs_glob_mesh_quantities->b_face_cog array.
For examples on how this is used, check cs_user_1d_wall_thermal.c.

This is the key for you, because once you know where a given face's center lies, you can easily determine where it is relative to your 1D or 2D cartesian model for the iron bar.

I would suggest first prescribing a fixed temperature value, for example matching the x value, then possibly the initial x value including the bar's movement.

Once you have this working, you can try to apply the local heat flux matching the given prescribed wall temperature to the solid bar model. If you activate the visualization of the heat flux, the necessary T+ and T* fields will be activated, and you can use the cs_post_boundary_flux.c (https://www.code-saturne.org/cms/sites/ ... adc0fb5bbc) function to compute this at the selected faces.
I can guide you step by step as you make progress on your user-defined function.

Best regards,

Yvan
Post Reply