MFlowCode / MFC

Exascale simulation of multiphase/physics fluid dynamics
https://mflowcode.github.io
MIT License
132 stars 56 forks source link

IB-DB Treatment #407

Closed haochey closed 1 month ago

haochey commented 1 month ago

Description

This PR adds the treatment for cases where immersed boundaries touch the domain boundaries.

Type of change

Please delete options that are not relevant.

Scope

If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.

How Has This Been Tested?

Use 2D rectangle and circle as well as 3D cylinder and sphere IBs touching the domain boundary w/ shock wave and high amplitude acoustic wave.

https://github.com/MFlowCode/MFC/assets/98496194/1feab706-34a2-4f03-91f4-f0c6e389aee1

https://github.com/MFlowCode/MFC/assets/98496194/4595cf58-730a-494b-bca4-550672b076c7

https://github.com/MFlowCode/MFC/assets/98496194/6d3589e2-d4ed-4b3e-a124-4773ba67f357

https://github.com/MFlowCode/MFC/assets/98496194/c62b4723-cf31-4acf-afc0-3fd23507506a

https://github.com/MFlowCode/MFC/assets/98496194/caec1540-e27b-46f6-9767-af65aa19b1b3

https://github.com/MFlowCode/MFC/assets/98496194/ae8feb88-a9d2-4fb6-be94-13c797623428

https://github.com/MFlowCode/MFC/assets/98496194/26a3efc3-002b-4430-aed0-f324901e5c7f

Test Configuration:

Sample 2D cases: 149*49

    'time_stepper'                 : 3,
    'weno_order'                   : 5,
    'weno_eps'                     : 1.E-16,
    'weno_Re_flux'                 : 'F',
    'weno_avg'                     : 'F',
    'avg_state'                    : 2,
    'mapped_weno'                  : 'F',
    'null_weights'                 : 'F',
    'mp_weno'                      : 'F',
    'riemann_solver'               : 2,
    'wave_speeds'                  : 1,
    'bc_x%beg'                     : -6,
    'bc_x%end'                     : -6,
    'bc_y%beg'                     : -15,
    'bc_y%end'                     : -15,
    'ib'                           : 'T',
    'num_ibs'                      :  1, 
    'patch_icpp(1)%geometry'       : 3,
    'patch_icpp(1)%x_centroid'     : x1/2, 
    'patch_icpp(1)%y_centroid'     : x2/2,
    'patch_icpp(1)%length_x'       : x1,
    'patch_icpp(1)%length_y'       : x2,
    'patch_icpp(1)%vel(1)'         : 0.0E+00,
    'patch_icpp(1)%vel(2)'         : 0.0E+00,
    'patch_icpp(1)%pres'           : 1.0E+05,
    'patch_icpp(1)%alpha_rho(1)'   : (1.0 - 1e-12)*rho1,
    'patch_icpp(1)%alpha(1)'       : 1.0 - 1e-12,
    'patch_icpp(1)%alpha_rho(2)'   : 1.0e-12*rho2,
    'patch_icpp(1)%alpha(2)'       : 1.0e-12,

    'patch_icpp(2)%geometry'       : 3,
    'patch_icpp(2)%alter_patch(1)' : 'T',
    'patch_icpp(2)%x_centroid'     : x1/8, 
    'patch_icpp(2)%y_centroid'     : x2/2,
    'patch_icpp(2)%length_x'       : x1/4,
    'patch_icpp(2)%length_y'       : x2,
    'patch_icpp(2)%vel(1)'         : 80.0E+00,
    'patch_icpp(2)%vel(2)'         : 0.0E+00,
    'patch_icpp(2)%pres'           : 1.0E+05,
    'patch_icpp(2)%alpha_rho(1)'   : (1.0 - 1e-12)*rho1,
    'patch_icpp(2)%alpha(1)'       : 1.0 - 1e-12,
    'patch_icpp(2)%alpha_rho(2)'   : 1.0e-12*rho2,
    'patch_icpp(2)%alpha(2)'       : 1.0e-12,

     'patch_ib(1)%geometry'          : 3,
     'patch_ib(1)%x_centroid'        : x1/2,
     'patch_ib(1)%y_centroid'        : 5*x2/6,
     'patch_ib(1)%length_x'          : x1/4,
     'patch_ib(1)%length_y'          : x2/2,
     'patch_ib(1)%slip'                   : 'F',

Sample 3D cases: 89^3

'time_stepper'                 : 3,
'weno_order'                   : 5,
'weno_eps'                     : 1.E-16,
'weno_Re_flux'                 : 'F',
'weno_avg'                     : 'F',
'avg_state'                    : 2,
'mapped_weno'                  : 'F',
'null_weights'                 : 'F',
'mp_weno'                      : 'F',
'riemann_solver'               : 2,
'wave_speeds'                  : 1,
'bc_x%beg'                     : -6,
'bc_x%end'                     : -6,
'bc_y%beg'                     : -3,
'bc_y%end'                     : -3,
'bc_z%beg'                     : -1,
'bc_z%end'                     : -1,
'ib'                                    : 'T',
'num_ibs'                         : 1,
'patch_icpp(1)%geometry'       : 9,
'patch_icpp(1)%x_centroid'     : 5.0,
'patch_icpp(1)%y_centroid'     : 5.0,
'patch_icpp(1)%z_centroid'     : 5.0,
'patch_icpp(1)%length_x'       : 10,
'patch_icpp(1)%length_y'       : 10,
'patch_icpp(1)%length_z'       : 10,
'patch_icpp(1)%vel(1)'         : 0,
'patch_icpp(1)%vel(2)'         : 0.0E+00,
'patch_icpp(1)%vel(3)'         : 0.0E+00,
'patch_icpp(1)%pres'           : 10918.2549,
'patch_icpp(1)%alpha_rho(1)'   : 1.22,
'patch_icpp(1)%alpha(1)'       : 1.E+00,

'patch_icpp(2)%geometry'       : 9,
'patch_icpp(2)%x_centroid'     : 2.0,
'patch_icpp(2)%y_centroid'     : 5.0,
'patch_icpp(2)%z_centroid'     : 5.0,
'patch_icpp(2)%length_x'       : 4,
'patch_icpp(2)%length_y'       : 10,
'patch_icpp(2)%length_z'       : 10,
'patch_icpp(2)%vel(1)'         : 100,
'patch_icpp(2)%vel(2)'         : 0.0E+00,
'patch_icpp(2)%vel(3)'         : 0.0E+00,
'patch_icpp(2)%pres'           : 10918.2549,
'patch_icpp(2)%alpha_rho(1)'   : 1.22,
'patch_icpp(2)%alpha(1)'       : 1.E+00,
'patch_icpp(2)%alter_patch(1)' : 'T',

'patch_ib(1)%geometry'       : 10,
'patch_ib(1)%x_centroid'     : 6,
'patch_ib(1)%y_centroid'     : 10,
'patch_ib(1)%z_centroid'     : 5,
'patch_ib(1)%length_z'       : 5,
'patch_ib(1)%radius'         : 2,
'patch_ib(1)%slip'           : 'F',

Checklist

If your code changes any code source files (anything in src/simulation)

To make sure the code is performing as expected on GPU devices, I have:

haochey commented 1 month ago

Here is the additional 2D test to visualize the expected parabolic profile using IBs.

https://github.com/MFlowCode/MFC/assets/98496194/f1cc7bf0-beb0-4d3f-aed0-b23f57fbe703