Dear code_saturne developers and users
I am using code_saturne V7. When I used cs_user_initialization-compressbile.f90, I had an error as shown in the figure.
Same error occurs when I used cs_user_initialization-gas_ebu.f90 for the combustion case.
Does anyone also have the same problems when using cs_user_initialization.f90?
Best regards,
Liyuan
errors when use cs_user_initialization.f90
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 11
- Joined: Thu Mar 02, 2023 5:36 pm
Re: errors when use cs_user_initialization.f90
It seems there were errors of dimension when accessing the velocity array.
under fortran if you get the pointer of velocity vel, then the initialisation for the cell iel is
vel(1, iel) = u0
vel(2, iel) = v0
vel(3, iel) = w0.
Notice now the compressible module is not compatible with combustion module, the behaviour is not tested. I posted under your previous question how to consider the density variation. If your scenario is low mach where the acoustic wave is negligible, you don't need to use compressible algorithm.
under fortran if you get the pointer of velocity vel, then the initialisation for the cell iel is
vel(1, iel) = u0
vel(2, iel) = v0
vel(3, iel) = w0.
Notice now the compressible module is not compatible with combustion module, the behaviour is not tested. I posted under your previous question how to consider the density variation. If your scenario is low mach where the acoustic wave is negligible, you don't need to use compressible algorithm.
-
- Posts: 11
- Joined: Thu Mar 02, 2023 5:36 pm
Re: errors when use cs_user_initialization.f90
Thanks Li for your reply.
I am setting up a case with low Ma number. I was trying to set up a state equation by using the cs_user_physical_properties.f90 and the cs_user_initialization.f90 was required. Currently, what I need is having an viable density with temperature follow the BML expression.
I am setting up a case with low Ma number. I was trying to set up a state equation by using the cs_user_physical_properties.f90 and the cs_user_initialization.f90 was required. Currently, what I need is having an viable density with temperature follow the BML expression.
Re: errors when use cs_user_initialization.f90
So you just need to use the idilat option to represent the variable density.
Feel free if you have any questions about the initialization
Li
Feel free if you have any questions about the initialization
Li
-
- Posts: 11
- Joined: Thu Mar 02, 2023 5:36 pm
Re: errors when use cs_user_initialization.f90
Dear Li,
I have used the incompressible with variable density as you suggested. I have figured out the variable density issue by using the cs_user_initialization.c and cs_user_physical_properties.c Now the density output is as expected.
However, I feel confused about how the algorithm works by using incompressible solver to solve compressible flow introduced by variable temperature? Do you have any suggestion for understanding it?
Best regards,
Liyuan
I have used the incompressible with variable density as you suggested. I have figured out the variable density issue by using the cs_user_initialization.c and cs_user_physical_properties.c Now the density output is as expected.
However, I feel confused about how the algorithm works by using incompressible solver to solve compressible flow introduced by variable temperature? Do you have any suggestion for understanding it?
Best regards,
Liyuan
Re: errors when use cs_user_initialization.f90
Hello,
The variation in density is not necessarily linked to the compresibility of the fluids. As you see in your case, the density is only or almost only a function of temperature, sometimes the density is a function of mixture of two gases too, though the Mach number is actually low(even smaller than 0.1). The incompressible solver may be used with a density variation term as source term for the pressure equation.
In fact, one must consider the compressibility if the density depends significantly on the pressure, when drho/dp = 1/c^2 becomes non-negligible, that is to say the sound speed here c is no longer infinite.
Otherwise, it is what happens in your case, drho/dp equals nearly zero and drho/dT is quite significant. If a true compressible solver was used for this kind of fluids, the computation would be very slow and sometimes diverge without a preconditioner.
Li
The variation in density is not necessarily linked to the compresibility of the fluids. As you see in your case, the density is only or almost only a function of temperature, sometimes the density is a function of mixture of two gases too, though the Mach number is actually low(even smaller than 0.1). The incompressible solver may be used with a density variation term as source term for the pressure equation.
In fact, one must consider the compressibility if the density depends significantly on the pressure, when drho/dp = 1/c^2 becomes non-negligible, that is to say the sound speed here c is no longer infinite.
Otherwise, it is what happens in your case, drho/dp equals nearly zero and drho/dT is quite significant. If a true compressible solver was used for this kind of fluids, the computation would be very slow and sometimes diverge without a preconditioner.
Li
-
- Posts: 11
- Joined: Thu Mar 02, 2023 5:36 pm
Re: errors when use cs_user_initialization.f90
Hey Li,
Thanks for your informative reply. Now I can understand. My problems are solved by implementing the BML expression.
I have attached the code as well for others who have the same confusion.
Best regards,
Liyuan
Thanks for your informative reply. Now I can understand. My problems are solved by implementing the BML expression.
I have attached the code as well for others who have the same confusion.
Best regards,
Liyuan
- Attachments
-
- cs_user_physical_properties.c
- (3.63 KiB) Downloaded 485 times