Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems using cubit to generate cpml model files for forward simulation #1770

Open
zuoxuan-de opened this issue Dec 1, 2024 · 1 comment

Comments

@zuoxuan-de
Copy link

zuoxuan-de commented Dec 1, 2024

Hi guys, I've recently been trying to use cubit to generate cpml model files for forward simulation, but some times it works, but when I change the model it doesn't, there's a specific model creation process below, but no matter how much I try it, it doesn't work, the specific error report is as follows, I hope you can give me a little bit of advice, thank you very much!
I created a three-layer model in which there are two excavated lanes in the middle layer, and in addition, a trap column runs through all three layers of the medium.
#!/usr/bin/env python
import os

###########################################################################
###########################################################################

SEMoutput='collapse_1201_ini_MESH'
CUBIToutput='collapse_1201_ini_GEOCUBIT'

os.system('mkdir -p '+ SEMoutput)
os.system('mkdir -p '+ CUBIToutput)

import cubit
try:
cubit.init([""])
except:
pass

cubit.cmd('reset')
cubit.cmd('brick x 100 y 75 z 25')
cubit.cmd('move vol 1 x 50 y 37.5 z -12.5')

cubit.cmd('brick x 100 y 5 z 5')
cubit.cmd('move vol 2 x 50 y 7.5 z -12.5')

cubit.cmd('brick x 100 y 5 z 5')
cubit.cmd('move vol 3 x 50 y 67.5 z -12.5')

cubit.cmd('frustum z 21 radius 8 top 8')
cubit.cmd('move vol 4 x 40 y 37.5 z -12.5')

SUBTRACT VOL B FROM VOL A

cubit.cmd('subtract vol 2 from vol 1')
cubit.cmd('subtract vol 3 from vol 1')
cubit.cmd('subtract vol 4 from vol 1')

cubit.cmd('frustum z 21 radius 8 top 8')
cubit.cmd('move vol 6 x 40 y 37.5 z -12.5')

cubit.cmd('webcut vol all plane zplane offset -10 ')
cubit.cmd('webcut vol all plane zplane offset -15 ')

cubit.cmd('delete volume 9 11')

cubit.cmd('imprint all')
cubit.cmd('merge all')

Meshing the volumes

cubit.cmd('volume all size 1')

cubit.cmd('curve 48 49 61 interval 10')
cubit.cmd('curve 48 49 61 scheme equal')

cubit.cmd('mesh volume all')

cubit.cmd('draw volume all')

cubit.cmd('save as "' + CUBIToutput + '/meshing.cub" overwrite')

End of meshing

obsolete:

#import boundary_definition
#import cubit2specfem3d

new:

#from geocubitlib import boundary_definition
from geocubitlib import cubit2specfem3d

This is boundary_definition.py of GEOCUBIT

#..... which extracts the bounding faces and defines them into blocks
#boundary_definition.entities=['face']
#boundary_definition.define_bc(boundary_definition.entities,parallel=True)
cubit.cmd('block 1001 face in surface 1 ')
cubit.cmd('block 1001 name "face_topo"')

cubit.cmd('block 1002 face in surface 2 ')
cubit.cmd('block 1002 name "face_bottom"')

cubit.cmd('block 1003 face in surface 42 58 67 62 73')
cubit.cmd('block 1003 name "face_abs_xmin"')

cubit.cmd('block 1004 face in surface 43 63 72')
cubit.cmd('block 1004 name "face_abs_ymin"')

cubit.cmd('block 1005 face in surface 44 64 59 66 70')
cubit.cmd('block 1005 name "face_abs_xmax"')

cubit.cmd('block 1006 face in surface 41 60 69')
cubit.cmd('block 1006 name "face_abs_ymax"')

boundary

#boundary_definition.define_bc(parallel=True)

Define material properties for the 3 volumes

cubit.cmd('#### DEFINE MATERIAL PROPERTIES #######################')

cubit.cmd('block 1 hex in volume 5 7')
cubit.cmd('block 1 name "elastic 1" ') # material region
cubit.cmd('block 1 attribute count 7')
cubit.cmd('block 1 attribute index 1 1 ') # volume 2
cubit.cmd('block 1 attribute index 2 2700 ') # vp
cubit.cmd('block 1 attribute index 3 1500 ')# vs
cubit.cmd('block 1 attribute index 4 2200 ') # rho
cubit.cmd('block 1 attribute index 5 9999.0 ')# Qkappa
cubit.cmd('block 1 attribute index 6 9999.0 ')# Qmu
cubit.cmd('block 1 attribute index 7 0 ') # anisotropy_flag

cubit.cmd('block 2 hex in volume 9 10 11')
cubit.cmd('block 2 name "elastic 2" ') # material region
cubit.cmd('block 2 attribute count 7')
cubit.cmd('block 2 attribute index 1 2 ') # volume 2
cubit.cmd('block 2 attribute index 2 2000 ') # vp
cubit.cmd('block 2 attribute index 3 1150 ')# vs
cubit.cmd('block 2 attribute index 4 1400 ') # rho
cubit.cmd('block 2 attribute index 5 9999.0 ')# Qkappa
cubit.cmd('block 2 attribute index 6 9999.0 ')# Qmu
cubit.cmd('block 2 attribute index 7 0 ') # anisotropy_flag

cubit.cmd('block 3 hex in volume 6 8 12')
cubit.cmd('block 3 name "elastic 3" ') # material region
cubit.cmd('block 3 attribute count 7')
cubit.cmd('block 3 attribute index 1 3 ') # volume 2
cubit.cmd('block 3 attribute index 2 2500 ') # vp
cubit.cmd('block 3 attribute index 3 1400 ')# vs
cubit.cmd('block 3 attribute index 4 2150 ') # rho
cubit.cmd('block 3 attribute index 5 9999.0 ')# Qkappa
cubit.cmd('block 3 attribute index 6 9999.0 ')# Qmu
cubit.cmd('block 3 attribute index 7 0 ') # anisotropy_flag

file export

cubit2specfem3d.export2SPECFEM3D(SEMoutput,cpml=True, cpml_size=2, top_absorbing=True )
image
Also, I created a similar model, except without the trap columns, but it works fine. The specific error reported in the runtime here is as follows:
error.txt

And, I made sure that the parameters used here regarding stability are correct. If you have any further questions, please let me know.

@zuoxuan-de
Copy link
Author

And, this model with collapse works fine when I use Stacey boundary conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant