Convective outlet boundary conditions

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Convective outlet boundary conditions

Post by Mohammad »

Hello,

I'm going to set a convective outlet boundary condition for the incompressible flow around a 3d airfoil, but I'm a little bit confused. I read the section about this type of boundary in the theory PDF file which is given below:

Image

I want to set this condition for three velocity components which means:






According to the text, the user must specify the (convective celerity) which is the freestream velocity () in my case and also which I think is the value of at the outlet boundary face at the previous time step so I set previous iteration values of , and, at the outlet boundary as s.

I used the following codes:

Code: Select all

double precision, dimension(:,:), pointer :: previous_vel
call field_get_val_prev_v(ivarfl(iu), previous_vel)
...
call getfbr("OUTLET", nlelt, lstelt)
do ilelt = 1, nlelt
   ifac = lstelt(ilelt)
   iel = ifabor(ifac)
   itypfb(ifac) = iindef
   
   icodcl(ifac,iu) = 2
   rcodcl(ifac,iu,1) = Uref
   rcodcl(ifac,iu,2) = previous_vel(1,iel)

   icodcl(ifac,iv) = 2
   rcodcl(ifac,iv,1) = Uref
   rcodcl(ifac,iv,2) = previous_vel(2,iel)

   icodcl(ifac,iw) = 2
   rcodcl(ifac,iw,1) = Uref
   rcodcl(ifac,iw,2) = previous_vel(3,iel)
enddo
But I have two problems:
1- The value of which is in my case, should be set as rcodcl(ifac,ivar,1) or rcodcl(ifac,ivar,2)?

2- What is the proper value for itypfb in this case (incompressible turbulent flow around an airfoil with convective outlet)? I used itypfb(ifac) = iindef because I didn't know what else to choose.

Please correct me if there is any mistake.

Thank you in advance for your support.

Regards,

Mohammad
Last edited by Mohammad on Thu Jul 30, 2020 11:26 am, edited 1 time in total.
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convective outlet boundary conditions

Post by Yvan Fournier »

Hello,

I have never used this type of BC, so I am not sure. Looking at the code in src/condli.f90, it seems both the rcodcl(ifac,iu,1) and rcodcl(ifac,iu,2) terms are used, and you can check the "set_convective_outlet_vector" to check the arguments.

I would guess you can set itypfb as a regular outlet.

If anyone has a better knowledge of this type od BC's setting, they are welcome to correct or complete this.

Best regards,

Yvan
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Convective outlet boundary conditions

Post by Mohammad »

Hello,

Thanks a lot dear Yvan.

I found that the first component, rcodcl(ifac,iu,1) is the velocity at the previous time step.
But setting a value for the second component rcodcl(ifac,iu,2) is confusing!

In the theory PDF file it is mentioned that these two components are (which is the previous time step values for velocity) and the coefficient (which is in my case).
Image

The rcodcl(ifac,iu,1) component is the velocity at boundary in previous time step. It's OK and there's no problem with it.
But for the rcodcl(ifac,iu,2) component which is the convective celerity () in the main equation of PDF, in condli.f90 file we have:

Code: Select all

cflv(1) = rcodcl(ifac,iu,2)
Now what is cflv? The answer is in the same file! In the same file at the line #4170 (CS 5.0.2) it is mentioned that it is the local Courant number used to convect! It is also mentioned in set_convective_outlet_vector() document.

Now I am confused! What should I set for rcodcl(ifac,iu,2)? Convective celerity (Mentioned in theory PDF) or local Courant number (Mentioned in condli.f90)? If the answer is the Courant number, then why should we enter the local Courant number as input while the code always calculates it in each cell at each time step automatically?

Finally what do you mean by regular outlet? ifrent or isolib?

Best Regards,

Mohammad
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convective outlet boundary conditions

Post by Yvan Fournier »

Hello,

For itypcl, I think isolib should be fine.

In all cases, I recommend using the GUI as much as possible, and only using user functions to complete or "overwrite" settings not available in the GUI. This keeps user functions smaller, more readable, and more maintainable. With the GUI, itypcl will be specified.

For the "cflv" value I am not sure. I recommend testing the code's behavior on a small, very simple case so as to see how the code behaves (this is what I do when I am not sure about something).

Regards,

Yvan
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Convective outlet boundary conditions

Post by Mohammad »

Yvan Fournier wrote: Thu Jul 30, 2020 2:32 pm Hello,

For itypcl, I think isolib should be fine.

In all cases, I recommend using the GUI as much as possible, and only using user functions to complete or "overwrite" settings not available in the GUI. This keeps user functions smaller, more readable, and more maintainable. With the GUI, itypcl will be specified.

For the "cflv" value I am not sure. I recommend testing the code's behavior on a small, very simple case so as to see how the code behaves (this is what I do when I am not sure about something).

Regards,

Yvan
Hello Yvan!

Thanks again for your quick and proper replies.
I can not use GUI because I'm usually on a cluster without GUI and also I use my own subgrid-scale model for LES which modifies some files of the CS.

By the way I'll check that out and will post the results in this topic.

About itypcl I think the iindef is much better for my case at the outlet boundary because according to the doxygen isolib uses Dirichlet condition for the pressure while I have to set the Neumann condition for pressure.

Regards,

Mohammad
Post Reply