Hello,
I'm trying to use Code Saturne-v4.0 r7278 to simulate a compressible flow case. I followed the example 4 on how to implement a subsonic inlet, however when I run my case I get the following error
@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
@ @@ WARNING: in thermodynamics computations
@ =======
@ Error encountered in thermodynamic computations
@ (cfther.f90), for perfect gas with constant gamma.
@
@ The computation of the subsonic inlet boundary
@ condition with imposed total pressure and
@ total enthalpy failed.
@
@ At boundary face 1
@ The direction vector given by the user can't be null.
@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
I'm assuming that that my boundary condition needs a direction vector. Looking at cfxtcl.f90 and cf_thermo_ph_inlet_bc function in cfther.f90, this is determined by bval(ifac,iu), bval(ifac,iv), and bval(ifac,iw). However, I'm little puzzled on how to implement this direction vector. I tried using rcodcl(ifac,iu,1), ... to specify the direction vector, but simulation crashes after calculating the temperature. The code doesn't output any error or anything, it just simply stops after calculating the temperature.
Carrying on from here, I tried to specify my boundary condition in the xml/gui. I tried giving it a unit vector and also the changing the direction to the normal direction of the inlet, but either option results in it crashing and stopping after calculating the temperature.
Please let me know if I'm making a simple mistake somewhere.
Thank you,
Andrew
Compressible Flow Module
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Compressible Flow Module
- Attachments
-
- restart.xml
- xml file
- (7.84 KiB) Downloaded 321 times
-
- cs_user_boundary_conditions.f90
- user_boundary_condition file
- (20.75 KiB) Downloaded 248 times
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Compressible Flow Module
Hello,
In your attached files, rcodcl is commented for the velocity, and it seems there is only an outlet and a wall condition.
Does this match your latest tests ?
Regards,
Yvan
In your attached files, rcodcl is commented for the velocity, and it seems there is only an outlet and a wall condition.
Does this match your latest tests ?
Regards,
Yvan
Re: Compressible Flow Module
Hi Yvan,
Yes, it should be correct. The case that I'm testing is RAE2822 airfoil at M=0.676. There should be a wall and subsonic outlet boundary condition in the xml file, and the subsonic inlet is specified in cs_user_boundary_conditions.f90. And there is periodic bc in the spanwise direction.
The rcodcl for velocity should be commented out. I tried at first to follow example 4 for compressible boundary conditions, but I got an error stating that my direction vector can't be null. I tried to specify the direction vector by specifying velocity vector at the boundary because according cfther.f90 and cfxtcl.f90 the direction vector is determined by velocity vector at the boundary. This approach didn't work and this would also over constrained the boundary.
Thank you,
Andrew
Yes, it should be correct. The case that I'm testing is RAE2822 airfoil at M=0.676. There should be a wall and subsonic outlet boundary condition in the xml file, and the subsonic inlet is specified in cs_user_boundary_conditions.f90. And there is periodic bc in the spanwise direction.
The rcodcl for velocity should be commented out. I tried at first to follow example 4 for compressible boundary conditions, but I got an error stating that my direction vector can't be null. I tried to specify the direction vector by specifying velocity vector at the boundary because according cfther.f90 and cfxtcl.f90 the direction vector is determined by velocity vector at the boundary. This approach didn't work and this would also over constrained the boundary.
Thank you,
Andrew
-
- Posts: 45
- Joined: Sun Sep 08, 2013 8:50 pm
Re: Compressible Flow Module
Hi Andrew,
The subsonic inlet at total pressure and total enthalpy is usually understood as a reservoir boundary condition (it is used in the De Laval nozzle test case for example), but it is worth to try it in your case using the total values far from the airfoil. From what you sent us I can see that's what you did except that the total pressure should not contain the dynamic pressure.
The direction has to be set via rcodcl or via the GUI because of course the boundary condition allows to compute only a velocity magnitude.
About the boundary condition in the spanwise direction, I don't really understand why you should have periodicity. I was more thinking about a symmetry boundary condition but I might have misunderstood your configuration.
If you still encounter issues with this case, could you post the listing as well ?
Regards,
Erwan.
The subsonic inlet at total pressure and total enthalpy is usually understood as a reservoir boundary condition (it is used in the De Laval nozzle test case for example), but it is worth to try it in your case using the total values far from the airfoil. From what you sent us I can see that's what you did except that the total pressure should not contain the dynamic pressure.
The direction has to be set via rcodcl or via the GUI because of course the boundary condition allows to compute only a velocity magnitude.
About the boundary condition in the spanwise direction, I don't really understand why you should have periodicity. I was more thinking about a symmetry boundary condition but I might have misunderstood your configuration.
If you still encounter issues with this case, could you post the listing as well ?
Regards,
Erwan.
Re: Compressible Flow Module
Hello,
The boundary condition works with the GUI if normal to the inlet is selected, but crashes if a direction vector is specified. Similarly if I specify the direction vector by using rcodcl in cs_user_boundary_conditions.f90, Code Saturne crashes in the first iteration.
I attached my listing file and the error files that I receive when I set a direction vector in the GUI. I receive the same error when I use rcodcl and cs_user_boundary_conditions.f90.
Thank you,
Andrew
The boundary condition works with the GUI if normal to the inlet is selected, but crashes if a direction vector is specified. Similarly if I specify the direction vector by using rcodcl in cs_user_boundary_conditions.f90, Code Saturne crashes in the first iteration.
I attached my listing file and the error files that I receive when I set a direction vector in the GUI. I receive the same error when I use rcodcl and cs_user_boundary_conditions.f90.
Thank you,
Andrew
- Attachments
-
- error_files.zip
- listing and error files
- (14.89 KiB) Downloaded 227 times
Re: Compressible Flow Module
I had a further look and I was calculating my specific enthalpy incorrectly.
There also appears to be bug in cs_user_initialization-compressible.f90, for Code_Saturne to recognize which variable is being used specified (Pressure, density, temperature, and total energy), there is the variable ithvar in v4.0. However, looking at previous versions and at the cfther.90 file, the code uses iccfth. If ithvar is used, the variables aren't initialized, but if ithvar is replaced with iccfth, the variables are initialized.
There also appears to be bug in cs_user_initialization-compressible.f90, for Code_Saturne to recognize which variable is being used specified (Pressure, density, temperature, and total energy), there is the variable ithvar in v4.0. However, looking at previous versions and at the cfther.90 file, the code uses iccfth. If ithvar is used, the variables aren't initialized, but if ithvar is replaced with iccfth, the variables are initialized.