def build_emulsion_kwargs(prop_names, values, weathering, ref_temp_k, age_days): ''' Build emulsion properties dictionary suitable to be passed in as keyword args. - prop_names: The list of property names - values: A list of Excel cell objects representing the properties. - weathering: The fractional oil weathering amount. ''' emul_kwargs = dict(zip(prop_names, [v[0].value for v in values])) emul_kwargs['weathering'] = weathering emul_kwargs['ref_temp_k'] = ref_temp_k emul_kwargs['age_days'] = age_days # emul_kwargs['complex_modulus_pa'] # already there # emul_kwargs['storage_modulus_pa'] # already there # emul_kwargs['loss_modulus_pa'] # already there # emul_kwargs['tan_delta_v_e'] # already there # emul_kwargs['complex_viscosity_pa_s'] # already there emul_kwargs['water_content_fraction'] = percent_to_fraction( emul_kwargs['water_content_w_w']) return emul_kwargs
def get_water_content_by_weathering(oil_columns, field_indexes, weathering): water_contents = [] props = get_oil_properties_by_category(oil_columns, field_indexes, 'water_content_astm_e203') prop_names = list(props.keys()) for idx, vals in enumerate(zip(*list(props.values()))): kwargs = build_kwargs(prop_names, vals, weathering[idx]) water_contents.append(kwargs) return [percent_to_fraction(get_op_and_value(f['water_content'])[1]) for f in water_contents if f['water_content'] is not None]
def get_wax_content_by_weathering(oil_columns, field_indexes, weathering): wax_contents = [] props = get_oil_properties_by_category(oil_columns, field_indexes, 'wax_content_ests_1994') prop_names = list(props.keys()) for idx, vals in enumerate(zip(*list(props.values()))): kwargs = build_kwargs(prop_names, vals, weathering[idx], props_to_rename={'waxes': 'wax_content'}) wax_contents.append(kwargs) return [percent_to_fraction(f['wax_content']) for f in wax_contents if f['wax_content'] is not None]
def get_sulfur_content_by_weathering(oil_columns, field_indexes, weathering): sulfur_contents = [] props = get_oil_properties_by_category(oil_columns, field_indexes, 'sulfur_content_astm_d4294') prop_names = props.keys() for idx, vals in enumerate(zip(*props.values())): kwargs = build_kwargs(prop_names, vals, weathering[idx]) sulfur_contents.append(kwargs) return [ percent_to_fraction(f['sulfur_content']) for f in sulfur_contents if f['sulfur_content'] is not None ]
def get_asphaltenes_fraction_by_weathering(oil_columns, field_indexes, weathering): asphaltenes_fractions = [] props = get_oil_properties_by_category(oil_columns, field_indexes, 'hydrocarbon_group_content') prop_names = list(props.keys()) for idx, vals in enumerate(zip(*list(props.values()))): props_to_rename = {'asphaltene': 'asphaltenes_fraction'} kwargs = build_kwargs(prop_names, vals, weathering[idx], props_to_rename=props_to_rename) asphaltenes_fractions.append(kwargs) return [percent_to_fraction(f['asphaltenes_fraction']) for f in asphaltenes_fractions if f['asphaltenes_fraction'] is not None]
def build_emulsion_kwargs(prop_names, values, weathering, ref_temp_k, age_days): ''' Build emulsion properties dictionary suitable to be passed in as keyword args. - prop_names: The list of property names - values: A list of Excel cell objects representing the properties. - weathering: The fractional oil weathering amount. ''' emul_kwargs = dict(zip(prop_names, [v[0].value for v in values])) emul_kwargs['weathering'] = weathering emul_kwargs['ref_temp_k'] = ref_temp_k emul_kwargs['age_days'] = age_days # emul_kwargs['complex_modulus_pa'] # already there # emul_kwargs['storage_modulus_pa'] # already there # emul_kwargs['loss_modulus_pa'] # already there # emul_kwargs['tan_delta_v_e'] # already there # emul_kwargs['complex_viscosity_pa_s'] # already there emul_kwargs['water_content_fraction'] = percent_to_fraction(emul_kwargs['water_content_w_w']) return emul_kwargs