Hi
using code_saturne 3.0.5 on debian 7.2
I'm trying to create an internal pipe with fixed transport conditions on temp and velocity. The input and output of this pipe are inside the mesh.
I succeeded in creating this internal pipe with the c function cs_user_mesh_thinwall
It also seems to work fine when setting the output velocity and temperature of this pipe flux with the rtpa function applied to the last cell(s) of the pipe, this in the cs_user_boundary_conditions.f90
Is this the right way to do it ?
Alternatively, I'd like to apply these conditions to the last face(s) (instead of the last cell(s) of the pipe). Something like the boundary inlet functions, like rcodcl(ifac, ) ... Is it possible to use rcodcl for an internal inlet (non boundary inlet) ? some other function ?
Thank you
setting internal temp and velocity
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: setting internal temp and velocity
Hello,
Without a picture of your mesh, it is hard to see what you mean by inlet and outlet inside the mesh (it probably depends on the level of detail of your mesh), but yes, thin walls allow you to handle this.
I recommend not modifying rtpa, as it is a computed quantity (that of the previous time step), and modifying it during a time step may lead to some inconsistencies in the numerical scheme. It may seem to work, but is not a precise way to do it.
There is no icodl/rcodcl for interior faces, so you cannot do this, but defining thin walls transforms interior faces to boundary faces (with minor issues for the volume post processing, which is not aware of the change), so you can use icodcl/rcodcl for thin wall faces.
So thin walls are probably the best solution in your case (again, not having seen our mesh).
Regards,
Yvan
Without a picture of your mesh, it is hard to see what you mean by inlet and outlet inside the mesh (it probably depends on the level of detail of your mesh), but yes, thin walls allow you to handle this.
I recommend not modifying rtpa, as it is a computed quantity (that of the previous time step), and modifying it during a time step may lead to some inconsistencies in the numerical scheme. It may seem to work, but is not a precise way to do it.
There is no icodl/rcodcl for interior faces, so you cannot do this, but defining thin walls transforms interior faces to boundary faces (with minor issues for the volume post processing, which is not aware of the change), so you can use icodcl/rcodcl for thin wall faces.
So thin walls are probably the best solution in your case (again, not having seen our mesh).
Regards,
Yvan
Re: setting internal temp and velocity
Here is the mesh (without the upper symmetry wall):
the flow of cooler air enters the inner chamber through the mouth. The very same air flows back in through the outside duct.Re: setting internal temp and velocity
and here is the simulation:
This simulation is done with rtpa applied for velocity and temperature to the cell located inside the lips of the mouth, this in the cs_user_boundary_conditions.f90I think that my problem is a bit different since I want a closed air circuit. I believe that a boundary inlet cannot flow back in the very same inside air ...Yvan Fournier wrote:Hello,
There is no icodl/rcodcl for interior faces, so you cannot do this, but defining thin walls transforms interior faces to boundary faces (with minor issues for the volume post processing, which is not aware of the change), so you can use icodcl/rcodcl for thin wall faces.
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: setting internal temp and velocity
Hello,
I assume your closed air circuit has some simplifications (pump not detailed), or uses natural convection only (in which case you do not need to force anything, but must have a fine mesh and adapted turbulence models so as to get the most precise heat transfer you can).
By your image, you probably do not strictly need an inlet/outlet (or thin walls) : if you want to force a given velocity at a certain point, the best solution is to "measure" the flow through the area of interest (cells or faces), and use a use source term (with feedback based on the measure) to drive the flow you want. The examples in the user source terms user subroutines are a bit minimalist, but are hopefully enough. Otherwise, if you do not manage to find examples in this forum, I can send you one later.
To replace you thin walls by a mesh "opening" without editing the mesh, just use mesh joining with the same selection criteria you used for thin walls.
You can use separate (independent) source terms for velocity and temperature if you need both.
Regards,
Yvan
I assume your closed air circuit has some simplifications (pump not detailed), or uses natural convection only (in which case you do not need to force anything, but must have a fine mesh and adapted turbulence models so as to get the most precise heat transfer you can).
By your image, you probably do not strictly need an inlet/outlet (or thin walls) : if you want to force a given velocity at a certain point, the best solution is to "measure" the flow through the area of interest (cells or faces), and use a use source term (with feedback based on the measure) to drive the flow you want. The examples in the user source terms user subroutines are a bit minimalist, but are hopefully enough. Otherwise, if you do not manage to find examples in this forum, I can send you one later.
To replace you thin walls by a mesh "opening" without editing the mesh, just use mesh joining with the same selection criteria you used for thin walls.
You can use separate (independent) source terms for velocity and temperature if you need both.
Regards,
Yvan
Re: setting internal temp and velocity
Hi
Thanks for your answers
Anyway I'm quite happy with python scripting under the Salomé's Mesh's module + cs_user_mesh_thinwall
As for setting the temperature, I just saw that there is the example cs_user_extra_operations-force_temperature.f90 that uses rtp. So I believe that with some precaution the result should be meaningfull. I can stand some imprecision.
With the rtp function, I can set the velocity and measure the real flow speed afterwards. This resulting speed is unstable but it seems that I can manage to set it with a good enough approximation (<+/-30%). I can stand an error of +/-50% for this velocity. If there's no other drawback, it's fine.
May I not ?
Thanks again
Thanks for your answers
I tried joining two meshes, one with volumes and one with the internal walls but the preprocessor stopped saying that the second does not contain volume elements.To replace you thin walls by a mesh "opening" without editing the mesh, just use mesh joining with the same selection criteria you used for thin walls.
Anyway I'm quite happy with python scripting under the Salomé's Mesh's module + cs_user_mesh_thinwall
Yes. There should be a pump and a cooler inside the lips of the mooth.I assume your closed air circuit has some simplifications (pump not detailed)
As for setting the temperature, I just saw that there is the example cs_user_extra_operations-force_temperature.f90 that uses rtp. So I believe that with some precaution the result should be meaningfull. I can stand some imprecision.
Source terms are too complicated for me.if you want to force a given velocity at a certain point, the best solution is to "measure" the flow through the area of interest (cells or faces), and use a use source term
With the rtp function, I can set the velocity and measure the real flow speed afterwards. This resulting speed is unstable but it seems that I can manage to set it with a good enough approximation (<+/-30%). I can stand an error of +/-50% for this velocity. If there's no other drawback, it's fine.
HummYou can use separate (independent) source terms for velocity and temperature if you need both.

May I not ?
Thanks again
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: setting internal temp and velocity
Hello,
Yes, you may "not" (you do not need to use independent source terms; I just wanted to say it is possible if you need it).
It is true using source terms is more complex than forcing the values at the previous time step, but the advantage is not only that is is more elegant, but that you can "measure" the source term, which, in your case, amounts to the pressure difference the pump needs to provide.
Forcing the previous values do work most of the time (even if it is not my favorite solution), so if it works for you and is sufficient, good.
Regards,
Yvan
Yes, you may "not" (you do not need to use independent source terms; I just wanted to say it is possible if you need it).
It is true using source terms is more complex than forcing the values at the previous time step, but the advantage is not only that is is more elegant, but that you can "measure" the source term, which, in your case, amounts to the pressure difference the pump needs to provide.
Forcing the previous values do work most of the time (even if it is not my favorite solution), so if it works for you and is sufficient, good.
Regards,
Yvan