Page 1 of 1

possibility of multiple Code_Saturne instances coupling?

Posted: Thu Sep 20, 2018 5:31 pm
by lzhang
Hello,

I would like to know if it is possible to perform a multiple Code_Saturne instances coupling. My problem setting is as follows: For each instance, I will have an oscillating cylinder interacting with the fluid (it is a 2D simulation, as there is only one cell in the z direction). Then the instances will be coupled via le movement of the cylinder (transfer of displacement and velocity between instances), as if the cylinders were connected each other by springs. There is no interaction between each instance via the fluid domain.

I would like to know if it is conceptually possible to do this kind of simulation with Code_Saturne? I think at least for 2 instances coupling, this should be possible, one need to define the interface condition such that there is no exchange of pressure and velocity, but exchange of some additional variables (cylinder displacement and velocity).

Could you please tell me if what I have described here is possible (perhaps with a lot of code modifications) ? Or maybe there are other ideas to do this kind of simulation without using code coupling, as there are no exchange of physical quantities of fluid here.

Thanks!

Best regards,
Lei

Re: possibility of multiple Code_Saturne instances coupling?

Posted: Thu Sep 20, 2018 6:08 pm
by Yvan Fournier
Hello,

Yes, this should be possible with minor modifications.

It is already easy to run two or more domains simultaneously: when creating a case, if you create several cases simultaneously, for example:
code_saturne create -c domain_1 -c domain_2 -c domain_3
you will have a top-level "runcase" and "cs_coupling_parameters.py" allowing you to run the simulations coupled.

Then each domain will have its own execution subdirectory (under RESU_COUPLING) and using MPI, its own MPI communicator (cs_glob_mpi_comm).

If the cylinder displacements can be described easily, in a C user function such as cs_user_extra_operations or cs_user_initialize, you can exchange global information between the instances using MPI functions and MPI_COMM_WORLD. If the geometry is more complex, you can use the PLE functions for both domain synchronization and interpolation (2 different subsets). Documentation is very limited, though you can look at the src/base/cs_coupling.c, src/base/cs_sat_coupling.c, and src/base/cs_syr4_coupling.c for examples.

Regards,

Yvan

Re: possibility of multiple Code_Saturne instances coupling?

Posted: Fri Sep 21, 2018 1:41 pm
by lzhang
Hello,

Thanks a lot for your response, which confirms me that I can explore this approach. I'll make a try and let you know what I get.

Best regards,
Lei