Page 4 of 4

Re: streamwise periodicity

Posted: Fri Aug 01, 2025 4:37 pm
by Yvan Fournier
Hello,

The old Fortran "divmas" subroutine was the equivalent of the current cs_divergence function, so assuming the reference uses the output od that function for the "divmas" term, you could use the output of cs_divergence to compute that.

Hoping this helps (as I have not delved into the theory for that part, but only in the code's naming changes).

Best regards,

Yvan

Re: streamwise periodicity

Posted: Mon Aug 11, 2025 9:00 pm
by ximeng
Hi Yvan,

Thanks for your reply. Do you have any example using cs_divergence?

I implemented it based on the general documentation from the source file, but the simulation freezes at the first step and stops with the following error:

SIGSEGV signal (forbidden memory area access) intercepted!
Call stack:
1: 0x402cb6 <cs_user_source_terms+0x756> (cs_solver)
2: 0x14d1786822c9 <covofi_+0x11f9> (libsaturne-8.0.so)
3: 0x14d17880f499 <scalai_+0x1185> (libsaturne-8.0.so)
4: 0x14d178815c1b <tridim_+0x4401> (libsaturne-8.0.so)
5: 0x14d17864e965 <caltri_+0x17fe> (libsaturne-8.0.so)
6: 0x14d179798252 <main+0x762> (libcs_solver-8.0.so)
7: 0x14d171bb329d <__libc_start_main+0xef> (libc.so.6)
8: 0x401e2a <_start+0x2a> (cs_solver)
End of stack

I’ve attached the source file and the run_solver.log for reference. Could you please suggest what might be causing the segmentation fault?

Best regards,
Ximeng

Re: streamwise periodicity

Posted: Mon Aug 11, 2025 11:43 pm
by Yvan Fournier
Hello,

For this, the bet solution is probably to use a debug build (compiled with --enable-debug), and run it under a debugger to pinpoint the issue (see https://www.code-saturne.org/documentat ... _debugging).

Best regards,

Yvan