periodic boundary and velocity source production using ustsn

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Serra Sylvain

periodic boundary and velocity source production using ustsn

Post by Serra Sylvain »

Hello,
 
I have to perform a simulation using periodicity in the flow
direction.

The matter is that the velocities are equal to zero.

  In another topic, Yvan Fournier said to me that I have to
introduce a velocity source term using ustsns.f90. I think that this term have
to represent the loss of velocity due to the pressure drop across the domain…

  If anyone had already realise this kind of simulation, I am
very interesting by the solution.

  In every instance, I will give the solution when I obtain
it.

  Best regards,

  Sylvain
David Monfort

Re: periodic boundary and velocity source production using ustsns

Post by David Monfort »

Hi Sylvain,

Have a look at the your previous post Re: periodic boundary using .neu file

I've just gave an example on how to define such source term (didn't see this post before...)

David
Serra Sylvain

Re: periodic boundary and velocity source production using ustsns

Post by Serra Sylvain »

Hi David, here is your answer:
--------------------------------
Hello,
Another example, if you want to simulate a plane chanel flow with
periodic boundaries, you have to compute the balance between the
pressure force and the friction force, leading to the source term you
want to add.
So, in ustsns.f90 you will add an explicit source term (without forgetting to multiply by the volume of the cell) like this:
do iel = 1, ncel
  crvexp(iel) = volume(iel) * ro0(iphas).utau.utau/h
enddo
Here, the pressure gradient is balanced by the friction forces,
leading to this expression depending on the density, the friction
velocity and the half-height of the channel (this is related to the "wet
perimeter")
David
--------------------------------
 
Is there already developped in code-saturne a way to calculate utau?
may be using "iuetbo" but I am not sure. I am currently seraching on this way...
 
In fact what a search is to obtain a given mass flow rate on a not plane chanel flow with
periodic boundaries.
 
best regards
 
Sylvain
Serra Sylvain

Re: periodic boundary and velocity source production using ustsns

Post by Serra Sylvain »

Hello,
I did not succed to develop my sub-routine...
What I wish is to impose a mass flow rate on a non plane periodic chanel flow.
 
I read on the user guide that "iuetbo" permit to obtain the friction velocity but I do not know how I can use it (and I am not sure that it is possible).
 
I try many thinks without success...
 
 
 
My other question is :
is it possible to initialise the domaine with a mass flow rate?
I think that, if the subroutine can impose a mas flow rate, the initialisation is not very important but could increase the convergence...
 
 
Any help or advice would be appreciated.
Thanks,
 
Sylvain
Serra Sylvain

Re: periodic boundary and velocity source production using ustsns

Post by Serra Sylvain »

Hello,

concerning my problem, I found an example (http://cfd.mace.manchester.ac.uk/twiki/bin/view/CfdTm/TestCase013Res002) that (I think) solve what I want to do.

You will found enclosed the ustsns.f90 file.
 
This file works well in a bi-periodic channel with the velocity in the x direction but is applied to a volume that contained only one cell in the x et the z direction.

what I want to do is to use the file on a "real" 3D volume with many cells in the x, y et z directions.

This file with my geometry gives the good numbers of cells at the begin of the domain and obtained the good surface area.
 
The problem is that the resolution of the mass flow rate do not works with my geometry and I do not understand why.
 
the result is that the velocity increase without end...
 
Any help or advice on what is done in this file or why it is not appropriate for my geometry would be appreciated.
Attachments
ustsns_diffuser.f90
(15.81 KiB) Downloaded 259 times
Serra Sylvain

Re: periodic boundary and velocity source production using ustsns

Post by Serra Sylvain »

Hi all,
 
I realize the subroutine to perform simulation with periodicity in the flow direction.
(you should find enclosed the two files)
 
The principle is the following,
 
Before created the periodicity, the mesh was done with a name ‘entree’ to the boundary condition
at the inlet.  When the periodicity is taken into account, this face became an interior face but is still know by Code_Saturne.

So I solved the mass flow rate on this face (using “call getfac” and “ifluma(iu(iphas))”) and I compare
it with a reference mass flow rate (rho uref).

After what, I add a volume source term in order to keep the same mass flow rate for each time-step at the
beginning of the domain.
 
To increase the convergence of this source term, I take into account the difference between the mass flow
rate calculated and the reference at the time step n and n-1.
 
This subroutine is not “clean” in the sense that it remains some marks of the tests I did to develop
this subroutine but It works in my case.

An important point is that this subroutine is done for a periodicity in the x direction.
 
One thing I do not understand is that this subroutine works with a mesh created on gambit (.neu) but did not
work with a mesh created by Gmsh… in that case, ifluma gives bad values….

I do not try with other mesh formats.
 
If you have any comments, modification, improvements or explanations about Gmsh problem, I am already interesting.
 
Sylvain
Attachments
ustsns.f90
(17.67 KiB) Downloaded 280 times
inccha.h
(71 Bytes) Downloaded 271 times
Post Reply