Skip to content

Commit

Permalink
fixes for some melt-fluid handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanozaydin committed Mar 22, 2024
1 parent 962cf4c commit b862c74
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
3 changes: 0 additions & 3 deletions SEL/SEL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,9 +1389,6 @@ def set_melt_fluid_conductivity_choice(self,**kwargs):
SEL.melt_cond_selection = kwargs.pop('melt', 0)
SEL.fluid_cond_selection = kwargs.pop('fluid', 0)

import ipdb
ipdb.set_trace()

if (SEL.melt_cond_selection < 0) or (SEL.melt_cond_selection > len(self.name[1])):

raise ValueError('Bad entry for melt conductivity selection. Indexes allowed are from 0 to ' + str(len(self.name[1])))
Expand Down
6 changes: 3 additions & 3 deletions SEL/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def __init__(self, name = "Unnamed", material_index = None, calculation_type = '

if melt_fluid_cond_selection == None:
if self.melt_or_fluid == 'melt':
melt_fluid_cond_selection = {'melt':0}
melt_fluid_cond_selection = 0
else:
melt_fluid_cond_selection = {'fluid':0}
melt_fluid_cond_selection = 0
self._melt_fluid_cond_selection = None
self.melt_fluid_cond_selection = melt_fluid_cond_selection

Expand Down Expand Up @@ -122,7 +122,7 @@ def __init__(self, name = "Unnamed", material_index = None, calculation_type = '

self.linked_material_index = kwargs.pop('linked_material_index', None)

self.fluid_salinity = kwargs.pop('fluid_salinity', None)
self.fluid_salinity = kwargs.pop('fluid_salinity', 0.0)

if (self.calculation_type == 'value') and (self.resistivity_medium == None):

Expand Down
10 changes: 9 additions & 1 deletion SEL/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ def run_conductivity_model(index_list, material, sel_object, t_array, p_array, m
sel_object.set_solid_melt_fluid_mix_method(material.melt_fluid_phase_mixing_idx)

if melt_array[index_list].any() > 0.0:
material.melt_fluid_incorporation_method == 'field' #if melt exists it overwrites the field value.


if material.melt_fluid_incorporation_method == 'value':
sel_object.set_melt_fluid_frac(material.melt_fluid_frac)

if material.melt_or_fluid == 'melt':
sel_object.set_melt_or_fluid_mode('melt')
else:
sel_object.set_melt_or_fluid_mode('fluid')

sel_object.set_melt_fluid_frac(material.melt_fluid_frac)

elif material.melt_fluid_incorporation_method == 'field':

sel_object.set_melt_or_fluid_mode('melt') #only melt field can be taken from the area
sel_object.set_melt_fluid_frac(melt_array[index_list])

else:
pass

Expand Down Expand Up @@ -177,6 +184,7 @@ def run_conductivity_model(index_list, material, sel_object, t_array, p_array, m

if material.melt_fluid_cond_selection != None:
if material.melt_or_fluid == 'melt':

sel_object.set_melt_fluid_conductivity_choice(melt = material.melt_fluid_cond_selection)
if material.melt_fluid_phase_mixing_idx == 0:
sel_object.set_melt_fluid_interconnectivity(melt = material.melt_fluid_m)
Expand Down
6 changes: 4 additions & 2 deletions tools/convert_3duw_model_2_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

# source_folder = "/scratch/q97/so0195/pide2/3D_model_convert/3dmodel"
# source_folder = "/scratch/q97/pxr562/2020/PullApt300r/ProtPA300r"
source_folder = "/home/sinan/Desktop/Research/SEL/3d_work_dir/ProtPA300r"
# source_folder = "/home/sinan/Desktop/Research/SEL/3d_work_dir/ProtPA300r"
source_folder = "/home/sinan/Desktop/Research/pide/3d_conversion"

#setting up filename folders for the h5 files.

Expand Down Expand Up @@ -158,13 +159,14 @@
LowerCrustObject2 = Material(name = 'Continental_Lower_Crust_Mafic_Granulite',material_index = 8, calculation_type = 'mineral', composition = {'plag':0.31, 'garnet':0.19,
'cpx':0.25, 'opx':0.05,'amp':0.12, 'quartz':0.04,'kfelds':0.03,'other':0.01},
el_cond_selections = {'plag':1, 'garnet': 0, 'opx':0, 'amp':0, 'quartz': 7, 'cpx':9, 'kfelds':2, 'other':0}, solid_phase_mixing_idx = 1,
melt_fluid_incorporation_method = 'value', melt_or_fluid = 'fluid', melt_fluid_cond_selection = 0, melt_fluid_frac = 0.05,
deformation_dict = {'function_method':'exponential',
'conductivity_decay_factor':0.2, 'strain_decay_factor':0.2,'strain_percolation_threshold':None})

LowerCrustObject2_b = Material(name = 'Continental_Lower_Crust_Mafic_Granulite',material_index = 8, calculation_type = 'mineral', composition = {'plag':0.31, 'garnet':0.19,
'cpx':0.25, 'opx':0.05,'amp':0.12, 'quartz':0.04,'kfelds':0.03,'other':0.01},
el_cond_selections = {'plag':1, 'garnet': 0, 'opx':0, 'amp':0, 'quartz': 7, 'cpx':9, 'kfelds':2, 'other':0}, solid_phase_mixing_idx = 2,
melt_fluid_incorporation_method = 'value', melt_or_fluid = 'fluid', melt_fluid_cond_selection = 0,melt_fluid_frac = 0.05,
melt_fluid_incorporation_method = 'value', melt_or_fluid = 'fluid', melt_fluid_cond_selection = 0, melt_fluid_frac = 0.05,
deformation_dict = {'function_method':'exponential',
'conductivity_decay_factor':0.2, 'strain_decay_factor':0.2,'strain_percolation_threshold':None})

Expand Down

0 comments on commit b862c74

Please sign in to comment.