PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Yvan Fournier »

Hello,

Sorry, I forgot.

Here is the same patch, with a print statement that should appear un your terminal (or batch report if running under a batch system).

If working, you should see "patch for BC's is active (zone i)" messages.

Best regards,

Yvan
Attachments
cs_gui_boundary_conditions.c
(112.99 KiB) Downloaded 137 times
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by tpa »

Hi Christopher.

See attached simulaton of your case, generated with v5.0.4. I get the same boundary condition error with boundary flow on mass basis. So using the area of the boundary surface in the mesh and my best guess om a boundary density I entered the boundary flow on a velocity basis instead. Probably not what you need but it seems to run.
With the provided and assumed data, the Mach numbers are rather high (massflow 0.2kg/s, boundary area 0.000107753m2, density 0.823kg/m3 corrected for boundary pressure 125000Pa and temperature 533K).
Attachments
video.ogv.zip
(632.47 KiB) Downloaded 129 times
Christopher
Posts: 36
Joined: Wed Feb 17, 2021 2:22 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Christopher »

Hi Yvan, hi tpa,

I appreciate your help.

Yvan, indeed your patch is called "patch for BC's is active (zone 0 to 4)". And that's for four times. However, the error message remains the same.

**********************
Starting calculation
**********************

patch for BC's is active (zone 0)
patch for BC's is active (zone 1)
patch for BC's is active (zone 2)
patch for BC's is active (zone 3)
patch for BC's is active (zone 4)
patch for BC's is active (zone 0)
patch for BC's is active (zone 1)
patch for BC's is active (zone 2)
patch for BC's is active (zone 3)
patch for BC's is active (zone 4)
patch for BC's is active (zone 0)
patch for BC's is active (zone 1)
patch for BC's is active (zone 2)
patch for BC's is active (zone 3)
patch for BC's is active (zone 4)
patch for BC's is active (zone 0)
patch for BC's is active (zone 1)
patch for BC's is active (zone 2)
patch for BC's is active (zone 3)
patch for BC's is active (zone 4)

tpa, could you please further explain what you mean with a "velocity basis instead"? I already used a velocity instead of a mass flow. This also ended with error. I also prefer a velocity of about 6 m/s at the inlet. The mass flow at the inlet was just a test, because I saw a case in this forum from a guy who made his simulation run with mass flow instead of velocity.

Thank you.

Kind regards,
Christopher
Christopher
Posts: 36
Joined: Wed Feb 17, 2021 2:22 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Christopher »

Hello again,

Is it possible that during the initialization the thermodynamic variables are not initialized correctly? I have attached a picture. Every time I set a value for pressure and temperature the icon turns green and in the context menu it shows the correct value. However, if I switch to another menu and then back, the icon is red again and die context menu says "Initialize the temperature in K. Tick the check box and ...". Does this cause my boundary errors? How or where can I add the missing part to my setup.xml file manually?

Best regards,
Christopher
Attachments
Init.png
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by tpa »

I have learned to live with these buttons turning red each time the Initialization tab is left and then returned to.

Your case is running on Code Saturne v5.0.4.

I just downloaded and build the present v5 (v5.0.13) and with that your case does not run. I then recompiled a v5.0.4 to see if my build environment is bad. The newly built v5.0.4 also runs your case well (now with 6m/s inlet velocity). So the troubles seem to start between the two. v5.0.4 is not perfect as the case failed when I used mass flow for inlet boundary condition but it works with velocity as inlet boundary condition.

I you go that route you might get a copy of the code for v5.0.4 to build, if you ask the right place.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Yvan Fournier »

Hello,

The button color is probably a minor bug. To see if information is lost, click on the button, to see if the formula is lost or kept from the previous edit.

It is quite strange the errors appear between revisions (normally bug-fixes) of a stable branch. I'll check this.

Could you provide the exact test case settings for that (I tested an earlier variant, but want to make sure i have the same XML and mesh). ?

Best regards,

Yvan
Christopher
Posts: 36
Joined: Wed Feb 17, 2021 2:22 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Christopher »

Hello,

here is the latest XML file. The mesh file is too large (12,5 MB) for upload. But I did no major changes to the mesh. So you could simply use the one I uploaded in my first post.

Best regards,
Christopher
Attachments
setup.xml
(9.99 KiB) Downloaded 131 times
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by tpa »

Attached video shows first evolution of flow for the case. The xml file I used is attached. I tried to operate later versions with this using the "code_saturne run -p setup.xml" with no real success. I would expect of this xml file to be the messenger between the gui and the code, leading to the suspicion that the cause is in the "deeper" coding in the stages from reading the xml to the application. One interesting test would be to program apply all boundary conditions by user FORTRAN but I have no experience with the user FORTRAN files. I have FORTRAN experience but have not the required understanding/experience with accessing the variables within Code Saturne.

Edit: This is Christophers topic, not mine. So give preference to helping Christopher. I only "blend in" because I would really like the compressible module to work. I will silently follow the topic now, unless asked. Good luck :-)
Attachments
setup.xml
(10.71 KiB) Downloaded 127 times
Exxon-II.ogv.zip
(1.75 MiB) Downloaded 135 times
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by tpa »

Yvan Fournier wrote: Sat Feb 20, 2021 3:41 am ... There is still another issue, in which after 2 time steps, the density becomes negative in about 1000 cells, meaning the pr,essure/temperature values are probably not in a reasonable range ...
Well just a remark: Sometimes the time step size is the parameter to fit in this case. I have best results using the "Variable" setting for time step and start out with something small and let code_saturne adapt based on CFL. Something might be in the nano seconds range to get the calculations running. Compare expected velocity range to cell size to see.
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: PROBLEM IN THE BOUNDARY CONDITIONS USING COMPRESSABLE MODEL

Post by Yvan Fournier »

Hello,

Using the initial 2D mesh and the latest setup.xml, I have the same error with v5.0.4 as with 5.0.12, even earlier (at the first time step rather than after 1 time step).

Perhaps, as mentioned earlier in the thread, it might be best to first start with "softer" boundary conditions.
Otherwise, I'll check if a more robust physical properties option is available (maybe stiffened gas instead of perfect gas).

Best regards,

Yvan
Post Reply