Exemplo n.º 1
0
def process(i,j,comp=0.5, heat_map_scale='Pt_ref', pt_oxid_V=0.6470339):
	"""
	Creates and analyzes a Pourbaix Diagram from two elements (they can be the
	same ex. Pt,Pt). Finds relevant entries, creates Pourbaix diagram,
	identifies stable phases, and calculates the stability of the phase

	Args:
		i: First element in the system
		j: Second element in the system
		comp: Composition loading of the two elements (default is 0.5)
	"""
	#| -  - process
	entries = pd_entries(i.symbol,j.symbol)
	coord = phase_coord(entries, comp, prim_elem=i.symbol)
	filt1 = phase_filter(coord,'metallic')
	filt2 = phase_filter(coord,'metallic_metallic')
	filt = filt1 + filt2

	# msp = most_stable_phase(filt,Pt_ref=True)
	if not filt:
		print 'heat_map.process - no phase present - '+i.symbol+'-'+j.symbol
		msp = [-1.5,'Pourbaix Entry placeholder']	# TEMP
	else:
		msp = most_stable_phase(filt, scale=heat_map_scale, pt_oxid_V=pt_oxid_V)
		# msp = most_stable_phase(filt,pH=10.5,scale=heat_map_scale)
	return msp
Exemplo n.º 2
0
def ref_atoms(i,j, scale):
	"""
	TEMP
	"""
	#| -  - ref_atoms
	ref_atoms = pd_entries(i.symbol,j.symbol)
	print ref_atoms	#TEMP_PRINT
	return ref_atoms
	print ref_atoms # TEMP_PRINT
Exemplo n.º 3
0
def process_alloy(i,
                  j):  # Deprecated *******************************************
    """
	Creates and analyzes a Pourbaix Diagram from two elements (they can be the
	same ex. Pt,Pt). Finds relevant entries, removes the pure element entries,
	for each alloy removes all other alloys and analyzes stability of all
	forced alloy phases. Returns the the most highest performing forced alloy
	phase.

	Args:
		i: First element in the system
		j: Second element in the system
	"""
    # | -  - process_alloy
    entries = pd_entries(i.symbol, j.symbol)
    #	entries = pure_atoms_remove(entries)
    alloy_entr = alloy_entries(entries)
    if not alloy_entr:
        print 'heat map - no alloy entries'
        non_alloy = process(i, j)
        return non_alloy

    base_atoms = base_atom(entries)
    alloy_performance_lst = []
    for alloy in alloy_entr:
        entries_0 = entries[:]
        comp = alloy.composition \
         .fractional_composition.get_atomic_fraction(base_atoms[0])
        for alloy_0 in alloy_entr:
            if not alloy_0 == alloy: entries_0.remove(alloy_0)

        coord = phase_coord(entries_0, comp)
        filt1 = phase_filter(coord, 'metallic')
        filt2 = phase_filter(coord, 'metallic_metallic')
        filt = filt1 + filt2
        try:
            alloy_performance_lst.append(
                most_stable_phase(filt, scale='Pt_ref'))
        except:
            pass

    alloy_performance_lst.sort(key=lambda x: x[0], reverse=True)
    # NOTE This sort will not work when the performance criteria is distance
    # from the ORR line (which needs to be as small as possible)
    try:
        best_alloy = alloy_performance_lst[0]
    except:
        best_alloy = [-1, 'placeholder']  #NOTE Make this better
    return best_alloy
Exemplo n.º 4
0
def oxidation_dissolution_product_0(i, j, scale):
	"""
	Creates Pourbaix Diagrams for single or binary systems
	"""
	#| -  - oxidation_dissolution_product_0
	# from pourdiag import pd_entries

	from pymatgen.analysis.pourbaix.maker import PourbaixDiagram
	from pymatgen.analysis.pourbaix.plotter import PourbaixPlotter
	from pd_screen_tools import phase_coord, phase_filter
	from stability_crit import most_stable_phase, oxidation_dissolution_product

	elem0 = i.symbol; elem1 = j.symbol

	mat_co_0 = 0.50		# Composition of 1st entry in elem_sys

	entr = pd_entries(elem0,elem1)
	pourbaix = PourbaixDiagram(entr,{elem0: mat_co_0,elem1: 1-mat_co_0})
	plotter = PourbaixPlotter(pourbaix)

	coord = phase_coord(entr,mat_co_0)
	filt1 = phase_filter(coord,'metallic')
	filt2 = phase_filter(coord,'metallic_metallic')
	filt = filt1 + filt2
	msp = most_stable_phase(filt,scale='RHE')

	tmp = oxidation_dissolution_product(coord,msp)

	if 'Ion' in tmp:
		entry_lst = 'dis'
	else:
		entry_lst = 'oxi'

	"""
	entry_lst = ''
	i_cnt = 0
	for i in tmp:
		entry_lst = str(entry_lst)+'\n'+str(i)
		if i_cnt==0:
			entry_lst = entry_lst[1:]
		i_cnt=i_cnt+1

	"""
	return entry_lst
Exemplo n.º 5
0
def process_alloy(i,j):	# Deprecated *******************************************
	"""
	Creates and analyzes a Pourbaix Diagram from two elements (they can be the
	same ex. Pt,Pt). Finds relevant entries, removes the pure element entries,
	for each alloy removes all other alloys and analyzes stability of all
	forced alloy phases. Returns the the most highest performing forced alloy
	phase.

	Args:
		i: First element in the system
		j: Second element in the system
	"""
	#| -  - process_alloy
	entries = pd_entries(i.symbol,j.symbol)
#	entries = pure_atoms_remove(entries)
	alloy_entr = alloy_entries(entries)
	if not alloy_entr:
		print 'heat map - no alloy entries'
		non_alloy = process(i,j)
		return non_alloy

	base_atoms = base_atom(entries)
	alloy_performance_lst = []
	for alloy in alloy_entr:
		entries_0 = entries[:]
		comp = alloy.composition \
			.fractional_composition.get_atomic_fraction(base_atoms[0])
		for alloy_0 in alloy_entr:
			if not alloy_0 == alloy: entries_0.remove(alloy_0)

		coord = phase_coord(entries_0,comp)
		filt1 = phase_filter(coord,'metallic')
		filt2 = phase_filter(coord,'metallic_metallic')
		filt = filt1 + filt2
		try:
			alloy_performance_lst.append(most_stable_phase(filt, scale='Pt_ref'))
		except:
			pass