diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..eeb514c --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +.ipynb_checkpoints diff --git a/src/nobook/bootstrap.ipynb b/src/nobook/bootstrap.ipynb index a5baf5b..7487658 100644 --- a/src/nobook/bootstrap.ipynb +++ b/src/nobook/bootstrap.ipynb @@ -5,287 +5,1331 @@ "id": "2edc5efc-167c-4fb8-a2cd-57d9bad95ecc", "metadata": {}, "source": [ - "# bootstrapping interactive notebook content for _computational thermodynamics of materials_\n", - "\n", - "\n", - "1. table of contents\n", - "1. 9 primary sections or h1s\n", - "2. references\n", - "\n", - "each primary section will be exported to a separate package in the source." + "# bootstrapping interactive notebook content for _computational thermodynamics of materials_" ] }, { "cell_type": "code", "execution_count": 1, - "id": "ba3b86d2-4953-4cff-89bb-c2160947c31a", + "id": "c4601326-6456-47e8-99c9-ae8c8f59e32b", "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:44.823272Z", - "iopub.status.busy": "2024-01-07T07:16:44.823177Z", - "iopub.status.idle": "2024-01-07T07:16:45.075102Z", - "shell.execute_reply": "2024-01-07T07:16:45.074774Z", - "shell.execute_reply.started": "2024-01-07T07:16:44.823262Z" - }, "tags": [] }, "outputs": [], "source": [ - " import docx, itertools, pandas, tempfile, shutil, typing, asyncio, subprocess, functools, unittest, operator\n", + " import docx, itertools, pandas, tempfile, shutil, typing, asyncio, subprocess, functools, unittest, operator, re\n", " from IPython.display import Markdown, display; from toolz.curried import *\n", " PANDOC, PANDOC_TO, PANDOC_FROM = shutil.which(\"pandoc\"), \"gfm\", \"docx\"\n", " MAIN, FILE = __name__ == \"__main__\", \"__file__\" in locals()\n", " INTERACTIVE = MAIN and not FILE\n", - " singleton = functools.lru_cache(1)" + " singleton = functools.lru_cache(1)\n", + " from pathlib import Path\n", + " from utils import apply\n", + " HERE = Path(__file__).parent if FILE else Path(subprocess.check_output([\"pwd\"]).decode().strip())\n", + " PSU = HERE.parent / \"psu410\" / \"src\" / \"psu410\"\n", + "\n", + " import nbformat.v4 as v4, anyio, json" ] }, { "cell_type": "markdown", - "id": "9c16ef6c-355b-4a6a-8ca7-94d77d434930", + "id": "54dc9414-fe0f-4a30-b914-77d3609250b6", "metadata": {}, "source": [ - "`get_docx` loads in the original document using `python-docx` data structures." + "## loading the original textbook and data" ] }, { - "cell_type": "code", - "execution_count": 2, - "id": "2f23bf91-3d5d-4bd5-8619-e05ac0df6c53", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.076028Z", - "iopub.status.busy": "2024-01-07T07:16:45.075852Z", - "iopub.status.idle": "2024-01-07T07:16:45.078060Z", - "shell.execute_reply": "2024-01-07T07:16:45.077781Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.076018Z" - }, - "tags": [] - }, - "outputs": [], + "cell_type": "markdown", + "id": "f7c68a07-a7f2-4620-8cfb-77228fcbfd7f", + "metadata": {}, "source": [ - " @singleton\n", - " def get_docx() -> \"docx.document.Document\":\n", - " return __import__(\"docx\").Document(\"2015-07-15-Textbook-Cambridge-U-P.docx\")" + "`get_docx` loads in the original document using `python-docx` data structures." ] }, { "cell_type": "markdown", - "id": "4ea5f5c8-52de-4e9c-8eb9-db264a61a5d0", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-06T04:44:46.234364Z", - "iopub.status.busy": "2024-01-06T04:44:46.234086Z", - "iopub.status.idle": "2024-01-06T04:44:46.238225Z", - "shell.execute_reply": "2024-01-06T04:44:46.237652Z", - "shell.execute_reply.started": "2024-01-06T04:44:46.234339Z" - }, - "tags": [] - }, + "id": "c8cfea5a-26ac-4e53-a9ba-62db108e866d", + "metadata": {}, "source": [ - "the snippet discovers the style id's of each paragraph. this means we could remediate the the headings here and make them formal headings" + "loads the docx into a dataframe and extracts features for organizing the contents into cells." ] }, { "cell_type": "code", - "execution_count": 3, - "id": "bd674c8e-4a31-4544-b6b9-0aa2573385c8", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.078515Z", - "iopub.status.busy": "2024-01-07T07:16:45.078412Z", - "iopub.status.idle": "2024-01-07T07:16:45.090755Z", - "shell.execute_reply": "2024-01-07T07:16:45.090419Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.078505Z" - }, - "tags": [] - }, - "outputs": [], + "execution_count": 2, + "id": "0e4d1725-66d2-49f1-9d3f-d363c3f019d1", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
0123456789...3278327932803281328232833284328532863287
path2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx...2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx2015-07-15-Textbook-Cambridge-U-P.docx
original0123456789...3278327932803281328232833284328532863287
p<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe......<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...<docx.text.paragraph.Paragraph object at 0x7fe...
typeparagraphparagraphparagraphparagraphparagraphparagraphparagraphparagraphparagraphparagraph...paragraphparagraphparagraphparagraphparagraphparagraphparagraphparagraphparagraphparagraph
default11NaNNaNNaNNaNNaNNaNNaNNaN...1111111111
styleIdNormalNormalTOC1TOC2TOC2TOC2TOC2TOC1TOC2TOC2...NormalNormalNormalNormalNormalNormalNormalNormalNormalNormal
customStyleNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
package0000000000...10101010101010101010
hNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
doc0000000000...48484848484848484848
cell_id0000000000...96969696969696969696
\n", + "

11 rows × 3288 columns

\n", + "
" + ], + "text/plain": [ + " 0 \\\n", + "path 2015-07-15-Textbook-Cambridge-U-P.docx \n", + "original 0 \n", + "p \"pandas.Series\":\n", - " \"\"\"expand the docx into a pandas dataframe and extract features for organization\"\"\"\n", - " return (\n", - " paragraphs := pandas.Series(get_docx().iter_inner_content())\n", - " ).to_frame(\"p\").join(\n", - " paragraphs.apply(operator.attrgetter(\"style.style_id\")).rename(\"style_id\")\n", + " def get_docx_features():\n", + " # start with an index of files, this will work for multiple documents but will be ugly\n", + " p = (\n", + " pandas.Index([\"2015-07-15-Textbook-Cambridge-U-P.docx\"], name=\"path\")\n", + " .to_series().apply(docx.Document).methodcaller(\"iter_inner_content\")\n", + " .apply(enumerate).apply(list).explode()\n", + " .apply(list).aseries().rename(columns={0: \"original\", 1: \"p\"})\n", + " .set_index(\"original\", append=True)\n", " )\n", - " " - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "345b47f7-6fbf-40f5-a64f-5646db86dd2b", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.091391Z", - "iopub.status.busy": "2024-01-07T07:16:45.091272Z", - "iopub.status.idle": "2024-01-07T07:16:45.093825Z", - "shell.execute_reply": "2024-01-07T07:16:45.093529Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.091380Z" - }, - "tags": [] - }, - "outputs": [], - "source": [ - " @singleton\n", - " def get_frames() -> tuple[\"pandas.DataFrame\", \"pandas.DataFrame\", \"pandas.DataFrame\"]:\n", - " df = get_paragraphs()\n", - " end_of_toc = df.style_id.str.match(\"^TOC\").pipe(lambda x: x[x]).index[-1] + 1\n", - " return dict(zip(\n", - " (\"toc\", \"sections\"), \n", - " (df.iloc[:end_of_toc], df.iloc[end_of_toc:])\n", - " ))" + " # extract the ALL style information from the style node\n", + " p = p.assign(**p.p.attrgetter(\"style.element.attrib\").apply(dict).aseries())\n", + " # remove the url prefixes on the style namepsaces\n", + " DOCX_PRE = \"{http://schemas.openxmlformats.org/wordprocessingml/2006/main}\"\n", + " p.columns = p.columns.str.removeprefix(DOCX_PRE)\n", + "\n", + " # extract features from the style ids that map paragraphs to packages, documents, cells\n", + " p = p.assign(\n", + " package=p.styleId.eq(\"Heading1\").cumsum().rename(\"package\"),\n", + " h=(h := p.styleId.str.extract(\"^Heading([0-9])\")[0].dropna().astype(int).reindex_like(p)),\n", + " doc=(hs := p.styleId.str.match(\"^Heading[1-2]\")).cumsum(),\n", + " cell_id=(~h.isna()).astype(int).cumsum()\n", + " ).reset_index()\n", + " return p\n", + "\n", + " INTERACTIVE and (p := get_docx_features()).T" ] }, { "cell_type": "markdown", - "id": "af4677c4-f424-4359-a141-cecccda07633", + "id": "2f729b8a-3d24-4aab-861c-f4f84a1f65cb", "metadata": {}, "source": [ - "`get_new_docx` creates a new `docx` data structure using only the specified elements." + "`get_headings` maps the indexes to file names" ] }, { "cell_type": "code", - "execution_count": 5, - "id": "ff516019-bebf-4610-9f16-5dc90d0b8da7", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.094389Z", - "iopub.status.busy": "2024-01-07T07:16:45.094237Z", - "iopub.status.idle": "2024-01-07T07:16:45.096534Z", - "shell.execute_reply": "2024-01-07T07:16:45.096185Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.094378Z" - }, - "tags": [] - }, - "outputs": [], + "execution_count": 3, + "id": "0e4437f7-22d7-4ef7-93f7-30c4f7e54f48", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
psu410\n",
+       "├── applications_to_chemical_reactions\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── internal_process_and_differential_and_integrated_driving_forces.ipynb\n",
+       "│   ├── ellingham_diagram_and_buffered_systems.ipynb\n",
+       "│   ├── trends_of_entropies_of_reactions.ipynb\n",
+       "│   └── maximum_reaction_rate_and_chemical_transport_reactions_.ipynb\n",
+       "├── applications_to_electrochemical_systems\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── electrolyte_reactions_and_electrochemical_reactions.ipynb\n",
+       "│   ├── concentrations_activities_and_reference_states_of_electrolyte_species.ipynb\n",
+       "│   ├── electrochemical_cells_and_half_cell_potentials.ipynb\n",
+       "│   ├── aqueous_solution_and_pourbaix_diagram.ipynb\n",
+       "│   └── application_examples.ipynb\n",
+       "├── calpahd_modeling_of_thermodynamics\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── importance_of_lattice_stability.ipynb\n",
+       "│   ├── modeling_of_pure_elements.ipynb\n",
+       "│   ├── modeling_of_stoichiometric_phases.ipynb\n",
+       "│   ├── modeling_of_random_solution_phases.ipynb\n",
+       "│   └── modeling_of_solution_phases_with_longrange_ordering.ipynb\n",
+       "├── critical_phenomena_thermal_expansion_and_materials_genome\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── mms_model_applied_to_thermal_expansion.ipynb\n",
+       "│   ├── application_to_cerium.ipynb\n",
+       "│   ├── application_to_fept.ipynb\n",
+       "│   └── concept_of_materials_genome.ipynb\n",
+       "├── experimental_data_for_thermodynamic_modeling\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── phase_equilibrium_data_from_experiments.ipynb\n",
+       "│   └── thermodynamic_data_from_experiments.ipynb\n",
+       "├── firstprinciples_calculations_and_theory\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── nickel_as_the_prototype.ipynb\n",
+       "│   ├── firstprinciples_formulation_of_thermodynamics.ipynb\n",
+       "│   ├── quantum_theory_for_the_motion_of_electrons.ipynb\n",
+       "│   ├── lattice_dynamics.ipynb\n",
+       "│   └── firstprinciples_approaches_to_disordered_alloys.ipynb\n",
+       "├── gibbs_energy_function\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── phases_with_fixed_compositions.ipynb\n",
+       "│   ├── phases_with_variable_compositions_random_solutions.ipynb\n",
+       "│   ├── phases_with_variable_compositions_solutions_with_ordering.ipynb\n",
+       "│   ├── polymer_solutions_and_polymer_blends.ipynb\n",
+       "│   └── elastic_magnetic_and_electric_contributions_to_free_energy.ipynb\n",
+       "├── laws_of_thermodynamics\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── first_and_second_laws_of_thermodynamics.ipynb\n",
+       "│   ├── combined_law_of_thermodynamics_and_equilibrium_conditions.ipynb\n",
+       "│   ├── stability_at_equilibrium_and_property_anomaly.ipynb\n",
+       "│   └── gibbsduhem_equation.ipynb\n",
+       "├── phase_equilibria_in_heterogeneous_systems\n",
+       "│   ├── index.ipynb\n",
+       "│   ├── general_condition_of_equilibrium.ipynb\n",
+       "│   ├── gibbs_phase_rule.ipynb\n",
+       "│   ├── potential_phase_diagrams.ipynb\n",
+       "│   └── molar_phase_diagrams.ipynb\n",
+       "└── references\n",
+       "    └── index.ipynb\n",
+       "
\n" + ], + "text/plain": [ + "psu410\n", + "├── applications_to_chemical_reactions\n", + "│ ├── index.ipynb\n", + "│ ├── internal_process_and_differential_and_integrated_driving_forces.ipynb\n", + "│ ├── ellingham_diagram_and_buffered_systems.ipynb\n", + "│ ├── trends_of_entropies_of_reactions.ipynb\n", + "│ └── maximum_reaction_rate_and_chemical_transport_reactions_.ipynb\n", + "├── applications_to_electrochemical_systems\n", + "│ ├── index.ipynb\n", + "│ ├── electrolyte_reactions_and_electrochemical_reactions.ipynb\n", + "│ ├── concentrations_activities_and_reference_states_of_electrolyte_species.ipynb\n", + "│ ├── electrochemical_cells_and_half_cell_potentials.ipynb\n", + "│ ├── aqueous_solution_and_pourbaix_diagram.ipynb\n", + "│ └── application_examples.ipynb\n", + "├── calpahd_modeling_of_thermodynamics\n", + "│ ├── index.ipynb\n", + "│ ├── importance_of_lattice_stability.ipynb\n", + "│ ├── modeling_of_pure_elements.ipynb\n", + "│ ├── modeling_of_stoichiometric_phases.ipynb\n", + "│ ├── modeling_of_random_solution_phases.ipynb\n", + "│ └── modeling_of_solution_phases_with_longrange_ordering.ipynb\n", + "├── critical_phenomena_thermal_expansion_and_materials_genome\n", + "│ ├── index.ipynb\n", + "│ ├── mms_model_applied_to_thermal_expansion.ipynb\n", + "│ ├── application_to_cerium.ipynb\n", + "│ ├── application_to_fept.ipynb\n", + "│ └── concept_of_materials_genome.ipynb\n", + "├── experimental_data_for_thermodynamic_modeling\n", + "│ ├── index.ipynb\n", + "│ ├── phase_equilibrium_data_from_experiments.ipynb\n", + "│ └── thermodynamic_data_from_experiments.ipynb\n", + "├── firstprinciples_calculations_and_theory\n", + "│ ├── index.ipynb\n", + "│ ├── nickel_as_the_prototype.ipynb\n", + "│ ├── firstprinciples_formulation_of_thermodynamics.ipynb\n", + "│ ├── quantum_theory_for_the_motion_of_electrons.ipynb\n", + "│ ├── lattice_dynamics.ipynb\n", + "│ └── firstprinciples_approaches_to_disordered_alloys.ipynb\n", + "├── gibbs_energy_function\n", + "│ ├── index.ipynb\n", + "│ ├── phases_with_fixed_compositions.ipynb\n", + "│ ├── phases_with_variable_compositions_random_solutions.ipynb\n", + "│ ├── phases_with_variable_compositions_solutions_with_ordering.ipynb\n", + "│ ├── polymer_solutions_and_polymer_blends.ipynb\n", + "│ └── elastic_magnetic_and_electric_contributions_to_free_energy.ipynb\n", + "├── laws_of_thermodynamics\n", + "│ ├── index.ipynb\n", + "│ ├── first_and_second_laws_of_thermodynamics.ipynb\n", + "│ ├── combined_law_of_thermodynamics_and_equilibrium_conditions.ipynb\n", + "│ ├── stability_at_equilibrium_and_property_anomaly.ipynb\n", + "│ └── gibbsduhem_equation.ipynb\n", + "├── phase_equilibria_in_heterogeneous_systems\n", + "│ ├── index.ipynb\n", + "│ ├── general_condition_of_equilibrium.ipynb\n", + "│ ├── gibbs_phase_rule.ipynb\n", + "│ ├── potential_phase_diagrams.ipynb\n", + "│ └── molar_phase_diagrams.ipynb\n", + "└── references\n", + " └── index.ipynb\n" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - " def get_new_docx(elements: list[\"docx.Type\"]) -> \"docx.document.Document\":\n", - " (new := docx.Document())._body._element.extend(x._element for x in elements)\n", - " return new" + " def get_headings(p):\n", + " \"\"\"map package, doc, cell indices to file names\"\"\"\n", + " headings = p.dropna(subset=\"h\").set_index([\"package\", \"doc\", \"cell_id\"])\n", + " headings = headings.assign(title=headings.p.attrgetter(\"text\"))\n", + " headings = headings.assign(\n", + " package_slug=headings.title[headings.h.eq(1)].apply(slugify).reindex_like(headings).ffill(),\n", + " document_slug=headings.title[headings.h.le(2)].apply(slugify).reindex_like(headings).ffill(),\n", + " )\n", + " headings.loc[headings[headings.package_slug.eq(headings.document_slug)].index, \"document_slug\"] = \"index\"\n", + " headings = headings.assign(\n", + " target=PSU / headings.package_slug / (\n", + " headings.document_slug.add(\".ipynb\")\n", + " ))\n", + " return headings\n", + "\n", + " def slugify(s): \n", + " \"\"\"convert a string into a slug\"\"\"\n", + " return pipe(s, str.lower, partial(re.sub, \"\\s\", \"_\"), partial(re.sub, \"[^\\.a-z\\_]\", \"\"))\n", + "\n", + " INTERACTIVE and (headings := get_headings(p))\n", + "\n", + " def contents_as_tree(contents):\n", + " \"\"\"`contents_as_tree` shows the prospective file layout of the contents.\"\"\"\n", + " import rich.tree\n", + " tree = rich.tree.Tree(\"psu410\")\n", + " for parent, files in contents.target.drop_duplicates().pipe(\n", + " lambda s: s.groupby(s.apply(operator.attrgetter(\"parent\")))\n", + " ):\n", + " tree.add(t := rich.tree.Tree(parent.name))\n", + " pipe(files, map(compose_left(operator.attrgetter(\"name\"), t.add)), list)\n", + " return tree\n", + "\n", + " INTERACTIVE and (tree := contents_as_tree(headings))" ] }, { "cell_type": "markdown", - "id": "147921f4-7ba8-45da-96af-a55fbe9b6568", + "id": "03ebc8e1-d46e-4c76-bdb3-a5b3416d85d4", "metadata": {}, "source": [ - "`get_docx_markdown` will asynchronously shell out many times to compile markdown from a `docx` data structure." + "`get_documents` creates smaller docx articles from the original bulk and convert them to markdown" ] }, { "cell_type": "code", - "execution_count": 6, - "id": "d4e75784-0945-47e0-9260-4116ca2e0e5d", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.097110Z", - "iopub.status.busy": "2024-01-07T07:16:45.096941Z", - "iopub.status.idle": "2024-01-07T07:16:45.099624Z", - "shell.execute_reply": "2024-01-07T07:16:45.099235Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.097100Z" - }, - "tags": [] - }, - "outputs": [], + "execution_count": 4, + "id": "e7bf89b9-8676-4039-8c31-a94cd07e3337", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
package012...8910
doc012345678...42434445464748
cell_id0123456789...87888990919293949596
docx<docx.document.Document object at 0x7fef24b1cf50><docx.document.Document object at 0x7fef2535f1d0><docx.document.Document object at 0x7fef256fc210><docx.document.Document object at 0x7fef2535f090><docx.document.Document object at 0x7fef248cf710><docx.document.Document object at 0x7fef248e18d0><docx.document.Document object at 0x7fef248e3290><docx.document.Document object at 0x7fef248e3710><docx.document.Document object at 0x7fef248fcc10><docx.document.Document object at 0x7fef24953f10>...<docx.document.Document object at 0x7fef24fef710><docx.document.Document object at 0x7fef2501e610><docx.document.Document object at 0x7fef25097a50><docx.document.Document object at 0x7fef25020590><docx.document.Document object at 0x7fef2509fe50><docx.document.Document object at 0x7fef25023350><docx.document.Document object at 0x7fef2502a250><docx.document.Document object at 0x7fef250af690><docx.document.Document object at 0x7fef25039490><docx.document.Document object at 0x7fef250dff50>
mdComputational Thermodynamics of Materials\\n\\nZ...# Laws of thermodynamics\\n## First and second laws of thermodynamics\\n\\n...## Combined law of thermodynamics and equilibr...## Stability at equilibrium and property anoma...## Gibbs-Duhem equation\\n\\nIn experiments, it ...# Gibbs energy function\\n\\nAs shown in through...## Phases with fixed compositions\\n\\nThe homog...## Phases with variable compositions: Random s...### Random solutions\\n\\nThe ideal Gibbs energy......### Galvanic protection\\n\\nA galvanic reaction...### Fuel cells\\n\\nFuel cells are devices to co...### Ion transport membranes\\n\\nIon transport m...### Electrical batteries\\n\\nBatteries utilize ...# Critical phenomena, thermal expansion, and M...## MMS model applied to thermal expansion\\n\\nA...## Application to cerium\\n\\nCerium (Ce) displa...## Application to Fe<sub>3</sub>Pt\\n\\nInvar wa...## Concept of Materials Genome®\\n\\n“A genome i...# References\\n\\n1\\. M. Hillert, *Phase Equilib...
\n", + "

2 rows × 97 columns

\n", + "
" + ], + "text/plain": [ + "package 0 \\\n", + "doc 0 \n", + "cell_id 0 \n", + "docx \n", + "md Computational Thermodynamics of Materials\\n\\nZ... \n", + "\n", + "package 1 \\\n", + "doc 1 \n", + "cell_id 1 \n", + "docx \n", + "md # Laws of thermodynamics\\n \n", + "\n", + "package \\\n", + "doc 2 \n", + "cell_id 2 \n", + "docx \n", + "md ## First and second laws of thermodynamics\\n\\n... \n", + "\n", + "package \\\n", + "doc 3 \n", + "cell_id 3 \n", + "docx \n", + "md ## Combined law of thermodynamics and equilibr... \n", + "\n", + "package \\\n", + "doc 4 \n", + "cell_id 4 \n", + "docx \n", + "md ## Stability at equilibrium and property anoma... \n", + "\n", + "package \\\n", + "doc 5 \n", + "cell_id 5 \n", + "docx \n", + "md ## Gibbs-Duhem equation\\n\\nIn experiments, it ... \n", + "\n", + "package 2 \\\n", + "doc 6 \n", + "cell_id 6 \n", + "docx \n", + "md # Gibbs energy function\\n\\nAs shown in through... \n", + "\n", + "package \\\n", + "doc 7 \n", + "cell_id 7 \n", + "docx \n", + "md ## Phases with fixed compositions\\n\\nThe homog... \n", + "\n", + "package \\\n", + "doc 8 \n", + "cell_id 8 \n", + "docx \n", + "md ## Phases with variable compositions: Random s... \n", + "\n", + "package ... \\\n", + "doc ... \n", + "cell_id 9 ... \n", + "docx ... \n", + "md ### Random solutions\\n\\nThe ideal Gibbs energy... ... \n", + "\n", + "package 8 \\\n", + "doc 42 \n", + "cell_id 87 \n", + "docx \n", + "md ### Galvanic protection\\n\\nA galvanic reaction... \n", + "\n", + "package \\\n", + "doc \n", + "cell_id 88 \n", + "docx \n", + "md ### Fuel cells\\n\\nFuel cells are devices to co... \n", + "\n", + "package \\\n", + "doc \n", + "cell_id 89 \n", + "docx \n", + "md ### Ion transport membranes\\n\\nIon transport m... \n", + "\n", + "package \\\n", + "doc \n", + "cell_id 90 \n", + "docx \n", + "md ### Electrical batteries\\n\\nBatteries utilize ... \n", + "\n", + "package 9 \\\n", + "doc 43 \n", + "cell_id 91 \n", + "docx \n", + "md # Critical phenomena, thermal expansion, and M... \n", + "\n", + "package \\\n", + "doc 44 \n", + "cell_id 92 \n", + "docx \n", + "md ## MMS model applied to thermal expansion\\n\\nA... \n", + "\n", + "package \\\n", + "doc 45 \n", + "cell_id 93 \n", + "docx \n", + "md ## Application to cerium\\n\\nCerium (Ce) displa... \n", + "\n", + "package \\\n", + "doc 46 \n", + "cell_id 94 \n", + "docx \n", + "md ## Application to Fe3Pt\\n\\nInvar wa... \n", + "\n", + "package \\\n", + "doc 47 \n", + "cell_id 95 \n", + "docx \n", + "md ## Concept of Materials Genome®\\n\\n“A genome i... \n", + "\n", + "package 10 \n", + "doc 48 \n", + "cell_id 96 \n", + "docx \n", + "md # References\\n\\n1\\. M. Hillert, *Phase Equilib... \n", + "\n", + "[2 rows x 97 columns]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ + " async def get_documents(p):\n", + " documents = p.groupby([\"package\", \"doc\", \"cell_id\"]).p.agg(get_new_docx).to_frame(\"docx\")\n", + " # shell out to pandoc to get the markdown form\n", + " documents = documents.assign(md=await documents.docx.apply(get_docx_markdown).gather())\n", + " return documents\n", + "\n", + " def get_new_docx(elements: list[\"docx.Type\"]) -> \"docx.document.Document\":\n", + " \"creates a new `docx` data structure using only the specified elements.\"\n", + " try: return (new := docx.Document())\n", + " finally: new._body._element.extend(x._element for x in elements) \n", + " \n", + "\n", " async def get_docx_markdown(document) -> str:\n", - " tmp = tempfile.NamedTemporaryFile(suffix=\".docx\")\n", - " document.save(tmp.name)\n", - " return subprocess.check_output([PANDOC, \"--to\", PANDOC_TO, \"--from\", PANDOC_FROM, tmp.name]).decode()" + " \"\"\"save docx to disc and return a stringified markdown version. this is async because it shells out everytime\"\"\"\n", + " document.save((tmp := tempfile.NamedTemporaryFile(suffix=\".docx\")).name)\n", + " return subprocess.check_output([PANDOC, \"--to\", PANDOC_TO, \"--from\", PANDOC_FROM, tmp.name]).decode()\n", + "\n", + " INTERACTIVE and (documents := await get_documents(p)).T" ] }, { "cell_type": "markdown", - "id": "f3cb525f-d778-47cd-9141-cb7eab4149d6", + "id": "c6b2f8c8-3a02-4f2b-a6f8-4d943ed819f4", "metadata": {}, "source": [ - "define chapters by the 10 h1s we found and the nearest heading to identify notebooks." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "dfc37237-2240-4585-949d-0dbc13d1e7cc", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.100743Z", - "iopub.status.busy": "2024-01-07T07:16:45.100523Z", - "iopub.status.idle": "2024-01-07T07:16:45.103120Z", - "shell.execute_reply": "2024-01-07T07:16:45.102825Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.100732Z" - }, - "tags": [] - }, - "outputs": [], - "source": [ - " def get_organized_docx(df):\n", - " df = df.join(\n", - " df[df.style_id.str.match(\"^Heading1\")].p.apply(operator.attrgetter(\"text\")).rename(\"chapter\")\n", - " ).join(\n", - " df[df.style_id.str.match(\"^Heading\")].p.apply(operator.attrgetter(\"text\")).rename(\"notebook\")\n", - " ).ffill().fillna(\"empty\").set_index([\"chapter\", \"notebook\"])\n", - " return df.groupby([\"chapter\", \"notebook\"]).p.apply(get_new_docx).rename(\"docx\")" + "`get_notebooks` synthesizes the blocks of markdown into notebook files" ] }, { "cell_type": "code", - "execution_count": 8, - "id": "8f4bc119-c81b-40aa-9205-2f6b2f3bb63e", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.103586Z", - "iopub.status.busy": "2024-01-07T07:16:45.103490Z", - "iopub.status.idle": "2024-01-07T07:16:45.105690Z", - "shell.execute_reply": "2024-01-07T07:16:45.105386Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.103576Z" - }, - "tags": [] - }, - "outputs": [], + "execution_count": 5, + "id": "7ea8fb81-5b2f-44de-b178-93e32f2f2774", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
target/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/ellingham_diagram_and_buffered_systems.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/index.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/internal_process_and_differential_and_integrated_driving_forces.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/maximum_reaction_rate_and_chemical_transport_reactions_.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/trends_of_entropies_of_reactions.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/application_examples.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/aqueous_solution_and_pourbaix_diagram.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/concentrations_activities_and_reference_states_of_electrolyte_species.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/electrochemical_cells_and_half_cell_potentials.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/electrolyte_reactions_and_electrochemical_reactions.ipynb.../home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/first_and_second_laws_of_thermodynamics.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/gibbsduhem_equation.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/index.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/stability_at_equilibrium_and_property_anomaly.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/general_condition_of_equilibrium.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/gibbs_phase_rule.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/index.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/molar_phase_diagrams.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/potential_phase_diagrams.ipynb/home/tbone/Documents/nobook/src/psu410/src/psu410/references/index.ipynb
nb{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata......{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...{'nbformat': 4, 'nbformat_minor': 5, 'metadata...
\n", + "

1 rows × 48 columns

\n", + "
" + ], + "text/plain": [ + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/ellingham_diagram_and_buffered_systems.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/index.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/internal_process_and_differential_and_integrated_driving_forces.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/maximum_reaction_rate_and_chemical_transport_reactions_.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_chemical_reactions/trends_of_entropies_of_reactions.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/application_examples.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/aqueous_solution_and_pourbaix_diagram.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/concentrations_activities_and_reference_states_of_electrolyte_species.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/electrochemical_cells_and_half_cell_potentials.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/applications_to_electrochemical_systems/electrolyte_reactions_and_electrochemical_reactions.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target ... \\\n", + "nb ... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/first_and_second_laws_of_thermodynamics.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/gibbsduhem_equation.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/index.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/laws_of_thermodynamics/stability_at_equilibrium_and_property_anomaly.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/general_condition_of_equilibrium.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/gibbs_phase_rule.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/index.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/molar_phase_diagrams.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/potential_phase_diagrams.ipynb \\\n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "target /home/tbone/Documents/nobook/src/psu410/src/psu410/references/index.ipynb \n", + "nb {'nbformat': 4, 'nbformat_minor': 5, 'metadata... \n", + "\n", + "[1 rows x 48 columns]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - " async def get_organized_markdown():\n", - " toc, sections = get_frames().values()\n", - " docxs = get_organized_docx(sections)\n", - " return pandas.Series(await asyncio.gather(*map(get_docx_markdown, docxs.values)), docxs.index, name=\"markdown\")" + " def get_notebooks(documents, headings):\n", + " notebooks = documents.join(headings.target).groupby([\"target\"]).apply(get_new_notebook).to_frame(\"nb\")\n", + " return notebooks\n", + " \n", + " def get_new_notebook(df):\n", + " \"\"\"create a new notebook format from markdown paragraphs\"\"\"\n", + " return v4.new_notebook(cells=[v4.new_markdown_cell(x.splitlines(True)) for x in df.sort_index().md])\n", + "\n", + " INTERACTIVE and (notebooks := get_notebooks(documents, headings)).T" ] }, { - "cell_type": "code", - "execution_count": 9, - "id": "225460f7-f090-4f8b-9ff5-b8adc1459ffa", - "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.106237Z", - "iopub.status.busy": "2024-01-07T07:16:45.106105Z", - "iopub.status.idle": "2024-01-07T07:16:45.108433Z", - "shell.execute_reply": "2024-01-07T07:16:45.108003Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.106228Z" - }, - "tags": [] - }, - "outputs": [], + "cell_type": "markdown", + "id": "bd45abcb-1a65-4fd5-bfb4-01d27dcb6c75", + "metadata": {}, "source": [ - " def arun(co):\n", - " \"\"\"an async runner that patches nested event loops when working interactively.\"\"\"\n", - " try: return asyncio.get_running_loop().run_until_complete(co)\n", - " except RuntimeError: return __import__(\"nest_asyncio\").apply() or arun(co)" + "## testing" ] }, { "cell_type": "code", - "execution_count": 10, - "id": "ec3b7821-e291-4bbb-b651-82f36a925d43", + "execution_count": 6, + "id": "86f04370-5233-4f0f-b920-06f5af9b92cc", "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:45.109243Z", - "iopub.status.busy": "2024-01-07T07:16:45.109004Z", - "iopub.status.idle": "2024-01-07T07:16:59.926888Z", - "shell.execute_reply": "2024-01-07T07:16:59.926145Z", - "shell.execute_reply.started": "2024-01-07T07:16:45.109229Z" - }, "tags": [] }, "outputs": [ @@ -297,7 +1341,7 @@ "the table of contents, 9 primary chapters, and the references are captured ... ok\n", "\n", "----------------------------------------------------------------------\n", - "Ran 1 test in 14.809s\n", + "Ran 1 test in 14.030s\n", "\n", "OK\n" ] @@ -305,452 +1349,211 @@ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 10, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ " class Tests(unittest.TestCase):\n", + " \n", + " @classmethod\n", + " def arun(cls, co):\n", + " \"\"\"an async runner that patches nested event loops when working interactively.\"\"\"\n", + " try: return asyncio.get_running_loop().run_until_complete(co)\n", + " except RuntimeError: return __import__(\"nest_asyncio\").apply() or cls.arun(co)\n", + " \n", " def setUp(self):\n", - " self.md = arun(get_organized_markdown())\n", - " self.toc, self.sections = get_frames().values()\n", + " self.paragraphs = get_docx_features()\n", + " self.headings = get_headings(self.paragraphs)\n", + " self.documents = self.arun(get_documents(self.paragraphs))\n", + " self.notebooks = get_notebooks(self.documents, self.headings)\n", + " INTERACTIVE and globals().update(self=self)\n", " \n", " def test_number_of_sections(self):\n", " \"\"\"the table of contents, 9 primary chapters, and the references are captured\"\"\"\n", " # all of the main headings are captured as Heading1s\n", - " assert self.sections.style_id.eq(\"Heading1\").sum() == 10\n", - " # the organized has synthetic empty labels that add one more value\n", - " # still need to inspect these rows before remove them.\n", - " assert len(self.md.index.get_level_values(\"chapter\").unique()) == 11\n", + " assert self.paragraphs.styleId.eq(\"Heading1\").sum() == 10\n", + " assert len(self.documents.index.get_level_values(\"package\").unique()) == 11\n", " \n", - " INTERACTIVE and unittest.main(argv=[\"discover\"], verbosity=2, exit=False)" + " INTERACTIVE and (test_results := unittest.main(argv=[\"discover\"], verbosity=2, exit=False))" + ] + }, + { + "cell_type": "markdown", + "id": "43ec7f7b-17c5-48d1-85db-f0348100e5f7", + "metadata": {}, + "source": [ + "### write the notebooks" ] }, { "cell_type": "code", - "execution_count": 11, - "id": "ae617c09-6440-48a7-a015-2c60896fb1a1", + "execution_count": 7, + "id": "bda27d6b-3be8-47d6-bb37-1c19c7e0153d", "metadata": { - "execution": { - "iopub.execute_input": "2024-01-07T07:16:59.927836Z", - "iopub.status.busy": "2024-01-07T07:16:59.927607Z", - "iopub.status.idle": "2024-01-07T07:17:13.375055Z", - "shell.execute_reply": "2024-01-07T07:17:13.374743Z", - "shell.execute_reply.started": "2024-01-07T07:16:59.927813Z" - }, "tags": [] }, "outputs": [ { "data": { - "text/markdown": [ - "## Ellingham diagram and buffered systems\n", - "\n", - "One type of chemical reactions is between a pure element in liquid or\n", - "solid states and its oxides involving one mole of oxygen gas, i.e.\n", - "\n", - "*Eq. 7‑7* $\\frac{4}{v_{M}}M + O_{2}(gas) = M_{4/v_{M}}O_{2}$\n", - "\n", - "with $v_{M}$ being the valence of the element $M$ in the oxide. Taking\n", - "the pure $M$ and the gaseous $O_{2}$ at the reaction temperature and one\n", - "atmospheric pressure as their respective reference states, both\n", - "activities of the pure $M$ solid or liquid phase and its oxide are\n", - "unity, and the activity of $O_{2}$ equals to its partial pressure in an\n", - "ideal gas. becomes\n", - "\n", - "*Eq. 7‑8*\n", - "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S$\n", - "\n", - "Based on , one can plot $\\mathrm{\\Delta}_{\\ }^{0}G$ as a function of\n", - "temperature for various oxidation reactions, which is called Ellingham\n", - "diagram. The intercept at $T = 0K$ is given by\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H$, and the slope is represented by\n", - "$- \\mathrm{\\Delta}_{\\ }^{0}S$, depicted by the following equation\n", - "\n", - "*Eq. 7‑9*\n", - "$\\mathrm{\\Delta}_{\\ }^{0}S = S_{M_{4/v_{M}}O_{2}} - S_{O_{2}} - \\frac{4}{v_{M}}S_{M}$\n", - "\n", - "Since the entropy of one mole of $O_{2}$ gas is significantly larger\n", - "than those of the pure element and its oxide when they are in solid or\n", - "liquid states and the entropy difference between the pure element and\n", - "its oxide, the entropy of reaction is thus dominated by the reduction of\n", - "the entropy by one mole of $O_{2}$ gas. Consequently, the entropies of\n", - "reaction are approximately the same for most reactions when the pure\n", - "elements and their oxides are solid as seen in where most lines have\n", - "similar slopes.\n", - "\n", - "Figure ‑: Ellingham Diagram for a number of metal-oxide systems.\n", - "\n", - "For a chemical reaction on the Ellingham diagram at a given temperature,\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G$ can be read from the y-axis of the diagram,\n", - "and the equilibrium partial pressure of $O_{2}$ gas can be calculated\n", - "using . Alternatively, one can plot the left part of for a given\n", - "$P_{O_{2}}$ as a function of temperature on the Ellingham diagram, i.e.\n", - "\n", - "*Eq. 7‑10* $\\mathrm{\\Delta}_{\\ }^{0}{G =}RTlnP_{O_{2}}$\n", - "\n", - "This results in straight lines, representing iso-partial-pressure lines\n", - "of $O_{2}$, with the intercept being zero at $T = 0K$ and slopes of\n", - "$RlnP_{O_{2}}$, which are negative for $P_{O_{2}}$ lower than one\n", - "atmospheric pressure (1atm). The values of $P_{O_{2}}$ are marked on the\n", - "secondary axis on the right of the Ellingham diagram. The intersection\n", - "of the isoactivitiy line and the equilibrium line of the chemical\n", - "reaction thus gives the relation of equilibrium temperature and\n", - "equilibrium partial pressure of $O_{2}$. This is demonstrated in .\n", - "\n", - "Figure ‑: Intersection of iso-partial-pressure lines of $O_{2}$ and\n", - "equilibrium lines in the Ellingham diagram\n", - "\n", - "For each chemical reaction in the Ellingham diagram, the three phases\n", - "are in equilibrium on the line represented by , i.e. metal, metal\n", - "oxides, and O2 gas. For conditions above the line, the value\n", - "of $P_{O_{2}}$ is larger than its equilibrium value, and the metal will\n", - "be oxidized. For conditions below the line, the value of $P_{O_{2}}$ is\n", - "lower than its equilibrium value, and the metal oxide will be reduced.\n", - "Therefore, the metal oxides in the upper part of the Ellingham diagram\n", - "can be reduced by the metals in the lower part of the diagram, and vice\n", - "versus, metals in the lower part of the diagram can be oxidized by the\n", - "metal oxides in the upper part of the diagram. For example, in , Ca can\n", - "reduce all oxides, and Cu2O is the least stable oxide.\n", - "\n", - "From the above Ellingham diagram, it is noted that equilibrium partial\n", - "pressures of $O_{2}$ are very low for most chemical reactions with many\n", - "of them lower than $10^{- 12}\\ atm$. One approach to obtain such a low\n", - "pressure is to use auxiliary reactions containing $O_{2}$ that are easy\n", - "to control and are independent of the equilibrium system of interest\n", - "except the sharing of the oxygen partial pressure. Two common auxiliary\n", - "reactions are the $H_{2}$/$H_{2}O$ and $CO$/$CO_{2}$ mixtures. For the\n", - "$H_{2}$/$H_{2}O$ mixture, the chemical reaction is\n", - "\n", - "*Eq. 7‑11* $2H_{2}(gas) + O_{2}(gas) = 2H_{2}O(gas)$\n", - "\n", - "The equilibrium oxygen partial pressure is obtained as\n", - "\n", - "*Eq. 7‑12*\n", - "$- RTln\\left\\{ {\\frac{1}{P_{O_{2}}}\\left( \\frac{P_{H_{2}O}}{P_{H_{2}}} \\right)}^{2} \\right\\} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S = - 498488\\ + 112.972T\\ (J)$\n", - "\n", - "where the $\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$\n", - "are taken from the substance thermodynamic database (SSUB4) compiled by\n", - "Scientific Group Thermodata Europe (SGTE) \\[59\\], which are slightly\n", - "dependent on temperature, and the values in are evaluated at 1273K using\n", - "Thermo-Calc \\[60\\]. At any given temperature, one has the following\n", - "relation\n", - "\n", - "*Eq. 7‑13*\n", - "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S - 2RTln\\frac{P_{H_{2}}}{P_{H_{2}O}} = - 498488 + \\left( 112.972 - 2Rln\\frac{P_{H_{2}}}{P_{H_{2}O}} \\right)T$\n", - "\n", - "Its intercept at $T = 0K$ is given by\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H = - 498,488\\ (J)$, and the slope by\n", - "$- \\mathrm{\\Delta}_{\\ }^{0}S - 2Rln\\left( \\frac{P_{H_{2}}}{P_{H_{2}O}} \\right) = 112.972 - 2Rln\\left( \\frac{P_{H_{2}}}{P_{H_{2}O}} \\right)$.\n", - "The values of the $\\frac{P_{H_{2}}}{P_{H_{2}O}}$ ratio are marked on\n", - "another secondary axis on the right of the Ellingham diagram. The\n", - "intersection of the iso-partial-pressure-ratio line and the equilibrium\n", - "line of the chemical reaction gives the relation of equilibrium\n", - "temperature and equilibrium partial pressure ratio\n", - "$\\frac{P_{H_{2}}}{P_{H_{2}O}}$ for desired $P_{O_{2}}$ of the chemical\n", - "equilibrium.\n", - "\n", - "For the $CO$/$CO_{2}$mixture, the chemical reaction is shown below\n", - "\n", - "*Eq. 7‑14* $2CO(gas) + O_{2}(gas) = 2CO_{2}(gas)$\n", - "\n", - "Similar, from the SSUB database, the following equation is obtained\n", - "\n", - "*Eq. 7‑15*\n", - "$- RTln\\left\\{ {\\frac{1}{P_{O_{2}}}\\left( \\frac{P_{{CO}_{2}}}{P_{CO}} \\right)}^{2} \\right\\} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S = - 562,927 - 172.020T\\ (J)$\n", - "\n", - "with $\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$\n", - "calculated at 1273K, which are also slightly temperature-dependent as in\n", - "the case of the $H_{2}$/$H_{2}O$ mixture. The iso-partial-pressure-ratio\n", - "lines are written as\n", - "\n", - "*Eq. 7‑16*\n", - "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S - 2RTln\\frac{P_{CO}}{P_{{CO}_{2}}} = - 562,927 + \\left( 172.020 - 2Rln\\frac{P_{CO}}{P_{{CO}_{2}}} \\right)T\\ $\n", - "\n", - "Its intercept at $T = 0K$ is given by\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H = - 562,927\\ (J)$, and the slope by\n", - "$172.020 - - 2Rln\\left( \\frac{P_{CO}}{P_{{CO}_{2}}} \\right)$. The values\n", - "of the $\\frac{P_{CO}}{P_{{CO}_{2}}}$ ratio are marked on the third\n", - "secondary axis on the right of the Ellingham diagram. The intersection\n", - "of the iso-partial-pressure-ratio line and the equilibrium line of the\n", - "chemical reaction gives the relation of equilibrium temperature and\n", - "equilibrium partial pressure ratio $\\frac{P_{CO}}{P_{{CO}_{2}}}$ for\n", - "desired $P_{O_{2}}$ of the chemical equilibrium.\n", - "\n", - "Therefore, one can use a mixture of the $H_{2}$/$H_{2}O$ or\n", - "$CO$/$CO_{2}$ to obtain the desired low $P_{O_{2}}$ values using and or\n", - "calculating from the SSUB database. For example,\n", - "$P_{O_{2}} = 10^{- 15}\\ atm$ at 1273K, the calculated values from the\n", - "SSUB database are $\\frac{P_{H_{2}}}{P_{H_{2}O}} \\approx 1.67$ and\n", - "$\\frac{P_{CO}}{P_{{CO}_{2}}} \\approx 2.78$, respectively, in which the\n", - "temperature dependences of $\\mathrm{\\Delta}_{\\ }^{0}H$ and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}S$ and the many more gaseous species in the gas\n", - "phase are taken into account. On the other hand, the reading from the\n", - "Ellingham diagram gives $\\frac{P_{H_{2}}}{P_{H_{2}O}} \\approx 2.0$ and\n", - "$\\frac{P_{CO}}{P_{{CO}_{2}}} \\approx 2.4$, and the agreement with the\n", - "more accurate calculations above is remarkable keeping in mind the\n", - "uncertainties in graphically drawing the lines and reading both values\n", - "in the logarithmic scales from the diagram, indicating the robustness of\n", - "the Ellingham diagram.\n" - ], "text/plain": [ - "" + "'[10326, 1193, 6567, 10446, 3959, 22812, 15674, 4257, 16935, 5052, 1649, 7739, 3254, 3906, 3562, 11518, 2040, 14044, 8518, 4168, 1465, 6998, 1668, 15971, 8319, 14994, 12878, 3663, 18091, 19250, 14173, 8221, 11916, 18271, 34412, 26361, 4538, 12929, 7327, 4717, 230, 12381, 7680, 3372, 249, 40796, 31853, 14905]'" ] }, + "execution_count": 7, "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "## Internal process and differential and integrated driving forces\n", - "\n", - "The driving force for an internal process can be defined as following\n", - "using $U$, $H$, $F$, or $G$ as discussed in Chapter and depending on\n", - "what system variables are kept constant\n", - "\n", - "*Eq. 7‑1*\n", - "$- D = \\left( \\frac{\\partial U}{\\partial\\xi} \\right)_{S,\\ V,N_{i}\\ } = \\left( \\frac{\\partial H}{\\partial\\xi} \\right)_{S,\\ P,N_{i}\\ } = \\left( \\frac{\\partial F}{\\partial\\xi} \\right)_{T,\\ V,N_{i}\\ } = \\left( \\frac{\\partial G}{\\partial\\xi} \\right)_{T,P,N_{i}\\ }$\n", - "\n", - "This can be termed as differential driving force as it relates the\n", - "derivative of energy with respect to an internal process so the change\n", - "is infinitesimally small and does not affect the properties of the\n", - "system significantly. For a system under constant $T$ and $P$, let us\n", - "consider an internal process for forming a new phase $\\alpha$ with the\n", - "composition $x_{i}^{\\alpha}$ and Gibbs energy\n", - "$G_{m}^{\\alpha}\\left( x_{i}^{\\alpha} \\right)$. The differential driving\n", - "force for such an internal process can thus be defined as\n", - "\n", - "*Eq. 7‑2*\n", - "$- D = G_{m}^{\\alpha}\\left( x_{i}^{\\alpha} \\right) - \\sum_{i}^{}x_{i}^{\\alpha}\\mu_{i} = \\sum_{i}^{}x_{i}^{\\alpha}\\left( \\mu_{i}^{\\alpha} - \\mu_{i} \\right)$\n", - "\n", - "where $\\mu_{i}$ is the chemical potential of component *i* in the\n", - "system. This may also be called as nucleation driving force as if the\n", - "$\\alpha$ phase is nucleating in the system. As discussed in Chapter ,\n", - "chemical potentials are the intercepts on the Gibbs energy axis by the\n", - "tangent plane of Gibbs energy. thus represents the distance between the\n", - "tangent planes of the original system and the $\\alpha$ phase at the\n", - "composition of the $\\alpha$ phase. Evidently, this distance is at its\n", - "maximum when the two tangent planes are parallel to each other, i.e. the\n", - "commonly called parallel tangent construction when evaluating nucleation\n", - "driving force.\n", - "\n", - "The situation is different for chemical reactions where the amount of\n", - "each component in reactants is the same as that in products, i.e. there\n", - "is a mass balance between reactants and products. The driving force for\n", - "a chemical reaction is defined by the Gibbs energy difference between\n", - "the reactants and products as if all the reactants are transferred to\n", - "the products. This driving force may thus be called integrated driving\n", - "force as it describes the energy difference of a system under two\n", - "different states, i.e.\n", - "\n", - "*Eq. 7‑3*\n", - "$- \\int_{}^{}{Dd\\xi} = \\mathrm{\\Delta}G = \\sum_{p}^{}{n_{p}G_{p}} - \\sum_{r}^{}{n_{r}G_{r}}$\n", - "\n", - "where superscripts $p$ and $r$ denote products and reactants, $n_{p}$\n", - "and $n_{r}$ their corresponding moles, $G_{p}$and $G_{r}$ the Gibbs\n", - "energies in per mole of formula of their respective stoichiometries as\n", - "written in the chemical reaction. Conventionally, the products and\n", - "reactants are represented by species or stoichiometric compounds rather\n", - "than individual phases. This is particularly evident when various\n", - "gaseous species are considered in a chemical reaction. Consequently,\n", - "$G_{p}$and $G_{r}$ in represent the chemical potentials of product and\n", - "reactant species. For species with a fixed composition, its chemical\n", - "potential is the same as its Gibbs energy as shown by . For a species in\n", - "a solution phase, its chemical potential is related to its activity as\n", - "shown in . can thus be further written as\n", - "\n", - "*Eq. 7‑4*\n", - "$\\mathrm{\\Delta}G = \\sum_{p}^{}{n_{p}_{\\ }^{0}G_{p}} - \\sum_{r}^{}{n_{r}_{\\ }^{0}G_{r}} + RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}}$\n", - "\n", - "It is evident from that for stoichiometric phases in a chemical\n", - "reaction, their activities equal to one. At equilibrium, the integrated\n", - "driving force becomes zero, i.e. $\\mathrm{\\Delta}G = 0$, and is\n", - "re-arranged to become\n", - "\n", - "*Eq. 7‑5*\n", - "$- RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} = - RTlnK_{e} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S$\n", - "\n", - "where $K_{e}$ is often called reaction constant relating the activities\n", - "of products and reactants at equilibrium. In a system with\n", - "$\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} > K_{e}$,\n", - "the chemical reaction goes to left, and the products are decomposed,\n", - "while\n", - "$\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} < K_{e}$,\n", - "the chemical reaction goes to right, and the products are formed. is\n", - "often recast into the following form by dividing $–RT$ on both sides of\n", - "the equation\n", - "\n", - "*Eq. 7‑6*\n", - "$\\ln K_{e} = - \\frac{\\mathrm{\\Delta}_{\\ }^{0}H}{RT} + \\frac{\\mathrm{\\Delta}_{\\ }^{0}S}{R}$\n", - "\n", - "With $\\ln K_{e}$ plotted with respect to $1/T$, indicates that the slope\n", - "is $- \\mathrm{\\Delta}_{\\ }^{0}H$/R and the intercept on the y axis is\n", - "$\\mathrm{\\Delta}_{\\ }^{0}{S/R}$ as shown in .\n", - "\n", - "Figure ‑: $\\ln K_{e}$ plotted with respect to $1/T$ for several M-O\n", - "systems at 1 bar and $K_{e}$ represented by the partial pressure ratio\n", - "of CO2 and CO.\n" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, + "output_type": "execute_result" + } + ], + "source": [ + " async def write_json(target, data):\n", + " target = anyio.Path(target)\n", + " await target.parent.mkdir(exist_ok=True, parents=True)\n", + " return await target.write_text(json.dumps(data, indent=2))\n", + " \n", + " async def write_nb(notebooks):\n", + " return await asyncio.gather(*(\n", + " write_json(target, nb) for target, nb in notebooks.nb.items()\n", + " ))\n", + "\n", + " 10 and INTERACTIVE and str(await write_nb(notebooks))" + ] + }, + { + "cell_type": "markdown", + "id": "98838d88-c9bc-4387-9be4-15121804add8", + "metadata": {}, + "source": [ + "### show an interactive sample of the transformed markdown" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "41c2db45-1d82-42a7-9773-8c9dece52bd8", + "metadata": {}, + "outputs": [ { "data": { "text/markdown": [ - "## Maximum reaction rate and chemical transport reactions \n", - "\n", - "Equilibrium thermodynamics can be used to calculate the maximum rates of\n", - "reaction that are possible in dynamically reacting systems, such as when\n", - "a corrosive gas passes over a heated sample. Other examples of such\n", - "reactions include the reduction of a metal oxide in flowing hydrogen,\n", - "the evaporation of a material in a vacuum, and the deposition of a thin\n", - "film by a chemical vapour deposition process. The basic assumption used\n", - "in calculating these maximum reaction rates is that local equilibrium\n", - "exists at the location of the considered reaction.\n", - "\n", - "This section examines several examples in which maximum reaction rates\n", - "are calculated. The system can typically be divided into three regions:\n", - "(1) the input region, which is usually near room temperature, (2) the\n", - "high temperature region in which the primary reaction of interest is\n", - "occurring, and (3) the exit region. Such a system is almost always at\n", - "constant pressure throughout the system. Since the three regions have\n", - "different temperatures, the key is to use the mass conservation of the\n", - "carrier gas in all three regions. With the input gas at $T = 298K$ and\n", - "$P = 1atm$, the volume of one mole of ideal gas is\n", - "$0.0244\\left( m^{3} \\right) = 24.4(liter)$. The number of moles of input\n", - "gas flowing through the system can be written as\n", - "\n", - "*Eq. 7‑17*\n", - "$n_{gas}^{0} = \\frac{Pf_{gas}}{RT} = \\frac{f_{gas}}{24.4} = 0.0409f_{gas}$\n", - "\n", - "where $f_{gas}$ is the input gas flow rate in liter per unit time at\n", - "$T = 298K$ and $P = 1atm$, and $R$ the gas constant.\n", - "\n", - "The first example is the evaporation of water in a flowing stream of dry\n", - "hydrogen. A schematic diagram of the system being considered is given in\n", - ". The goal of the calculation is to determine the maximum rate of\n", - "$H_{2}O(liquid)$ loss, $n_{H_{2}O}^{\\ }$, through vaporization in a\n", - "flowing stream of $H_{2}$, e.g. for generating a given $H_{2}O/H_{2}$\n", - "ratio for producing a given $O_{2}$ pressure in a high temperature\n", - "system as related to the Ellingham diagram discussed in Chapter . The\n", - "maximum rate is determined by saturating the $H_{2}$ with the\n", - "equilibrium vapour pressure of $H_{2}O(liquid)$ with the number of moles\n", - "of $H_{2}$ being $n_{H_{2}}^{0} = 0.0409f_{H_{2}}$ and $f_{H_{2}}$ being\n", - "the input flow rate of $H_{2}$ in liter per unit time.\n", - "\n", - "Figure ‑: Schematic diagram of vaporization of water in a flowing stream\n", - "of dry hydrogen\n", - "\n", - "In the first input region, the total number moles of gas is\n", - "$N = n_{H_{2}}^{0}$. In the second high temperature region with the\n", - "temperature and pressure being $T_{sys}$ and $P_{sys}$, the total number\n", - "moles of gas is $N = n_{H_{2}}^{0} + n_{H_{2}O}^{\\ }$, which is the same\n", - "for the third exit region with $T_{exit}$. To avoid condensation, one\n", - "needs to maintain $T_{exit} > T_{sys}$. The vapour pressure of $H_{2}O$\n", - "at $T_{sys}$, $P_{H_{2}O\\ }$, can be obtained from equilibrium\n", - "thermodynamic calculations. Since the $H_{2}$ and $H_{2}O$ are occupying\n", - "the same volume at the same temperature, the maximum number of moles\n", - "$H_{2}O$ can be calculated from the following relation based on the\n", - "ideal gas law\n", - "\n", - "*Eq. 7‑18*\n", - "$n_{H_{2}O}^{\\ } = \\frac{P_{H_{2}O}^{\\ }}{P_{H_{2}}^{\\ }}n_{H_{2}}^{0} = \\frac{P_{H_{2}O}^{\\ }}{P_{sys}^{\\ } - P_{H_{2}O}^{\\ }}n_{H_{2}}^{0} = \\frac{P_{H_{2}O}^{\\ }}{P_{sys}^{\\ } - P_{H_{2}O}^{\\ }}\\frac{f_{H_{2}}}{24.4}$\n", - "\n", - "For $P_{sys}^{\\ } = 101325Pa$, one can calculate $P_{H_{2}O}^{\\ }$ and\n", - "plot $\\frac{n_{H_{2}O}^{\\ }}{f_{H_{2}}}$ as a function of temperature\n", - "from the SSUB database as shown in . The corresponding partial pressure\n", - "ratio, $P_{H_{2}O}/P_{H_{2}}$ , is plotted in , which can be used to\n", - "calculate $P_{O_{2}}^{\\ }$ at any given temperatures. An example is\n", - "shown in with $T_{sys} = 348.15K$ and $P_{H_{2}O}/P_{H_{2}} = 0.607$.\n", - "\n", - "Figure ‑: Ratio of maximum number of moles $H_{2}O$ with respect to\n", - "hydrogen flow rate, $\\frac{n_{H_{2}O}^{\\ }}{f_{H_{2}}}$, plotted as a\n", - "function of temperature.\n", - "\n", - "Figure ‑: Partial pressure ratio, $P_{H_{2}O}/P_{H_{2}}$, corresponding\n", - "to .\n", - "\n", - "Figure ‑: Partial pressure of oxygen, $P_{O_{2}}^{\\ }$, as a function of\n", - "temperature with $T_{sys} = 348.15K$ and $P_{H_{2}O}/P_{H_{2}} = 0.607$.\n", - "\n", - "The second example is the corrosion of $SiO_{2}$(s) by flowing $H_{2}$\n", - "gas at high temperatures. Considering $T_{sys}^{\\ } = 1700K$,\n", - "$P_{sys}^{\\ } = 101325Pa$, and $f_{H_{2}} = 1\\ liter/min$, the system is\n", - "thus defined with 0.0409 moles of $H_{2}$ and an equilibrium between the\n", - "gas phase and the tridymite $SiO_{2}$. The equilibrium calculation gives\n", - "0.04092 moles of gas with its constitutions as\n", - "$H_{2}:H_{2}O:SiO = 0.998887:4.833 \\bullet 10^{- 4}:4.832 \\bullet 10^{- 4}$.\n", - "The corrosion rate of SiO2(s) is thus\n", - "$0.04092x4.832 \\bullet 10^{- 4} = 1.98 \\bullet 10^{- 5}mol/min = 1.19gram/min.$\n", - "\n", - "Another example is to consider that the flowing $CO$ gas of 298K and\n", - "1atm ($= 101325Pa$) at a rate of $1\\ liter/min$ passes through and\n", - "equilibrates with single phase $C(s)$ at 1500K. The equilibrium system\n", - "is defined by $T = 1500K$, $P = 1atm$, and 0.0409 moles of $CO$ with the\n", - "equilibrium between the gas phase and C(s). The equilibrium calculation\n", - "gives 0.040872 moles of gas phase with the mole fraction of $CO$ being\n", - "0.999327, resulting in the loss of *CO* or the deposition of *C(s)* at a\n", - "rate of\n", - "$0.0409 - 0.040872 \\bullet 0.999327 = 5.55 \\bullet 10^{- 5}mole/min$.\n", - "\n", - "A chemical transport reaction is a reaction in which a condensed phase\n", - "reacts with a gas phase to form vapour-phase products, which in turn\n", - "undergo the reverse reformation of the condensed phase. Two well-known\n", - "examples of such reactions are\n", - "\n", - "*Eq. 7‑19* $M(s) + \\frac{n}{2}I_{2}(g) = MI_{n}(g)$\n", - "\n", - "*Eq. 7‑20* $Ni(s) + 4CO(g) = Ni{(CO)}_{4}(g)$\n", - "\n", - "which are used in the purification of metals by the iodide process and\n", - "in the purification of nickel by the Mond-Langer process. In both\n", - "processes the forward reaction is favoured by lower temperatures and the\n", - "reverse reaction by higher temperatures, resulting in the deposition of\n", - "the metal. The most common technique for causing a chemical transport of\n", - "a condensed substance makes use of the temperature dependence of the\n", - "equilibrium constant. As was discussed previously, the enthalpy of\n", - "reaction, $\\mathrm{\\Delta}_{\\ }^{0}H$, determines the manner in which\n", - "$K_{e}$ changes with temperature (see ). The value of $K_{e}$ increases\n", - "with increasing *T* for $\\mathrm{\\Delta}_{\\ }^{0}H > 0$, $K_{e}$\n", - "decreases with increasing *T* for $\\mathrm{\\Delta}_{\\ }^{0}H < 0$, and\n", - "$K_{e}$ is independent of T for $\\mathrm{\\Delta}_{\\ }^{0}H = 0$. The\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$ values for\n", - "chemical transport reactions may be either positive or negative. For\n", - "reactions by both are positive, and for reactions by both are negative.\n", - "\n", - "In a typical experiment the starting solid is located at the point in a\n", - "temperature gradient that corresponds to the largest $K_{e}$ value for\n", - "the experimental condition. As the gaseous species migrate to other\n", - "locations in the system with temperatures corresponding to lower $K_{e}$\n", - "values, the reverse reaction occurs to satisfy the new equilibrium\n", - "requirements, and the solid phase is deposited. The dependence of\n", - "$K_{e}$ on $\\mathrm{\\Delta}_{\\ }^{0}H$ results in a material transport\n", - "from hot to cold for $\\mathrm{\\Delta}_{\\ }^{0}H > 0$ (the same as for\n", - "vaporization-condensation reactions), from cold to hot for\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H < 0$, and no transport for\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H = 0$.\n", - "\n", - "The success of a particular reaction in causing an appreciable transport\n", - "of a condensed phase depends mainly upon the partial pressure gradients\n", - "or concentration gradients of the gaseous species in the system. A\n", - "reaction whose equilibrium is extreme toward either the reactant side or\n", - "the product side will not give an appreciable transport of material. The\n", - "concentration gradients are too small in such a system. Reactions with\n", - "equilibrium constants near unity at the experimental temperatures\n", - "usually give the largest transport since small changes in $K_{e}$ cause\n", - "large changes in concentrations. The general condition required for\n", - "obtaining a $K_{e}$ value near unity at a reasonable temperature is that\n", - "$\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$ both have\n", - "the same sign, resulting from the equalities of .\n" + "## First and second laws of thermodynamics\n", + "\n", + "A system typically consists of many chemical components. The first law\n", + "of thermodynamics states that the exchanges of heat, work, and\n", + "individual components with its surroundings must obey the law of\n", + "conversation of energy. In the domain of materials science and\n", + "engineering, the energy of interest is at the atomic and molecular\n", + "levels. The energy at the higher and lower levels such as nuclear energy\n", + "and kinetic and potential energies of a rigid body are usually excluded\n", + "from the discussion of thermodynamics of materials.\n", + "\n", + "Let us consider a system receiving an amount of heat, *dQ*, and an\n", + "amount of work, *dW*, and an amount of each independent component *i*,\n", + "*dNi*, from the surroundings. Such a system is called an open\n", + "system in contrast to a closed system when *dNi*=0 for all\n", + "components, i.e. no exchange of mass between the system and the\n", + "surrounding. Other types of systems commonly defined in thermodynamics\n", + "include adiabatic systems without exchange of heat, i.e. *dQ*=0, and\n", + "isolated systems without exchange of any, i.e. *dQ*= *dW*=\n", + "*dNi*=0.\n", + "\n", + "The corresponding change of energy in the system, i.e. the internal\n", + "energy change, *dU*, is formulated in terms of the first law of\n", + "thermodynamics as follows,\n", + "\n", + "Eq. ‑ $dU = dQ + dW + \\sum_{}^{}{H_{i}dN_{i}}$\n", + "\n", + "where $H_{i}$ is the unit energy of component *i* in the surroundings,\n", + "and the summation is for all components in the system, which can be\n", + "controlled independently from the surroundings, i.e. the independent\n", + "components of the system.\n", + "\n", + "It is self-evident that the left-hand side of refers to the change\n", + "inside the system, while its right-hand side is for the contributions\n", + "from the surroundings to the system. In principle, no matter how the\n", + "heat and mass are added, or how the work is done to the system, as far\n", + "as their summation is the same, the change of the internal energy will\n", + "be the same based on the first law of thermodynamics, indicating that\n", + "the system reaches the same state for a closed system. The internal\n", + "energy is thus a state function in a close system as it does not depend\n", + "on how the state is reached.\n", + "\n", + "On the other hand, for the purpose of easy mathematical treatment, a\n", + "reversible process can be considered for a closed system, in which the\n", + "initial state of the system can be restored reversibly without any\n", + "changes left to the surroundings. Therefore, the heat transferred and\n", + "the work done to the system are identical to the heat and work lost by\n", + "the surroundings and vice versa. The classic example of reversible\n", + "processes is the Carnot’s cycle, which is shown in . It consists of four\n", + "reversible processes for a closed system. The four reversible processes\n", + "are compression at constant temperature *T1* (isothermal,),\n", + "compression without heat exchange (adiabatic) ending at *T2*,\n", + "isothermal expansion at *T2*, and adiabatic expansion ending\n", + "at *T1*.\n", + "\n", + "Figure ‑: Schematics of the Carnot’s cycle\n", + "\n", + "The Carnot’s cycle involves a simple type of mechanical work, either\n", + "hydrostatic expansion or compression, with the work that the surrounding\n", + "does to the system represented by\n", + "\n", + "Eq. ‑ $dW = - PdV$\n", + "\n", + "with *P* being the external pressure that the surrounding exerts on the\n", + "system and *V* the volume of the system. It is now necessary to\n", + "differentiate the external and internal variables for further discussion\n", + "with the former representing variables in the surroundings and the\n", + "latter representing variables in the system. For the isothermal\n", + "processes in the Carnot’s cycle, the entropy change of the system, *dS*,\n", + "can be defined as the heat exchange divided by temperature\n", + "\n", + "Eq. ‑ $dS = \\frac{dQ}{T}$\n", + "\n", + "In addition to processes involving heat, work, and mass exchanges\n", + "between the system and the surroundings, there could be internal\n", + "processes taking place inside the system. As the system cannot do work\n", + "to itself, the criterion for whether an internal process can occur\n", + "spontaneously must be related to the heat exchange, which is related to\n", + "the entropy change as shown by .\n", + "\n", + "It is a known fact that heat can spontaneously transfer from a higher\n", + "temperature (*T2*) region to a lower temperature\n", + "(*T1*) region inside a system if the heat conduction is\n", + "allowed, and this process is irreversible because heat cannot be\n", + "conducted from a low temperature region to a high temperature region by\n", + "itself. indicates that for the same amount of heat change, the entropy\n", + "change at *T1* is higher than that at *T2*, and\n", + "the heat conduction thus results in a positive entropy change in the\n", + "system, i.e.\n", + "\n", + "Eq. ‑\n", + "$\\mathrm{\\Delta}S = - \\frac{dQ}{T_{2}} + \\frac{dQ}{T_{1}} = \\frac{dQ}{{T_{2}T}_{1}}\\left( {T_{2} - T}_{1} \\right) > 0$\n", + "\n", + "Consequently, the second law of thermodynamics is obtained, which states\n", + "that for an internal process to take place spontaneously or\n", + "irreversibly, this internal process (*ip*) must have a positive entropy\n", + "production, which can be written in a differential form as follows\n", + "\n", + "Eq. ‑ $d_{ip}S > 0$\n", + "\n", + "From the definition of entropy change shown by , the amount of heat\n", + "produced by this irreversible internal process can be calculated as\n", + "follows\n", + "\n", + "Eq. ‑ $d_{ip}Q = Td_{ip}S$\n", + "\n", + "Let us represent this internal process by *dξ* and define the driving\n", + "force for this internal process by *D*. The work done by this internal\n", + "process is thus *Ddξ*, which is released as heat, i.e.\n", + "\n", + "Eq. ‑ $Dd\\xi = d_{ip}Q = Td_{ip}S$\n", + "\n", + "An irreversible process thus must have a positive driving force in order\n", + "for it to take place spontaneously.\n" ], "text/plain": [ "" @@ -762,76 +1565,221 @@ { "data": { "text/markdown": [ - "## Trends of entropies of reactions\n", + "## Combined law of thermodynamics and equilibrium conditions\n", + "\n", + "For a system with an irreversible internal process taking place, the\n", + "entropy change in the system thus consists of three parts: the heat\n", + "exchange with the surrounding defined by , the entropy production due to\n", + "the internal process represented by , and the entropy of mass exchange\n", + "with the surrounding. The total entropy change of the system can thus be\n", + "written as follows\n", + "\n", + "Eq. ‑ $dS = \\frac{dQ}{T} + d_{ip}S + \\sum_{}^{}{S_{i}dN_{i}}$\n", + "\n", + "where $S_{i}$ is the unit entropy of component *i* in the surroundings,\n", + "often called partial entropy of component *i*, and will be further\n", + "discussed in Chapter\n", + "\n", + "Combining and and re-arranging, one obtains\n", + "\n", + "Eq. ‑ $dQ = TdS - Dd\\xi - \\sum_{}^{}{TS_{i}dN_{i}}$\n", + "\n", + "Inserting and into yields the combined law of thermodynamics from the\n", + "first and second laws of thermodynamics,\n", + "\n", + "Eq. ‑\n", + "$dU = TdS - PdV + \\sum_{}^{}\\left( H_{i} - TS_{i} \\right){dN}_{i} - Dd\\xi$\n", + "\n", + "The internal energy of the system is thus a function of *S*, *V*,\n", + "*Ni* and *ξ* of the system, which are called natural\n", + "variables of the internal energy, i.e. *U*(*S*,*V*,*Ni*,*ξ*).\n", + "The other variables are dependent variables and can be represented by\n", + "partial derivatives of the internal energy with respect to their\n", + "respective natural variables with other natural variables kept constant\n", + "as shown below\n", + "\n", + "Eq. ‑\n", + "$T = \\left( \\frac{\\partial U}{\\partial S} \\right)_{V,\\ N_{i},\\ \\xi}$\n", + "\n", + "Eq. ‑\n", + "$- P = \\left( \\frac{\\partial U}{\\partial V} \\right)_{S,\\ N_{i},\\ \\xi}$\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} = H_{i} - TS_{i} = \\left( \\frac{\\partial U}{\\partial N_{i}} \\right)_{S,\\ V,N_{j \\neq i},\\ \\xi} = U_{i}$\n", + "\n", + "Eq. ‑\n", + "$- D = \\left( \\frac{\\partial U}{\\partial\\xi} \\right)_{S,\\ V,N_{i}\\ }$\n", + "\n", + "In , a new variable, $\\mu_{i}$, is introduced. It is called chemical\n", + "potential and defined as the internal energy change with respect of the\n", + "addition of the component *i* when the entropy, volume and the amount of\n", + "other components of the system are kept constant. It may be worth\n", + "pointing out that for a system at equilibrium, i.e. $d_{ip}S = 0$, and\n", + "with constant entropy, $dS = 0$, if it exchanges mass with the\n", + "surroundings, $dN_{i} \\neq 0$, the system must also exchange heat with\n", + "the surroundings at the same time in order to keep the entropy invariant\n", + "as demonstrated by .\n", + "\n", + "The pairs of the natural variables and their corresponding partial\n", + "derivatives are called conjugate variables, i.e. *S* and *T*, *V* and\n", + "*–P*, *Ni* and $\\mu_{i}$, and *ξ* and *–D*. There are minus\n", + "sign in front of *P* and *D* as the increase of volume and the progress\n", + "of the internal process decrease the internal energy of the system. The\n", + "importance of this conjugate relation will be evident when various forms\n", + "of combined thermodynamic laws and various types of phase diagrams are\n", + "introduced in the book.\n", + "\n", + "The last pair of conjugate variables, *ξ* and *–D*, is worthy of further\n", + "discussion. Based on the second law of thermodynamics, i.e. , no\n", + "internal processes take place spontaneously if there is no entropy\n", + "productions, i.e. D≤0 or *dξ*=0 and *D*\\>0. With D≤0, there is no\n", + "driving for any internal processes, and the system is at a full\n", + "equilibrium state. The last term in drops off, and *ξ* becomes a\n", + "dependent variable of the system and can be calculated from the\n", + "equilibrium conditions. With *dξ*=0 and *D*\\>0, the system is under a\n", + "constrained equilibrium or freezing-in condition when the internal\n", + "process is constrained not to take place, and *ξ* remains to be an\n", + "independent variable of the system.\n", + "\n", + "These two cases represent the two branches of thermodynamics:\n", + "equilibrium, reversible thermodynamics and irreversible thermodynamics.\n", + "It is clear from the above discussions that these two branches are\n", + "identical if the internal energy is not only a function of *S*, *V*, and\n", + "*Ni* , but also any internal process variable *ξ*. This means\n", + "that one should be able to evaluate the internal energy of a system for\n", + "any freezing-in equilibrium conditions in addition to the full\n", + "equilibrium condition. In the rest of the book, the freezing-in\n", + "equilibrium and full equilibrium are not differentiated unless\n", + "specified.\n", + "\n", + "As the mechanical work under hydrostatic pressure is very important in\n", + "experiments, let us define a new quantity called enthalpy as follows\n", + "\n", + "Eq. ‑ $H = U + PV$\n", + "\n", + "Its differential form can be obtained from as\n", + "\n", + "Eq. ‑ $dH = dU + d(PV) = dQ + VdP + \\sum_{}^{}H_{i}{dN}_{i}$\n", + "\n", + "There are two significant consequences of the above equation. First, for\n", + "a close system under constant pressure, i.e. ${dN}_{i} = dP = 0$, one\n", + "has $dH = dQ$. This implies that the enthalpy change in a system is\n", + "equal to the heat exchange between the system and the surrounding of the\n", + "system, which is why enthalpy and heat are often exchangeable in the\n", + "literature. Second, for an adiabatic system under constant pressure,\n", + "i.e. $dQ = dP = 0$, can be re-arranged to the following equation\n", + "\n", + "Eq. ‑\n", + "$H_{i} = \\left( \\frac{\\partial H}{\\partial N_{i}} \\right)_{N_{j \\neq i,\\ \\ dQ = dP = 0}}$\n", + "\n", + "$H_{i}$ is thus the partial enthalpy of component *i* and will be\n", + "further discussed in Chapter . The chemical potential of component *i*\n", + "defined in is thus related to the partial enthalpy and partial entropy\n", + "of the component.\n", + "\n", + "To further define equilibrium conditions of a system, consider a\n", + "homogeneous system in a state of internal equilibrium, i.e. no\n", + "spontaneous internal processes are possible with $Dd\\xi = 0$, and\n", + "becomes\n", + "\n", + "Eq. ‑\n", + "$dU = TdS - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} = \\sum_{}^{}{Y_{i}dX_{i}}$\n", + "\n", + "where *X* represents *S*, *V*, *Ni*, and *Y* their conjugate\n", + "variables *T*, *-P*, $\\mu_{i}$. The state of the system with *c*\n", + "independent components is completely determined by the *c+2* variables,\n", + "i.e. *S*, *V*, and *Ni* with *i* from 1 to *c*.\n", + "\n", + "To simplify the situation, let us limit the discussion to an isolated\n", + "equilibrium system, i.e. $dU = 0$, and conduct a virtual internal\n", + "experiment inside the system by moving an infinitesimal amount of\n", + "$X_{i}$, ${dX}_{i}$, with other $X_{j}$ kept constant, from one region\n", + "of the system to another region of the system as schematically shown in\n", + ".\n", + "\n", + "Figure ‑: Virtual experiment for a system at equilibrium\n", + "\n", + "As the system is homogeneous and at equilibrium,\n", + "$- dX_{i}^{'} = dX_{i}^{\"} = dX_{i}$. The total change of the internal\n", + "energy of this internal process is the combination of the changes in the\n", + "two regions, i.e.\n", + "\n", + "Eq. ‑\n", + "$dU = dU^{'} + dU^{\"} = Y_{i}^{'}dX_{i}^{'} + Y_{i}^{\"}dX_{i}^{\"} = \\left( - Y_{i}^{'} + Y_{i}^{\"} \\right)dX_{i} = 0$\n", "\n", - "The reaction entropy, $\\mathrm{\\Delta}_{\\ }^{0}S$ in , plays an\n", - "important role in determining equilibria of high-temperature reactions.\n", - "The most important single factor that determines the entropy of a\n", - "reaction is the net change in the number of moles of gas as briefly\n", - "mentioned in the discussion of the Ellingham diagram above. The reason\n", - "this is true can be explained as follows.\n", + "Therefore, $Y_{i}^{'} = Y_{i}^{\"}$ for *T*, *-P*, and $\\mu_{i}$,\n", + "indicating that *T*, *-P*, and $\\mu_{i}$ are homogeneous in the system,\n", + "respectively, and are thus named as potentials of the system.\n", + "Furthermore these potentials are independent of the size of the system\n", + "and are often referred to as intensive variables in the literature. On\n", + "the other hand, all *X:s*, i.e. *S*, *V*, and *Ni*, are\n", + "proportional to the size of the system and may be normalized with\n", + "respect to the size of the system, usually in terms of total moles,\n", "\n", - "The entropy of a substance can be thought of as being the sum of four\n", - "parts: (i) translational, (ii) rotational, (iii) vibrational, and (iv)\n", - "electronic. The translational entropy of a gas is the largest entropy\n", - "term under most conditions. To the extent that the other contributions\n", - "cancel between reactants and products, the entropy of reaction is\n", - "determined by the change in the number of moles of gaseous molecules.\n", - "Based on the literature data or calculations from the SSUB database, the\n", - "net change in the number of moles of gas in a reaction results\n", - "approximately in an entropy of reaction of about 175±45 J/K/mole-gas at\n", - "298K for many halides and oxides. The chemical reactions of and\n", - "discussed above both reduce the gas by one mole, and their entropies of\n", - "reaction are -113 and -172 J/K at 1273K, and -89 and -173J/K at 298K,\n", - "respectively, indicating that the chemical reaction of is an exception\n", - "of the empirical rule. For chemical reactions shown in the Ellingham\n", - "diagram, their entropies of reaction follow this empirical rule pretty\n", - "well with some of them shown in calculated from the SGTE database.\n", + "Eq. ‑ $N = \\sum_{}^{}N_{i}$\n", "\n", - "Table ‑: Entropies of reactions with gas at 298.15K, J/K\n", + "They are thus called molar quantities and often referred to as extensive\n", + "variables, and the respective normalized variables are molar entropy,\n", + "molar volume, and mole fractions, defined as follows\n", "\n", - "Reaction: Si+O2 =SiO2 -182\n", + "Eq. ‑ $S_{m} = \\frac{S}{N}$\n", "\n", - "Reaction: Ti+O2=TiO2 -185\n", + "Eq. ‑ $V_{m} = \\frac{V}{N}$\n", "\n", - "Reaction: 2Mg+O2=2MgO -217\n", + "Eq. ‑ $x_{i} = \\frac{N_{i}}{N}$\n", "\n", - "Reaction: 2Ca+O2=2CaO -212\n", + "Consider a small subsystem in this homogeneous system at equilibrium and\n", + "let the subsystem grow in size. The entropy, volume, and mass enclosed\n", + "in the subsystem increase as follows\n", "\n", - "Reaction: 2Mn+O2=2MnO -150\n", + "Eq. ‑ ${dS = S}_{m}dN$\n", "\n", - "Since the entropy of a reaction is primarily determined by the net\n", - "change in the number of moles of gas, the entropies for reactions\n", - "involving only condensed phases must be small. The entropies of fusion\n", - "of monatomic solids are usually in the range 8-15 J/K/mole-atom as shown\n", - "for some elements in . Most metals and many ionic salts have values that\n", - "lie in this range when given in terms of per mole of atom of material.\n", - "There are few exceptions such as silicon and boron shown in the table.\n", - "For solid-state reactions, the average values can be approximated as\n", - "0±8J/K/mole-atom as also shown in the table.\n", + "Eq. ‑ $dV = V_{m}dN$\n", "\n", - "Table ‑: Entropies of reactions of condensed phases at 298.15K, J/K\n", + "Eq. ‑ $dN_{i} = x_{i}dN$\n", "\n", - "Reaction: Si(s)=Si(l) 29.762\n", + "The corresponding change in the internal energy of the subsystem becomes\n", "\n", - "Reaction: Ti(s2)=Ti(l) 7.288\n", + "Eq. ‑\n", + "$dU = TdS - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} = \\left( TS_{m} - PV_{m} + \\sum_{}^{}\\mu_{i}x_{i} \\right)dN = U_{m}dN$\n", "\n", - "Reaction: Mg(s2)=Mg(l) 9.184\n", + "By integration one obtains the integral form of the internal energy as\n", "\n", - "Reaction: Ca(s2)=Ca(l) 7.659\n", + "Eq. ‑\n", + "$U = TS - PV + \\sum_{}^{}\\mu_{i}N_{i} = \\left( TS_{m} - PV_{m} + \\sum_{}^{}\\mu_{i}x_{i} \\right)N = U_{m}N$\n", "\n", - "Reaction: Mn(s2)=Mn(l) 11.443\n", + "Similarly, the molar enthalpy can be defined as follows\n", "\n", - "Reaction: W(s)=W(l) 14.158\n", + "Eq. ‑\n", + "$H = U + PV = U_{m}N + PV_{m}N = \\left( U_{m} + PV_{m} \\right)N = H_{m}N$\n", "\n", - "Reaction: B(s)=B(l) 21.380\n", + "In case a potential is not homogeneous in a system, the system will not\n", + "be in a state of equilibrium. Let us consider the same virtual\n", + "experiment as shown in for an isolated system that is not in\n", + "equilibrium, i.e. by moving an infinitesimal amount of $X_{i}$,\n", + "${dX}_{i}$, with other $X_{j}$ kept constant, from one region of the\n", + "system to another region of the system with the two regions having\n", + "different potentials. The total internal energy change equals to zero as\n", + "the virtual experiment has $dU = 0$. Similarly, each region can be\n", + "considered to be homogeneous by itself, and one has\n", + "$- dX_{i}^{'} = dX_{i}^{\"} = dX_{i}$. The total internal energy change\n", + "in the system is thus the sum of these two regions plus the entropy\n", + "production due to the internal process with $d\\xi = dX_{i}$, i.e.\n", "\n", - "Reaction: 3Fe+C=CFe3 17.060\n", + "Eq. ‑\n", + "$dU = dU^{'} + dU^{\"} + Dd\\xi = Y_{i}^{'}dX_{i}^{'} + Y_{i}^{\"}dX_{i}^{\"} + Dd\\xi = \\left( - Y_{i}^{'} + Y_{i}^{\"} \\right)dX_{i} + Dd\\xi = 0$\n", "\n", - "Reaction: S+Mn=MnS 13.909\n", + "Consequently, one obtains the following\n", "\n", - "Reaction: NiO+Fe2O3=Fe2NiO4\n", - "0.464\n" + "*Eq. 1‑31* $D = Y_{i}^{'} - Y_{i}^{\"}$\n", + "\n", + "The driving force thus represents the difference of the potential at the\n", + "two regions, and the internal process is to eliminate inhomogeneity of\n", + "the potential with the heat transfer from high temperature regions to\n", + "low temperature regions, volume shrink of low pressure regions (high\n", + "$–P$) and volume expansion of high pressure regions (low $–P$), and\n", + "transport of components from high chemical potential regions to low\n", + "chemical potential regions.\n" ], "text/plain": [ "" @@ -843,255 +1791,272 @@ { "data": { "text/markdown": [ - "## Aqueous solution and Pourbaix diagram\n", - "\n", - "The importance of aqueous solutions in all aspects of life is so well\n", - "known and needs not be discussed further. Since many electrochemical\n", - "processes involve electrolyte solutions in an aqueous solvent,\n", - "electrochemical processes including water, hydrogen, and/or oxygen are\n", - "discussed in more details. The hydrogen-oxygen cell can be described for\n", - "both acidic electrolytes and alkaline electrolytes. With acidic\n", - "electrolytes, H+ is in much higher concentrations than\n", - "OH-, and thus half-cell reactions with H+ as an\n", - "ionic transport species are more important than those involving\n", - "OH-. The reverse is true for alkaline electrolytes that\n", - "contain high OH-concentrations. Other than for nearly neutral\n", - "acid-base systems, either H+ or OH- dominates the\n", - "other by several orders of magnitude as can be seen from the value of\n", - "the 298 K dissociation constant for H2O:\n", - "\n", - "*Eq. 8‑35* H2O(l) = H+(aq) + OH-(aq)\n", - "\n", - "with the reaction constant being Ke =\n", - "\\[H+\\]\\[OH-\\] = 10-14 and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G$= -RT *ln* Ke *β*= +79,908 J. By\n", - "convention, one defines pH = - log \\[H+\\] and pOH = - log\n", - "\\[OH-\\], and then pH + pOH = 14.\n", - "\n", - "Under acidic electrolyte conditions of low pH (high \\[H+\\]\n", - "concentrations) the anode reaction in a hydrogen-oxygen cell is:\n", - "\n", - "*Eq. 8‑36* ½ H2(g) = H+(aq) + e-\n", - "\n", - "with ε1o = 0.0 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{1}$= 0 J. The corresponding cathode\n", - "(reduction) reaction is:\n", - "\n", - "*Eq. 8‑37* 2 H+(aq) + ½ O2(g) + 2 e- =\n", - "H2O(l)\n", - "\n", - "with ε2o = 1.229 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{2}$ = -2\\*1.229\\*96,485 J = -237,160 J. The\n", - "net cell reaction for acidic electrolytes is:\n", - "\n", - "*Eq. 8‑38* H2(g) + ½ O2(g) = H2O(l)\n", - "\n", - "with εocell = 1.229 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{cell}$ = -2\\*1.229\\*96,485 J = -237,160 J\n", - "\n", - "Under alkaline electrolyte conditions of high pH (high\n", - "\\[OH-\\] concentrations) the anode reaction in a\n", - "hydrogen-oxygen cell is:\n", - "\n", - "*Eq. 8‑39* 2 OH-(aq) + H2(g) = 2\n", - "H2O(l) + 2 e-\n", - "\n", - "with ε3o = 0.828 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{3}$= -2\\*0.828\\*96,485 J = -159,779 J. The\n", - "corresponding cathode (reduction) reaction is:\n", - "\n", - "*Eq. 8‑40* H2O(l) + ½ O2(g) + 2 e- = 2\n", - "OH-(aq)\n", - "\n", - "with ε4o = 0.401 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{4}$ = -2\\*0.401\\*96,485 J = -77,381 J. The\n", - "net cell reaction for alkaline electrolytes is:\n", - "\n", - "*Eq. 8‑41* H2(g) + ½ O2(g) = H2O(l)\n", - "\n", - "with εocell = 1.229 V and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G_{cell}$ = -2\\*1.229\\*96,485 J = -237,160 J.\n", - "\n", - "Plots of ε versus pH for a given chemical system have been typically\n", - "used to exhibit the stability relationships of ionic species and solid\n", - "phases in aqueous-based electrochemical systems. These graphs are often\n", - "called Pourbaix diagrams after the inventor and are at constant\n", - "temperature and constant pressure diagrams for a constant concentration,\n", - "usually for one metallic element. By convention, the ε in a Pourbaix\n", - "diagram corresponds to the potential for the cathode reduction reactions\n", - "in the electrochemical half-cell with electrons as reactants. Pourbaix\n", - "diagrams can be extended to multi-component materials when thermodynamic\n", - "properties of the components are available in both the materials and the\n", - "aqueous solution.\n", - "\n", - "An example of an ε versus pH diagram is shown in for the\n", - "Ni-H2O system at a 298K, 1 bar, and $c_{{Ni}^{2 +}} = 0.001$\n", - "molality. Three stability regions for Ni species are shown: Ni(s),\n", - "NiO(s), and \\[Ni2+\\]. The two dashed lines on this diagram\n", - "correspond to hydrogen reduction () and oxygen reduction () reactions,\n", - "respectively.\n", - "\n", - "Figure ‑: An ε versus pH, Pourbaix diagram for the Ni-H2O at\n", - "298K, 1 bar, and $c_{{Ni}^{2 +}} = 0.001$ molality.\n", - "\n", - "For the ε and pH conditions within the boundaries of the Ni(s) region,\n", - "no solid phase other than Ni(s) is stable, no ionic species with a\n", - "concentration of 1 molarity is stable, and no gas species with a\n", - "pressure of 1 bar is stable. Similar statements could be made about the\n", - "NiO(s) and \\[Ni2+\\] areas on the diagram. In the\n", - "\\[Ni2+\\] area, introduction of Ni(s) or NiO(s) into the\n", - "system would result in the dissolution of these solid phases since they\n", - "are not stable with respect to the \\[Ni2+\\] aqueous solution.\n", - "The corresponding chemical reactions proceed spontaneously to the right\n", - "as follows until the solid phases are consumed:\n", - "\n", - "*Eq. 8‑42* Ni(s) → Ni2+(1 molarity) + 2 e-\n", - "\n", - "*Eq. 8‑43* NiO(s) + 2 H+(aq) → Ni2+(1 molarity) +\n", - "H2O(l)\n", - "\n", - "No H+(aq) in involved in the first reaction, , so the\n", - "boundary line separating Ni(s) and Ni2+ is independent of pH.\n", - "No oxidation or reduction occurs in the second reaction, , i.e. no\n", - "electrons are reactants or products in the reaction, the boundary line\n", - "separating NiO(s) and Ni2+ is independent of ε.\n", - "\n", - "Note the convention that the ε is the potential for a cathode reduction\n", - "reaction, and boundary lines between two stability regions depict\n", - "conditions under which partial equilibrium occurs for the two species\n", - "for the ε and pH values at any point on these lines. For the boundary\n", - "line separating Ni(s) and Ni2+ in an ideal aqueous solution,\n", - "i.e. the reverse of , the following equation is obtained.\n", - "\n", - "*Eq. 8‑44* ε = εo = -0.268 V\n", - "\n", - "For the NiO(s)-Ni2+ boundary line of an ideal solution, the\n", - "reaction, , is a complete equilibrium, and thus the relationship is\n", - "\n", - "*Eq. 8‑45*\n", - "$0 = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}} = \\mathrm{\\Delta}_{\\ }^{0}G + 2 \\cdot 2.303 \\cdot RT \\cdot pH$\n", - "\n", - "*Eq. 8‑46*\n", - "$pH = - \\frac{\\mathrm{\\Delta}_{\\ }^{0}G}{2 \\cdot 2.303 \\cdot RT}$\n", - "\n", - "where $\\mathrm{\\Delta}_{\\ }^{0}G$ is obtained as follows and can be\n", - "calculated from the SSUB database and the standard potential of Ni,\n", + "## Stability at equilibrium and property anomaly\n", + "\n", + "As shown by , potentials are homogenous for a homogeneous system in a\n", + "state of internal equilibrium. To study the stability of the equilibrium\n", + "state, one considers the entropy production due to a fluctuation of a\n", + "molar quantity as an internal process. Based on the second law of\n", + "thermodynamics, the driving force, as the first derivative of the\n", + "entropy production with respect to the internal process, is zero for\n", + "such a fluctuation at equilibrium, i.e. *D*=0, and the entropy of\n", + "production thus depends on the second derivative. It can be written as\n", + "follows\n", + "\n", + "Eq. ‑\n", + "$Td_{ip}S = \\frac{\\partial_{ip}S}{\\partial\\xi}d\\xi + \\frac{1}{2}{\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}(d\\xi)}^{2} = Dd\\xi - \\frac{1}{2}D_{2}(d\\xi)^{2}$\n", + "\n", + "with $D_{2} = - \\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}$. When\n", + "$\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}} < 0$ or $D_{2} > 0$ along\n", + "with $D = 0$, the fluctuation does not produce positive entropy of\n", + "production and can thus not develop further. The equilibrium state of\n", + "the system is therefore stable against the fluctuation. On the other\n", + "hand, when $\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}} > 0$ or\n", + "$D_{2} < 0$ along with $D = 0$, the fluctuation creates positive entropy\n", + "of production and can continue to grow. The equilibrium state of the\n", + "system is therefore unstable against the fluctuation. In connection with\n", + ", one can realize that for a system at stable equilibrium without heat\n", + "and mass exchanges with the surroundings, its entropy is at its maximum,\n", + "and there are no other internal processes, which could produce any more\n", + "entropy. This is schematically shown in .\n", + "\n", + "Figure ‑: Schematic diagram showing maximum entropy\n", + "\n", + "Using , , and , the combined law of thermodynamics can be written as\n", + "\n", + "*Eq. 1‑33*\n", + "$dU = \\sum_{}^{}{Y_{i}dX_{i}} - Dd\\xi + \\frac{1}{2}D_{2}(d\\xi)^{2}$\n", + "\n", + "Let us carry out the same virtual internal experiment shown in Chapter ,\n", + "i.e. moving an infinitesimal amount of *Xi* in a homogenous\n", + "system with other $X_{j}$ kept constant in an isolated system, i.e.\n", + "$dU = 0$ and $D = 0$. The internal energy change due to this internal\n", + "process is\n", + "\n", + "Eq. ‑\n", + "$dU = \\frac{1}{2}D_{2}\\left\\{ \\left( dX_{i}^{'} \\right)^{2} + \\left( dX_{i}^{\"} \\right)^{2} \\right\\}$\n", + "\n", + "For a homogeneous system in a state of stable equilibrium with\n", + "$\\left( dX_{i}^{'} \\right)^{2} = \\left( dX_{i}^{\"} \\right)^{2} = \\left( dX_{i} \\right)^{2}$,\n", + "this internal process must result in an increase of internal energy,\n", + "$dU > 0$, and thus gives\n", + "\n", + "Eq. ‑\n", + "$D_{2} = 2\\left( \\frac{\\partial^{2}U}{\\partial\\left( X_{i} \\right)^{2}} \\right)_{X_{j}} = 2\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} > 0$\n", + "\n", + "shows that for a system to be stable, any pair of conjugate variables\n", + "must change in the same direction when other independent molar\n", + "quantities are kept constant. For the conjugate variables discussed so\n", + "far, it means that for a stable system, the addition of entropy\n", + "increases temperature with $\\frac{\\partial T}{\\partial S}$\\>0, the\n", + "volume decreases with pressure or increases with the negative of\n", + "pressure with $\\frac{\\partial( - P)}{\\partial V} > 0$, and the chemical\n", + "potential of a component increases with its amount, i.e.\n", + "$\\frac{\\partial\\mu_{i}}{\\partial N_{i}} > 0$, where the derivatives are\n", + "taken with all other molar quantities kept constant. The limit of\n", + "stability is reached when becomes zero, i.e.\n", + "\n", + "Eq. ‑\n", + "$D_{2} = 2\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} = 0$\n", + "\n", + "shows schematically the energy as a function of configurations including\n", + "three states: unstable, stable, and metastable. Both the stable and\n", + "metastable states have positive curvatures due to $D_{2} > 0$, while the\n", + "unstable state has a negative curvature due to $D_{2} < 0$. There is an\n", + "inflection point of $D_{2} = 0$ for a state between a stable or\n", + "metastable state with $D_{2} > 0$ and an unstable state with\n", + "$D_{2} < 0$. These two inflection points, called spinodal, represent the\n", + "limit of stability. The states between the two inflection points are\n", + "unstable, and other states are either stable or metastable. The two\n", + "inflection points can move apart from or close to each other depending\n", + "on the change of external conditions, i.e. the natural variables. One\n", + "extreme situation is when these two inflection points merge into one\n", + "point, and the instability occurs only at this particular point. It is\n", + "evident that all three states, stable, metastable, and unstable, also\n", + "merge into one point. This point is called critical or consolute point,\n", + "beyond which the instability no longer exists.\n", + "\n", + "Figure ‑: Schematic diagram showing the stable and unstable equilibrium\n", + "states\n", + "\n", + "To mathematically define the consolute point, the third derivative needs\n", + "to be added to because both $D$ and $D_{2}$ vanish at this point, i.e.\n", + "\n", + "Eq. ‑\n", + "$Td_{ip}S = \\frac{\\partial_{ip}S}{\\partial\\xi}d\\xi + \\frac{1}{2}{\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}(d\\xi)}^{2} + \\frac{1}{6}{\\frac{\\partial_{ip}^{3}S}{\\partial\\xi^{3}}(d\\xi)}^{3} = Dd\\xi - \\frac{1}{2}D_{2}(d\\xi)^{2} + \\frac{1}{6}{D_{3}(d\\xi)}^{3}$\n", + "\n", + "Eq. ‑\n", + "$dU = \\sum_{}^{}{Y_{i}dX_{i}} - Dd\\xi + \\frac{1}{2}D_{2}(d\\xi)^{2} - \\frac{1}{6}{D_{3}(d\\xi)}^{3}$\n", + "\n", + "At the consolute point, the third derivative also becomes zero, i.e.\n", + "\n", + "Eq. ‑ $D_{3} = \\frac{\\partial_{ip}^{3}S}{\\partial\\xi^{3}}^{3} = 0$\n", + "\n", + "Let us further discuss the properties of the system in relation to the\n", + "critical point. By taking the inverse of the equation of the limit of\n", + "stability, , one obtains\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)_{X_{j}} = + \\ \\infty$\n", + "\n", + "i.e. all $X_{i}$ quantities diverge at the critical point. Therefore,\n", + "when a system approaches the critical point from its stable region, the\n", + "change of a molar quantity with respect to its conjugate potential\n", + "varies dramatically and becomes infinite at the critical point,\n", + "resulting in property anomalies in the system. In the unstable region,\n", + "the system would thus separate into stable subsystems and becomes\n", + "heterogeneous, and $X_{i}$:s change discontinuously between subsystems.\n", + "While in the stable region, the change of a molar quantity with respect\n", + "to its conjugate potential decreases as the system moves away from the\n", + "critical point and remains positive due to the stability criteria\n", + "denoted by .\n", + "\n", + "However, it is not clear how a molar quantity changes with respect to a\n", + "non-conjugate potential at the critical point. From the Maxwell\n", + "relation, one has\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{k \\neq j}} = \\frac{\\partial^{2}U}{\\partial X_{i}\\partial X_{j}} = \\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{k \\neq i}}$\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial X_{j}}{\\partial Y_{i}} \\right)_{X_{k \\neq j}} = \\left( \\frac{\\partial X_{i}}{\\partial Y_{j}} \\right)_{X_{k \\neq i}}$\n", + "\n", + "Since all $X_{i}$:s diverge at the critical point, both derivatives in\n", + "should also go to infinite at the critical point. To investigate their\n", + "signs, let us carry out a virtual experiment similar to the one in\n", + "deriving the stability condition ( and ). In this case, two internal\n", + "processes are needed for moving two molar quantities simultaneously in\n", + "an isolated system, i.e.\n", + "\n", + "*Eq. 1‑43*\n", + "$dU = - D_{\\xi_{1}}d\\xi_{1} - D_{\\xi_{2}}d\\xi_{2} + D_{\\xi_{1}\\xi_{2}}d\\xi_{1}d\\xi_{2} + \\frac{1}{2}D_{2\\xi_{1}}\\left( d\\xi_{1} \\right)^{2} + \\frac{1}{2}D_{2\\xi_{2}}\\left( d\\xi_{2} \\right)^{2}$\n", + "\n", + "Based on the above discussions, in a stable system at equilibrium with\n", + "$D_{\\xi_{1}} = D_{\\xi_{2}} = 0$, $D_{2\\xi_{1}} > 0$ and\n", + "$D_{2\\xi_{2}} > 0$, the sign of $D_{\\xi_{1}\\xi_{2}}$ cannot be\n", + "unambiguously determined in keeping the change of internal energy\n", + "positive, i.e. $dU > 0$. This indicates that the quantities in can be\n", + "either positive or negative in the stable region and become zero at the\n", + "critical point. By the same token, the quantities in can be either\n", + "positive or negative and become positive or negative infinite at the\n", + "critical point.\n", + "\n", + "A profound conclusion from this analysis is that in a stable system even\n", + "though a molar quantity always changes in the same direction as its\n", + "conjugate potential, the same molar quantity may change in the opposite\n", + "direction of a non-conjugate potential, resulting in additional\n", + "anomalies represented by Eq. 1‑40. One example of is the thermal\n", + "expansion in a closed system, i.e. $dN_{i} = 0$, as follows\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial V}{\\partial T} \\right)_{S} = \\left( \\frac{\\partial S}{\\partial( - P)} \\right)_{V}$\n", + "\n", + "The left-hand side of can be understood as follows: with the increase of\n", + "temperature, the system regulates its pressure in order to keep the\n", + "entropy from increasing, which results in the volume change of the\n", + "system. The behavior of the system depends on whether the pressure\n", + "decreases or increases in order to maintain the entropy of the system\n", + "constant. If the pressure decreases to maintain the entropy of the\n", + "system constant, the volume would increase with the increase of\n", + "temperature, i.e. the left-hand side of the equation has a positive\n", + "sign, which is also shown by the right-hand side of the equation as the\n", + "changes of $S$ and $–P$ have the same sign. That the volume increases\n", + "with temperature is the normal scenario. On the other hand, if the\n", + "pressure increases to maintain the entropy of the system constant, the\n", + "volume would decrease with the increase of temperature, resulting in a\n", + "negative sign for the left-hand side of the equation. This decrease of\n", + "volume with the increase of temperature is usually considered to be\n", + "anomalous, originated from the increase of entropy by the decrease of\n", + "$–P$ or the increase of pressure. More discussions on entropy will\n", + "follow in Chapter 5.2.5 and Chapter 9.\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "## Gibbs-Duhem equation\n", "\n", - "*Eq. 8‑47*\n", + "In experiments, it is difficult to control *S* and *V* of a system in\n", + "comparison with their conjugate variables *T* and *-P*. It is thus\n", + "desirable to construct new functions to represent the system with *T*\n", + "and *-P* as natural variables of the functions. One of them is enthalpy\n", + "defined in , and other two can be defined as follows\n", "\n", - "At a specified temperature, only one standard free energy and only one\n", - "equilibrium constant exists for this chemical reaction, and thus only\n", - "one specific value of $pH = 6.631$ exists for the reaction represented\n", - "by in this Pourbaix diagram.\n", + "Eq. ‑ $F = U - TS$\n", "\n", - "The diagonal line in represents the equilibrium between Ni(s) and NiO(s)\n", - "and is for a partial equilibrium reaction that is the sum of reactions\n", - "of and\n", + "Eq. ‑ $G = U - TS + PV = \\sum_{}^{}\\mu_{i}N_{i} = H - TS = F + PV$\n", "\n", - "*Eq. 8‑48* NiO(s) + 2 H+(aq) + 2 e- ═ Ni(s) +\n", - "H2O(l)\n", - "\n", - "The reduction of Ni from a divalent state in NiO to metallic Ni(s)\n", - "occurs, but the reaction also depends on the H+\n", - "concentration, the pH. The corresponding Gibbs energy and Nernst\n", - "equations are,\n", - "\n", - "*Eq. 8‑49*\n", - "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}} = - 23,939 + 2 \\cdot 2.303 \\cdot RT \\cdot pH$\n", - "\n", - "*Eq. 8‑50*\n", - "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{2f}\\ln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}}\\ = 0.124\\ –\\ \\frac{2.303 \\cdot RT}{f}pH$\n", - "\n", - "where $\\mathrm{\\Delta}_{\\ }^{0}G$ can be calculated as follows\n", - "\n", - "*Eq. 8‑51*\n", - "\n", - "The two additional lines in correspond to the reduction reactions\n", - "related to H2 and O2 gases, i.e. the stability of\n", - "H2O. The lower one is for the reverse of under εo\n", - "= 0 and $P_{H_{2}} = 1$ with the Nernst equation being\n", - "\n", - "*Eq. 8‑52*\n", - "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{f}\\ln\\frac{\\left( P_{H_{2}} \\right)^{1/2}}{c_{H^{+}}}\\ = - \\frac{2.303 \\cdot RT}{f}pH$\n", - "\n", - "As the pH increases from 0, ε becomes more negative as is depicted. The\n", - "top dashed line corresponds to the oxygen reduction reaction represented\n", - "by under εo = 1.225 calculated from the aqueous solution\n", - "database in Thermo-Calc \\[60\\] and $P_{O_{2}} = 1$ with the Nernst\n", - "equation being\n", - "\n", - "Eq. 8‑53\n", - "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{2f}\\ln\\frac{\\left( P_{O_{2}} \\right)^{1/2}}{\\left( c_{H^{+}} \\right)^{2}}\\ = 1.225\\ –\\ \\frac{2.303 \\cdot RT}{f}pH$\n", + "with *F* and *G* called Helmholtz energy and Gibbs energy, respectively.\n", + "The middle part of is obtained using $U$ from . The corresponding\n", + "combined law of thermodynamics in terms of *H*, *F*, and *G* can be\n", + "obtained through the Legendre transformation of as\n", "\n", - "The dependence of ε on pH is identical for both reduction reaction and ,\n", - "and their intercepts at $pH = 0$ differ by their difference in their\n", - "εo values.\n", + "Eq. ‑ $dH = TdS - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", "\n", - "In this simple Pourbaix diagram of Ni in an ideal aqueous solution, all\n", - "boundary lines are straight because there is only one ionic species of\n", - "Ni in the aqueous solution, i.e. Ni2+. When there are more\n", - "than one ionic species in the aqueous solution, the boundary lines may\n", - "no longer be straight due to the competition between species. One\n", - "example is Cu with two main ionic species of Cu+2 and\n", - "CuOH+, and the reduction reaction between the metallic Cu and\n", - "the aqueous solution involves both two species, i.e.\n", + "Eq. ‑ $dF = - SdT - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", "\n", - "*Eq. 8‑54*\n", - "${xCu}^{2 + \\ }\\ + \\ (1 - x){CuOH}^{+} + (1 - x)H^{+} + 2\\ e - \\ \\ = \\ \\ Cu(s) + {(1 - x)H}_{2}O$\n", + "Eq. ‑ $dG = - SdT - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", "\n", - "with\n", + "The independent variables in each of the above form are regarded as the\n", + "natural variables to the corresponding function. The integral forms of\n", + "all the functions can thus be written as the following with their\n", + "natural variables listed in the parenthesis\n", "\n", - "*Eq. 8‑55*\n", - "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}}c_{H^{+}} \\right)^{1 - x}} = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}} \\right)^{1 - x}} + 2.303(1 - x) \\cdot RT \\cdot pH$\n", + "Eq. ‑ $U = U\\left( S,V,N_{i},\\xi \\right)$\n", "\n", - "*Eq. 8‑56*\n", - "$\\varepsilon = \\varepsilon^{0} - \\frac{RT}{2f}\\ln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}} \\right)^{1 - x}} - \\frac{2.303(1 - x) \\cdot RT}{2f}pH$.\n", + "Eq. ‑ $H = H\\left( S, - P,N_{i},\\xi \\right)$\n", "\n", - "It is evident that both the slope and the intercept at $pH = 0$ are a\n", - "function of the concentration of ${CuOH}^{+}$, which is a function of\n", - "$pH$. Consequently, the boundary between the metallic Cu and the aqueous\n", - "solution is no longer a straight line as shown in .\n", + "Eq. ‑ $F = F\\left( T,V,N_{i},\\xi \\right)$\n", "\n", - "Figure ‑: An ε versus pH, Pourbaix diagram for the Cu-H2O\n", - "system at 298K, 1 bar, and $c_{Cu} = 0.001$ molality.\n", + "Eq. ‑ $G = G\\left( T, - P,N_{i},\\xi \\right)$\n", "\n", - "The concentrations of various species in the aqueous solution, i.e.\n", - "commonly called speciation, are plotted in , showing the change of\n", - "dominant species as a function of pH value.\n", + "By differentiating , one obtains\n", "\n", - "Figure ‑: Concentrations of ionic species in the aqueous solution at\n", - "$\\varepsilon = 0.3\\ V$ from .\n", + "Eq. ‑\n", + "$dG = \\sum_{}^{}\\mu_{i}{dN}_{i} + \\sum_{}^{}{N_{i}d\\mu}_{i} = - SdT - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", "\n", - "In Pourbaix diagrams for alloys with two or more elements, activities of\n", - "individual elements are to be used in calculating the potentials of\n", - "reduction reactions. Considering a Fe-Ni alloy with Fe2+ and\n", - "Ni2+ in the aqueous solution, the reduction reactions for Fe\n", - "and Ni can be written separately as\n", + "For a system at equilibrium, $Dd\\xi = 0$, re-arranging gives the\n", + "Gibbs-Duhem equation\n", "\n", - "*Eq. 8‑57* Ni2+(cNi) + 2 e- → Ni\n", - "(aNi in alloy)\n", + "Eq. ‑ $0 = - SdT - Vd( - P) - \\sum_{}^{}{N_{i}d\\mu}_{i}$\n", "\n", - "*Eq. 8‑58* Fe2+(cFe) + 2 e- → Fe\n", - "(aFe in alloy)\n", + "This equation indicates that for a homogeneous system with *c*\n", + "independent components at equilibrium, there is a direct relation among\n", + "all the *c+2* potentials, and they are $c$ chemical potentials\n", + "($\\mu_{i}$), temperature, and pressure. Consequently, only *c+1*\n", + "potentials can change independently, and the remaining potential is\n", + "dependent on the other potentials. As discussed in connection with ,\n", + "there are $c + 2$ independent variables for an equilibrium system with\n", + "*c* independent components, where all of them are molar quantities.\n", "\n", - "with their potentials as\n", + "With the relationships between potentials and molar quantities defined\n", + "by to , one can switch between potentials and molar quantities as\n", + "natural variables of the system. For example, one can define a new free\n", + "energy function when the chemical potential of one component is\n", + "controlled from the surroundings instead of its content and obtain the\n", + "following combined first and second law of thermodynamics\n", "\n", - "*Eq. 8‑59*\n", - "$\\varepsilon_{Ni}\\ = \\ \\varepsilon_{Ni}^{0} - \\frac{2.303RT}{2f}\\ln\\frac{a_{Ni}}{c_{Ni}} = \\ - 0.268 - \\frac{2.303RT}{2f}\\ln\\frac{a_{Ni}}{c_{Ni}}$\n", + "Eq. ‑ $\\Phi = G - \\mu_{1}N_{1} = \\sum_{i = 2}^{c}{\\mu_{i}N_{i}}$\n", "\n", - "*Eq. 8‑60*\n", - "$\\varepsilon_{Fe}\\ = \\ \\varepsilon_{Fe}^{0} - \\frac{2.303RT}{2f}\\ln\\frac{a_{Fe}}{c_{Fe}} = \\ - 0.441 - \\frac{2.303RT}{2f}\\ln\\frac{a_{Fe}}{c_{Fe}}$\n", + "Eq. ‑\n", + "$d\\Phi = - SdT - Vd( - P) - N_{1}{d\\mu}_{1} + \\sum_{i = 2}^{c}{\\mu_{i}{dN}_{i}} - Dd\\xi$\n", "\n", - "In principle, there are two scenarios for a given set of $a_{Ni}$ and\n", - "$a_{Fe}$ of the alloy. The first scenario is at the limit of a dilute\n", - "aqueous solution, i.e. $c_{Ni} = c_{Fe} = 0.001\\ $molarity,\n", - "$\\varepsilon_{Ni}$ and $\\varepsilon_{Fe}$ can be calculated, and the\n", - "element with the lower potential has the tendency to dissolve first,\n", - "which can result in the so-called dialloying effect. The second scenario\n", - "is for the equal potential, i.e. $\\varepsilon_{Ni} = \\varepsilon_{Fe}$\n", - "due to the externally imposed potential, and the equilibrium\n", - "concentrations of Fe+2 and Ni+2 can be calculated\n", - "from and .\n" + "However, even though the $c + 2$ molar quantities are independent of\n", + "each other, indicates that not all the $c + 2$ potentials are\n", + "independent, i.e., if chemical potentials of all components are changed\n", + "to natural variables, one would obtain . Therefore, among the *c+2*\n", + "independent variables used to define the system, the maximum number of\n", + "independent potential is *c+1*, and at least one of the *c+2*\n", + "independent variables must be a molar quantity. This variable is usually\n", + "chosen to be the size of the system or the major element in the system.\n", + "The Gibbs-Duhem equation is used to derive Gibbs phase rule in\n", + "heterogeneous systems, which is discussed in Chapter of the book.\n" ], "text/plain": [ "" @@ -1103,71 +2068,169 @@ { "data": { "text/markdown": [ - "## Concentrations, activities, and reference states of electrolyte species\n", - "\n", - "Thermodynamic descriptions of ionic species in solutions are different\n", - "from those of neutral species, which leads to a need for defining\n", - "concentration units, standard states, activities, and activity\n", - "coefficients of ionic solutions. In most studies of electrochemical\n", - "corrosion and electrodeposition, and in applied work of electrochemical\n", - "engineers, ionic species concentrations are given in units of molarity,\n", - "the number of moles of a species in a liter of solution (mol/l)\n", - "symbolically represented in equations by either *ci* or\n", - "\\[M+Z\\]. The other common concentration used for ionic\n", - "species is molality, which is defined as the number of moles of a\n", - "species in 1000g of solvent. For dilute aqueous solutions, molarity and\n", - "molality values are very similar.\n", - "\n", - "As discussed in Chapter , a practical definition of the activity of a\n", - "species *i* is the thermodynamic reactivity, or tendency to react, of\n", - "species *i* in the system of interest as compared to *i* in its\n", - "reference state form. The reference state of a species is typically\n", - "chosen as a specific chemical/physical state of the species at 1 atm\n", - "external pressure and the temperature of interest. Similarly, a typical\n", - "reference state for ionic species in aqueous solutions is the 1 molar\n", - "ideal solution at 1 bar external pressure and the temperature of\n", - "interest. If an electrolyte solution behaves ideally, then the activity\n", - "of species *i* in solution is\n", - "\n", - "*Eq. 8‑6*\n", - "$a_{i} = \\frac{c_{i}\\left( \\frac{mol}{l} \\right)}{c_{i}^{0}\\left( \\frac{mol}{l} \\right)} = \\frac{c_{i}\\left( \\frac{mol}{l} \\right)}{1\\left( \\frac{mol}{l} \\right)} = c_{i}(dimensionless)$\n", - "\n", - "where $c_{i}$ is the molar concentration of *i* in the solution divided\n", - "by $c_{i}^{0}$, the 1 molar reference state ideal solution\n", - "concentration. Thus, in ideal solutions, the activity of an electrolyte\n", - "species is numerically equal to its molar concentration. The above\n", - "treatment of ionic species is equivalent to the common practice of\n", - "depicting the activity of a gas by the value of its ideal gas partial\n", - "pressure in units of bar.\n", - "\n", - "The activity coefficient corrects for the nonideality of the species in\n", - "solution as defined in . If the solution is ideal, $\\gamma_{i} = 1$ for\n", - "all concentrations of a species in solution. For all solutions, one\n", - "expects $\\gamma_{i} \\rightarrow 1$ as $c_{i} \\rightarrow 1$. It is not\n", - "possible to measure $\\gamma_{i^{+}}$ or $\\gamma_{i^{-}}$ for individual\n", - "charged ions, only a geometric mean of the positive and negative ion\n", - "values. Consider the following ionic solution\n", - "\n", - "Eq. 8‑7\n", - "\n", - "Its chemical potential can be written as\n", - "\n", - "*Eq. 8‑8*\n", - "\n", - "Its geometric average or mean activity and activity coefficient are\n", - "defined as\n", + "# Gibbs energy function\n", "\n", - "*Eq. 8‑9*\n", + "As shown in through , all functions have $N_{i}$ and $\\xi$ as natural\n", + "variables while they differ in other two natural variables. In typical\n", + "materials-related experiments, temperature and pressure are the two\n", + "variables controlled. They are also the natural variables of Gibbs\n", + "energy. Consequently, Gibbs energy is the most widely used function in\n", + "thermodynamics of materials science. The rest of this book focuses on\n", + "Gibbs energy for this reason. In this chapter, the mathematical formulas\n", + "for Gibbs energy of phases with fixed and variable compositions are\n", + "discussed which are needed for quantitative calculations of Gibbs energy\n", + "under given values of its natural variables.\n", "\n", - "*Eq. 8‑10*\n", + "From , the molar Gibbs energy can be defined as\n", "\n", - "For example, one can define\n", - "$\\gamma_{\\pm} = \\left( \\gamma_{{Na}^{+}}\\gamma_{{Cl}^{-}} \\right)^{1/2}$\n", - "and\n", - "$\\gamma_{\\pm} = \\left( \\gamma_{{Al}^{3 +}}^{2}\\gamma_{{{SO}_{4}}^{2 -}}^{3} \\right)^{1/5}$\n", - "for NaCl and Al2(SO4)3, respectively.\n", - "For idea, weak electrolytes, $\\gamma_{\\pm} = 1$, and for non-ideal,\n", - "strong electrolytes, $\\gamma_{\\pm} \\neq 1$.\n" + "Eq. ‑\n", + "$G_{m}\\left( T,P,x_{i},\\xi \\right) = \\frac{G}{N} = \\sum_{}^{}\\mu_{i}x_{i}$\n", + "\n", + "The molar entropy, molar volume, chemical potential, and the driving\n", + "force can be obtained from as\n", + "\n", + "Eq. ‑\n", + "$S_{m} = \\frac{S}{N} = - \\frac{1}{N}\\left( \\frac{\\partial G}{\\partial T} \\right)_{P,\\ N_{i},\\ \\xi} = {- \\left( \\frac{\\partial G_{m}}{\\partial T} \\right)}_{P,\\ x_{i},\\ \\xi}$\n", + "\n", + "Eq. ‑\n", + "$V_{m} = \\frac{V}{N} = \\frac{1}{N}\\left( \\frac{\\partial G}{\\partial P} \\right)_{T,\\ N_{i},\\ \\xi} = \\left( \\frac{\\partial G_{m}}{\\partial P} \\right)_{T,\\ x_{i},\\ \\xi}$\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} = \\left( \\frac{\\partial G}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},\\ \\xi}$\n", + "\n", + "Eq. ‑\n", + "$- D = \\left( \\frac{\\partial G}{\\partial\\xi} \\right)_{T,P,N_{i}\\ }$\n", + "\n", + "Based on , the molar enthalpy is written as\n", + "\n", + "Eq. ‑ $H_{m} = G_{m} + TS_{m}$\n", + "\n", + "Other physical properties of the system can also be represented by the\n", + "partial derivatives of Gibbs energy such as heat capacity, $C_{P}$,\n", + "volume thermal expansivity, $\\alpha_{V}$, isothermal compressibility,\n", + "$\\kappa_{T}$, as follows under constant pressure or temperature\n", + "\n", + "Eq. ‑\n", + "$C_{P} = \\left( \\frac{\\partial Q}{\\partial T} \\right)_{P} = \\left( \\frac{\\partial H}{\\partial T} \\right)_{P} = T\\left( \\frac{\\partial(G + TS)}{\\partial T} \\right)_{P} = T\\left( \\frac{\\partial S}{\\partial T} \\right)_{P} = - T\\left( \\frac{\\partial^{2}G}{\\partial T^{2}} \\right)_{P}$\n", + "\n", + "Eq. ‑\n", + "$\\alpha_{V} = \\frac{\\left( \\frac{\\partial V}{\\partial T} \\right)_{P}}{V} = \\frac{\\left( \\frac{\\left( \\partial G/\\partial( - P) \\right)_{T}}{\\partial T} \\right)_{P}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{\\frac{\\partial^{2}G}{\\partial T\\partial( - P)}}{\\left( \\partial G/\\partial( - P) \\right)_{T}}$\n", + "\n", + "Eq. ‑\n", + "$\\kappa_{T} = \\frac{\\left( \\frac{\\partial V}{\\partial( - P)} \\right)_{T}}{V} = \\frac{\\left( \\frac{\\left( \\partial G/\\partial( - P) \\right)_{T}}{\\partial( - P)} \\right)_{T}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{1}{B}$\n", + "\n", + "where the $N_{i}$ and $\\xi$ are kept constant for all partial\n", + "derivatives, and $B$ is the bulk modulus.\n", + "\n", + "In , $G$ cannot be directly replaced by $G_{m}$ because *N* also depends\n", + "on *Ni*. The thermodynamic quantities under such conditions,\n", + "i.e. varying the amount of a component at constant temperature and\n", + "pressure, are called partial quantities which are introduced in Eq. 1‑8\n", + "for partial entropy and for partial enthalpy. This definition can be\n", + "extended to all molar quantities such as partial volume and partial\n", + "Gibbs energy. Partial quantities of a molar quantity, $A$, can thus be\n", + "defined in general as\n", + "\n", + "Eq. ‑\n", + "$A_{i} = \\left( \\frac{\\partial A}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},\\ \\xi}$\n", + "\n", + "The general differential form of a molar quantity for a system at\n", + "equilibrium can be represented by its partial quantities as\n", + "\n", + "Eq. ‑\n", + "$dA = \\left( \\frac{\\partial A}{\\partial T} \\right)dT + \\left( \\frac{\\partial A}{\\partial P} \\right)dP + \\sum_{}^{}\\left( \\frac{\\partial A}{\\partial N_{i}} \\right){dN}_{i}$\n", + "\n", + "where the subscripts representing variables kept constant, i.e. the\n", + "remaining natural variables of Gibbs energy not in the denominator, are\n", + "omitted for simplicity. This will be done throughout the book unless\n", + "specified otherwise.\n", + "\n", + "Using the following relations: $A = NA_{m}$, $N = \\sum_{}^{}N_{j}$,\n", + "$x_{i} = N_{i}/N$,\n", + "$\\frac{{\\partial x}_{i}}{{\\partial N}_{i}} = \\left( 1 - x_{i} \\right)/N$,\n", + "and $\\frac{{\\partial x}_{k}}{{\\partial N}_{i}} = {- x}_{k}/N$, can be\n", + "derived as, under constant T and P,\n", + "\n", + "Eq. ‑\n", + "$A_{i} = A_{m} + N\\sum_{j = 1}^{c}{\\frac{\\partial A_{m}}{\\partial x_{j}}\\frac{\\partial x_{j}}{\\partial N_{i}}} = A_{m} + \\frac{\\partial A_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial A_{m}}{\\partial x_{j}}$\n", + "\n", + "where the summation is for all *c* components and the partial\n", + "derivatives are taken with other mole fractions kept constant. However,\n", + "mole fractions are not independent, but follow the relation\n", + "$\\sum_{}^{}x_{i} = 1$. Taking $x_{1} = 1 - \\sum_{j = 2}^{c}x_{j}$ as the\n", + "dependent mole fraction, can be rewritten as\n", + "\n", + "Eq. ‑\n", + "$A_{i} = A_{m} + \\left( \\frac{\\partial A_{m}}{\\partial x_{i}} - \\frac{\\partial A_{m}}{\\partial x_{1}} \\right) - \\sum_{j = 2}^{c}x_{j}\\left( \\frac{\\partial A_{m}}{\\partial x_{j}} - \\frac{\\partial A_{m}}{\\partial x_{1}} \\right)$\n", + "\n", + "The difference of the partial derivatives in the parenthesis in\n", + "represents the partial derivative of $A_{m}$ with respect to the mole\n", + "fraction of one component when the first component is selected as the\n", + "dependent component. Applying and to Gibbs energy, the partial Gibbs\n", + "energy or chemical potential of component $i$ is obtained as\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} = G_{i} = G_{m} + \\frac{\\partial G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial G_{m}}{\\partial x_{j}} = G_{m} + \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} - \\frac{\\partial G_{m}}{\\partial x_{1}} \\right) - \\sum_{j = 2}^{c}x_{j}\\left( \\frac{\\partial G_{m}}{\\partial x_{j}} - \\frac{\\partial G_{m}}{\\partial x_{1}} \\right)$\n", + "\n", + "The derivatives in the stability equation, , are defined with the molar\n", + "quantities kept constant. On the other hand, Gibbs energy has two\n", + "potentials, temperature and pressure, as natural variables instead. One\n", + "would thus need to compare the stability conditions when a variable kept\n", + "fixed is changed from a molar quantity to its conjugate potential. This\n", + "can be carried out through the use of Jacobians to change the\n", + "independent variables\n", + "\n", + "Eq. ‑\n", + "$\\frac{\\partial\\left( Y_{i},Y_{j} \\right)}{\\partial\\left( X_{i},X_{j} \\right)} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}} - \\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{i}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{j}}$\n", + "\n", + "For a stable system, both\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}$ and\n", + "$\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}}$ are\n", + "positive based on . Using the Maxwell relation shown by , one thus\n", + "obtains\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} - \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{i}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{j}}/\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} \\geq 0$\n", + "\n", + "This means that\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}}$ will go\n", + "to zero before\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}$ does. It\n", + "indicates that the stability condition becomes more restrictive when\n", + "potentials are kept constant in place of their conjugate molar\n", + "quantities. Based on the Gibbs-Duhem equation of , the maximum number of\n", + "independent potentials is *c+1*, and the last potential is dependent,\n", + "i.e.\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial Y_{c + 2}}{\\partial X_{c + 2}} \\right)_{Y_{j \\leq c + 1}} = 0$\n", + "\n", + "Therefore, the limit of stability is determined when the derivative\n", + "becomes zero with one molar quantity kept constant, e.g.\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial Y_{c + 1}}{\\partial X_{c + 1}} \\right)_{Y_{j < c + 1},X_{c + 2}} = 0$\n", + "\n", + "This is because this derivative reaches zero faster than any other\n", + "derivatives with more molar quantities kept constant. shows that all\n", + "molar quantities diverge at the limit of stability. The consolute point\n", + "is obtained with $c$ additional conditions as follows based on\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial^{2}Y_{i}}{\\partial\\left( X_{i} \\right)^{2}} \\right)_{Y_{j \\leq c + 1, \\neq i},X_{c + 2}} = 0$\n", + "\n", + "Together with , all $c + 1$ independent potentials at the consolute\n", + "point can be determined. It is evident that the consolute point is a\n", + "zero-dimensional point in a two-dimensional space of independent\n", + "potentials in a one-component system. With the addition of a second\n", + "component to form a binary system, this consolute point in the\n", + "one-component system extends into a one-dimensional line. This line\n", + "represents the limit of stability of the binary system, and a consolute\n", + "point is located at the end of this line. It is thus evident that in a\n", + "system with $c$ independent components, the limit of stability is a\n", + "*c-1*-dimensional hypersurface in a space of $c + 1$ independent\n", + "potentials, while the consolute point is a zero-dimensional point in all\n", + "systems, which may be called the invariant critical point.\n" ], "text/plain": [ "" @@ -1179,156 +2242,271 @@ { "data": { "text/markdown": [ - "### Electrical batteries\n", - "\n", - "Batteries utilize electrochemical reactions to generate electricity for\n", - "various devices. The theoretic voltage of a battery can be calculated\n", - "from and , i.e.\n", - "\n", - "*Eq. 8‑73*\n", - "$\\varepsilon = - \\frac{\\mathrm{\\Delta}G}{zf} = \\varepsilon^{0} - \\frac{RTlnQ}{zf}$\n", - "\n", - "with $\\mathrm{\\Delta}G$ being the driving force of the net cell reaction\n", - "and $Q$ being the reaction activity quotient. The actual voltage of a\n", - "battery is lower than the theoretical one due to kinetic limitations of\n", - "cell reactions and resistance to ion diffusion through the electrolyte.\n", - "Based on whether the cell reactions are reversible or not, batteries\n", - "typically categorized as either primary disposable or secondary\n", - "rechargeable batteries. The net cell reactions in primary disposable\n", - "batteries are not easily reversible, and electrode materials may not\n", - "return to their original forms by applying a higher external potential\n", - "of opposite sign. Consequently, primary batteries cannot be reliably\n", - "recharged. On the other hand, the net cell reactions in secondary\n", - "batteries are easily reversible. Furthermore, two half-cells in\n", - "batteries may use different electrolytes with each half-cell enclosed in\n", - "a container and a separator permeable to conducting ions but not the\n", - "bulk of the electrolytes.\n", - "\n", - "One common primary battery is zinc-carbon battery with a zinc anode\n", - "cylinder and a carbon cathode central rod. The electrolytes are ammonium\n", - "or zinc chloride next to the zinc anode and a mixture of ammonium\n", - "chloride and manganese dioxide next to the carbon cathode. The half cell\n", - "and net reactions with ammonium chloride are as follows\n", + "## Phases with fixed compositions\n", + "\n", + "The homogeneous system discussed so far means that there is only one\n", + "phase in the system, i.e. a single-phase system. A phase with a fixed\n", + "composition can be a pure element or a stoichiometric compound. There is\n", + "thus only one independent component in the system. A stoichiometric\n", + "compound contains more than one element, but the relative amounts of\n", + "each element are fixed by the stoichiometry and cannot vary\n", + "independently, i.e., $dN_{i} = x_{i}dN$. The combined law of\n", + "thermodynamics becomes\n", + "\n", + "Eq. ‑\n", + "$dG = - SdT - Vd( - P) + \\left( \\sum_{}^{}{x_{i}\\mu_{i}} \\right)dN - Dd\\xi = - SdT - Vd( - P) + G_{m}dN - Dd\\xi$\n", + "\n", + "$G_{m}$ is the molar Gibbs energy of the stoichiometric compound and can\n", + "be regarded as the chemical potential of the stoichiometric\n", + "phase,$\\ \\alpha$,\n", + "\n", + "Eq. ‑ $G_{m} = \\mu^{\\alpha} = \\sum_{}^{}{x_{i}\\mu_{i}}$\n", + "\n", + "The chemical potential of individual components in the phase cannot be\n", + "defined because the amount of each component cannot be varied\n", + "independently. For a stoichiometric phase of $N$ moles of atoms at\n", + "equilibrium with $dG$=$Nd\\mu^{\\alpha} + \\mu^{\\alpha}dN$, reduces to\n", + "\n", + "Eq. ‑ $\\ 0 = - SdT - Vd( - P) - Nd\\mu^{\\alpha}$\n", + "\n", + "which is the Gibbs-Duhem equation, , applied to a stoichiometric phase.\n", + "It can be represented graphically by a surface in a three-dimensional\n", + "space composed of $\\ \\mu^{\\alpha}$, *T* and *–P*. The direction of the\n", + "surface is represented by the three partial directives between any two\n", + "of $\\ \\mu^{\\alpha}$, *T* and *–P* with the third one kept constant, i.e.\n", + "\n", + "Eq. ‑\n", + "$\\ \\left( \\frac{\\partial\\mu^{\\alpha}}{\\partial T} \\right)_{P} = - \\frac{S}{N} = - S_{m}$\n", + "\n", + "Eq. ‑\n", + "$\\ \\left( \\frac{\\partial\\mu^{\\alpha}}{\\partial( - P)} \\right)_{T} = - \\frac{V}{N} = - V_{m}$\n", + "\n", + "Eq. ‑\n", + "$\\ \\left( \\frac{\\partial( - P)}{\\partial T} \\right)_{\\mu^{\\alpha}} = - \\frac{S}{V} = - \\frac{S_{m}}{V_{m}}$\n", + "\n", + "Based on Nernst’s heat theorem, the entropy difference between two\n", + "crystals approaches zero when the temperature approaches absolute zero.\n", + "It is thus a common practice to put $S = 0$ for a crystal at 0 K. This\n", + "is usually referred as the third law of thermodynamics. From the\n", + "definition of entropy change by , $S$ or $S_{m}$ is always positive at\n", + "finite temperatures as the system or the crystal absorbs heat from the\n", + "surroundings to increase its temperature. $V$ or $V_{m}$ of a phase is a\n", + "well-defined physical quantity, and its absolute value can be given and\n", + "is always positive. The above three equations can be written in a\n", + "general form as\n", + "\n", + "Eq. ‑\n", + "$\\ \\left( \\frac{\\partial Y_{i}}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{X_{j}}{X_{i}} < 0$\n", + "\n", + "The surface thus has negative slopes in all its directions. The\n", + "curvature of the surface can be derived from\n", + "\n", + "Eq. ‑\n", + "$\\ \\left( \\frac{\\partial^{2}Y_{i}}{\\partial\\left( Y_{j} \\right)^{2}} \\right)_{Y_{k}} = - \\left( \\frac{\\partial\\left( \\frac{X_{j}}{X_{i}} \\right)}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{1}{X_{i}}\\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} + \\frac{X_{j}}{\\left( X_{i} \\right)^{2}}\\left( \\frac{\\partial X_{i}}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{1}{X_{i}}\\left\\lbrack \\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} - \\frac{X_{j}}{X_{i}}{\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)\\left( \\frac{\\partial Y_{i}}{\\partial Y_{j}} \\right)}_{Y_{k}} \\right\\rbrack = - \\frac{1}{X_{i}}\\left\\lbrack \\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} + \\left( \\frac{X_{j}}{X_{i}} \\right)^{2}\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)_{Y_{k}} \\right\\rbrack < 0$\n", + "\n", + "Both terms inside the last bracket are positive for a system in a state\n", + "of stable internal equilibrium, and the surface thus has a negative\n", + "curvature and is convex everywhere as shown in .\n", + "\n", + "Figure ‑: Gibbs energy of a one-component phase as a function of\n", + "temperature and negative pressure, showing the convex shape\n", + "\n", + "From experimental observations, it is known that\n", + "$S_{m}^{vapor} \\gg S_{m}^{liquid} > S_{m}^{solid}$. The curves of\n", + "$G_{m}$ or $\\mu^{\\alpha}$ plotted with respect to $T$ at constant $P$\n", + "would thus have the most negative slope for a vapour phase followed by\n", + "its liquid and solid phases. As an example, shows Gibbs energy of Zn in\n", + "its solid, liquid, and vapour forms as a function of $T$ at constant\n", + "$P = 1$ atmospheric pressure.\n", + "\n", + "Figure ‑: Molar Gibbs energy of Zn as a function of T at constant P\n", + "\n", + "Similarly it is common that\n", + "$V_{m}^{vapor} \\gg V_{m}^{liquid} > V_{m}^{solid}$, and the curves of\n", + "$G_{m}$ or $\\mu^{\\alpha}$ plotted with respect to $P$ at constant $T$\n", + "would thus have the most positive slope for a vapour phase followed by\n", + "its liquid and solid phases, though there are cases that\n", + "$V_{m}^{liquid} < V_{m}^{solid}$ such as those of water and ice. As an\n", + "example, shows Gibbs energy of Fe in its two solid (fcc and bcc),\n", + "liquid, and vapour forms as a function of $P$ at constant $T = 1273K$.\n", + "\n", + "Figure ‑: Molar Gibbs energy of Zn as a function of P at constant T\n", + "\n", + "The quantities measurable by experiments typically include temperature,\n", + "pressure, volume, composition, and amount of heat flow in the combined\n", + "law of thermodynamics discussed so far. By measuring the heat needed to\n", + "increase the temperature of a phase, the heat capacity of the phase is\n", + "obtained as shown by Eq. 2‑7. A typical heat capacity curve as a\n", + "function of temperature is shown in for fcc-Al, hcp-Mg, and an\n", + "intermetallic phase Al12Mg17.\n", + "\n", + "Figure ‑: Heat capacity of fcc-Al, hcp-Mg, and\n", + "Al12Mg17 as a function of temperature\n", + "\n", + "There are various theoretical models for the heat capacity under\n", + "constant volume to be discussed in Chapter 5 of this book, which is\n", + "defined as\n", + "\n", + "Eq. ‑\n", + "$C_{V} = \\left( \\frac{\\partial U}{\\partial T} \\right)_{V} = T\\left( \\frac{\\partial(F + TS)}{\\partial T} \\right)_{V} = T\\left( \\frac{\\partial S}{\\partial T} \\right)_{V} = - T\\left( \\frac{\\partial^{2}F}{\\partial T^{2}} \\right)_{V}$\n", + "\n", + "To establish the relationship between $C_{P}$ defined by and $C_{V}$,\n", + "$U$ needs to be represented as a function of $T$ and $V$ in terms of $G$\n", + "and its derivatives with respect to Gibbs energy’s natural variables of\n", + "$T$ and $P$. It can be done as follows\n", "\n", - "*Eq. 8‑74* Zn + 2NH3 →\n", - "Zn(NH3)22+ + 2 e-\n", + "Eq. ‑\n", + "$dV = \\frac{\\partial V}{\\partial T}dT + \\frac{\\partial V}{\\partial( - P)}d( - P) = - \\frac{\\partial^{2}G}{\\partial T( - P)}dT - \\frac{\\partial^{2}G}{\\partial( - P)^{2}}d( - P)$\n", "\n", - "*Eq. 8‑75* 2NH4Cl + 2MnO2 + 2 e- →\n", - "2NH3 + Mn2O3 +\n", - "H2O+2Cl\n", + "Eq. ‑\n", + "$dU = \\frac{\\partial(G + TS - PV)}{\\partial T}dT + \\frac{\\partial(G + TS - PV)}{\\partial( - P)}d( - P) = - \\left( T\\frac{\\partial^{2}G}{\\partial T^{2}} - P\\frac{\\partial^{2}G}{\\partial T( - P)} \\right)dT—\\left( T\\frac{\\partial^{2}G}{\\partial T( - P)} + P\\frac{\\partial^{2}G}{\\partial( - P)^{2}} \\right)\\left( - \\frac{1}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}dV + \\frac{\\frac{\\partial^{2}G}{\\partial T( - P)}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}dT \\right) = - \\left\\lbrack T\\frac{\\partial^{2}G}{\\partial T^{2}} - T\\frac{\\left( \\frac{\\partial^{2}G}{\\partial T( - P)} \\right)^{2}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} \\right\\rbrack dT + \\left( - T\\frac{\\frac{\\partial^{2}G}{\\partial T( - P)}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} + P \\right)dV$\n", "\n", - "*Eq. 8‑76* Zn + 2MnO2 + 2NH4Cl →\n", - "Mn2O3 +\n", - "Zn(NH3)2Cl2 + H2O.\n", + "Eq. ‑\n", + "$C_{V} = C_{P} + T\\frac{\\left( \\frac{\\partial^{2}G}{\\partial T( - P)} \\right)^{2}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} = C_{P} - \\frac{\\alpha_{V}^{2}VT}{\\kappa_{T}} = C_{P} - \\alpha_{V}^{2}BVT$\n", "\n", - "The electric potential of the reaction is, treating all compounds as\n", - "stoichiometric compounds\n", + "where the thermal expansion, $\\alpha_{V}$, and the compressibility or\n", + "bulk modulus, $\\kappa_{T}$ or $B$, are defined by and , respectively.\n", + "From the heat capacity, the enthalpy and entropy can be obtained by\n", + "integration of at a constant pressure\n", "\n", - "Eq. 8‑77\n", - "$\\varepsilon = - \\frac{\\mathrm{\\Delta}G}{2f} = - \\frac{\\mathrm{\\Delta}^{0}G}{2f} = \\frac{1}{2f}\\left(_{\\ }^{0}G^{Zn} + 2_{\\ }^{0}G^{{MnO}_{2}} + 2_{\\ }^{0}G^{{NH}_{4}Cl} -_{\\ }^{0}G^{H_{2}O} -_{\\ }^{0}G^{Zn\\left( {NH}_{3} \\right)_{2}{Cl}_{2}} -_{\\ }^{0}G^{{{Mn}_{2}O}_{3}} \\right)$.\n", + "Eq. ‑\n", + "$S = S_{0} + \\int_{0}^{T}\\frac{C_{P}}{T}dT = S_{0} + \\int_{0}^{298.15}\\frac{C_{P}}{T}dT + \\int_{298.15}^{T}\\frac{C_{P}}{T}dT = S_{298.15} + \\int_{298.15}^{T}\\frac{C_{P}}{T}dT$\n", "\n", - "The Gibbs energy of $Zn\\left( {NH}_{3} \\right)_{2}{Cl}_{2}$ is not\n", - "available in current databases and has been recently estimated to be\n", - "−505,375 J/mole-formula \\[62\\]. The value of at 298.15K is thus obtained\n", - "as 1.67 V, which is pretty close to the actual operating voltage of the\n", - "battery around 1.5 V.\n", + "Eq. ‑\n", + "$H = H_{0} + \\int_{0}^{T}C_{P}dT = H_{0} + \\int_{0}^{298.15}C_{P}dT + \\int_{298.15}^{T}C_{P}dT = H_{298.15} + \\int_{298.15}^{T}C_{P}dT$\n", "\n", - "While with zinc chloride, the cell reactions and electric potential may\n", - "be written as\n", + "In the above equations, two temperature ranges of integration are chosen\n", + "for practical applications as most processing procedures in the field of\n", + "materials science and engineering take place at temperatures above the\n", + "room temperature. Based on the third-law of thermodynamics, $S_{0} = 0$,\n", + "$S_{298.15}$ can be obtained by integration. On the other hand for\n", + "$H_{0} = U_{0} + PV$, one does not know the absolute value of the\n", + "internal energy and thus have to select a reference state for $H$. In\n", + "principle, the reference state can be arbitrarily chosen. A widely used\n", + "reference state in the thermodynamic modeling practice is to set\n", + "$H_{298.15}^{SER} = 0$ at ambient pressure for pure elements at their\n", + "respective stable structures at room temperature, called stable element\n", + "reference (SER) state with\n", "\n", - "Eq. 8‑78 Zn + ZnCl2 + 2OH → 2ZnOHCl + 2\n", - "e-\n", + "Eq. ‑\n", + "$G_{298.15}^{SER} = H_{298.15}^{SER} - TS_{298.15}^{SER} = - TS_{298.15}^{SER}$\n", "\n", - "*Eq. 8‑79* MnO2 + H2O + e- → MnOOH +\n", - "OH-\n", + "It is further noted that after defining $S_{298.15}$ and $H_{298.15}$,\n", + "one only needs the heat capacity at higher temperatures. This makes the\n", + "mathematical representation of heat capacity simpler due to a relatively\n", + "simple temperature dependence of heat capacity at higher temperatures in\n", + "comparison with the variation at lower temperatures. One common\n", + "expression for heat capacity at high temperatures and ambient pressure\n", + "is as follows\n", "\n", - "*Eq. 8‑80* Zn + 2 MnO2 + ZnCl2 + 2 H2O\n", - "→ 2 MnOOH + 2 ZnOHCl\n", + "Eq. ‑ $C_{P} = c + dT + \\frac{e}{T^{2}} + fT^{2}$\n", "\n", - "*Eq. 8‑81*\n", - "$\\varepsilon = \\frac{1}{2f}\\left(_{\\ }^{0}G^{Zn} + 2_{\\ }^{0}G^{{MnO}_{2}} +_{\\ }^{0}G^{Zn{Cl}_{2}} + 2_{\\ }^{0}G^{H_{2}O} - 2_{\\ }^{0}G^{MnOOH} - 2_{\\ }^{0}G^{ZnOHCl} \\right)$\n", + "where c, d, e, and f are parameters fitted to experimental or theoretic\n", + "data and compiled in various handbooks.\n", "\n", - "Secondary batteries can be recharged by applying an external electrical\n", - "potential, which reverses the net cell reaction that occur during\n", - "discharging. The oldest form of rechargeable battery is the lead-acid\n", - "batteries used in automotive, and the latest development is the\n", - "lithium-ion (Li-ion) batteries. A lead-acid battery typically uses Pb\n", - "and PbO2 as the cathode and anode electrodes and a 35% sulfuric acid and\n", - "65% water solution as the electrolyte. Its anode and cathode reactions\n", - "can be simplified as follows\n", + "The corresponding $S$, $H$, and $G$ are obtained as\n", "\n", - "Eq. 8‑82 $Pb + SO_{4}^{2 -} = PbSO_{4} + 2e^{-}$\n", + "Eq. ‑ $S = b^{'} + clnT + dT - \\frac{e}{{2T}^{2}} + \\frac{f}{2}T^{2}$\n", "\n", - "Eq. 8‑83 $PbO_{2} + 4H^{+} + SO_{4}^{2 -} + 2e^{-} = PbSO_{4} + 2H_{2}O$\n", + "Eq. ‑ $H = a + cT + \\frac{d}{2}T^{2} - \\frac{e}{T} + \\frac{f}{3}T^{3}$\n", "\n", - "The net cell reaction is\n", + "Eq. ‑\n", + "$G = H - TS = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3}$\n", "\n", - "Eq. 8‑84 $Pb + PbO_{2} + 2H_{2}SO_{4}^{\\ } = 2PbSO_{4} + 2H_{2}O$.\n", + "with $b = b^{'} - c$. The integration constants $b^{'}$ and $a$ are\n", + "evaluated from $S_{298.15}$ and $H_{298.15}$. As an example, the\n", + "enthalpy and entropy of Zn in solid (hcp), liquid, and gas forms are\n", + "plotted in and , respectively. The distances between any two curves in\n", + "and represent the enthalpy or entropy differences between the two\n", + "phases. It can be seen that the gas has much higher enthalpy and entropy\n", + "than the solid and liquid.\n", "\n", - "Its electric potential is represented by the following equation\n", + "Figure ‑: Enthalpy of Zn as a function of temperature at one atmospheric\n", + "pressure\n", "\n", - "*Eq. 8‑85*\n", - "$\\varepsilon = - \\frac{1}{2f}\\left( 2_{\\ }^{0}G^{H_{2}O} + 2_{\\ }^{0}G^{{PbSO}_{4}} -_{\\ }^{0}G^{Pb} -_{\\ }^{0}G^{{PbO}_{2}} - 2_{\\ }^{0}G^{H_{2}SO_{4}} \\right)$\n", + "Figure ‑: Entropy of Zn as a function of temperature at one atmospheric\n", + "pressure\n", "\n", - "with the value at 298.15K being 2.651 V calculated from Thermo-Calc\n", - "\\[60\\]. During discharging, the reaction goes to right, and $PbSO_{4}$\n", - "is formed on both anode and cathode, while during charging, the reaction\n", - "goes to the left, and $Pb$ and $PbO_{2}$ are restored. In practical\n", - "applications, other ionic species such as ${H_{3}O}^{+}$ and\n", - "$HSO_{4}^{-}$ may form in the electrolyte, complicating the reactions\n", - "and affecting its potential.\n", + "Similarly, one can add the pressure dependence into the Gibbs energy\n", + "function such as\n", "\n", - "In lithium ion batteries, lithium ions migrate in electrolytes between\n", - "electrodes made of intercalated lithium compounds during charging and\n", - "discharging. LiCoO2 and LiFePO4 are two of the\n", - "several cathode materials used in lithium ion batteries, and the anode\n", - "is typically made of carbon or metallic Li. The anode and cathode\n", - "reactions for LiCoO2 batteries can be written in simple forms as follows\n", + "Eq. ‑\n", + "$G = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3} + gP + hTP + mP^{2}$\n", "\n", - "Eq. 8‑86 ${Li}_{x}C_{6} = x{Li}^{+} + xe^{-} + 6C$\n", + "where g, h, and m are parameters fitted to experimental or theoretic\n", + "data and compiled in various handbooks.\n", "\n", - "Eq. 8‑87 $x{Li}^{+} + xe^{-} + {Li}_{1 - x}CoO_{2} = LiCoO_{2}$\n", - "\n", - "with the net reaction and electric potential being\n", + "The expression for $V$ can be derived as\n", "\n", - "Eq. 8‑88 ${Li}_{x}C_{6} + {Li}_{1 - x}CoO_{2} = LiCoO_{2} + 6C$\n", + "Eq. ‑ $V = g + hT + 2mP$\n", "\n", - "*Eq. 8‑89*\n", - "$\\varepsilon = - \\frac{1}{xf}\\left\\{ 6_{\\ }^{0}G^{C} +_{\\ }^{0}G^{{LiCoO}_{2}} - G^{{{Li}_{x}C}_{6}} - G^{{{Li}_{1 - x}CoO}_{2}} \\right\\} = - \\frac{1}{f}\\left\\{ \\left( \\mu_{Li}^{{Li}_{1 - x}CoO_{2}} - \\mu_{Li}^{{Li}_{x}C} \\right) - \\frac{1}{x}\\left( \\mu_{LiCoO_{2}}^{{Li}_{1 - x}CoO_{2}} -_{\\ }^{0}G^{{LiCoO}_{2}} \\right) \\right\\}$\n", + "The Helmholtz energy can be expressed as a function of its natural\n", + "variables by solving $P\\ $ from\n", "\n", - "The electric potential is a function of $x$. The value in the first\n", - "parenthesis in the above equation denotes the chemical potential\n", - "difference of Li between two electrodes, and the value in the second\n", - "parenthesis represents the chemical potential difference of\n", - "${LiCoO}_{2}$ between the states in the solution phase of\n", - "${Li}_{1 - x}CoO_{2}$ and by itself. Gibbs energies of ${{Li}_{x}C}_{6}$\n", - "and ${{Li}_{1 - x}CoO}_{2}$ need to be obtained as a function $x$ in\n", - "order to calculate the electric potential of the battery.\n", + "Eq. ‑\n", + "$F = G - PV = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3} - \\frac{(g + hT - V)^{2}}{4m}$\n", "\n", - "LiFePO4 uses metallic lithium as the anode with following\n", - "half-cell and net cell reactions\n", + "In the literature there are many models to represent the temperature and\n", + "pressure dependences of thermodynamic properties. The Gibbs energy\n", + "difference between a stoichiometric compound and the components at their\n", + "reference states of which the compound is composed,\n", + "${_{\\ }^{0}G}_{i}^{ref}$, is termed as Gibbs energy of formation, i.e.\n", + "\n", + "Eq. ‑ $\\mathrm{\\Delta}_{f}G = G - \\sum_{}^{}N_{i}{_{\\ }^{0}G}_{i}^{ref}$\n", "\n", - "Eq. 8‑90 $xLi = x{Li}^{+} + xe^{-}$\n", + "with $N_{i}$ being the stoichiometry of the compound. Similarly,\n", + "enthalpy of formation, entropy of formation, and heat capacity of\n", + "formation with respect to components at their reference states,\n", + "$_{\\ }^{0}H_{i}^{ref}$, $_{\\ }^{0}S_{i}^{ref}$, and\n", + "$_{\\ }^{0}{C_{P}}_{i}^{ref}$, can be defined as\n", + "\n", + "Eq. ‑ $\\mathrm{\\Delta}_{f}H = H - \\sum_{}^{}{N_{i}_{\\ }^{0}H_{i}^{ref}}$\n", + "\n", + "Eq. ‑ $\\mathrm{\\Delta}_{f}S = S - \\sum_{}^{}{N_{i}_{\\ }^{0}S_{i}^{ref}}$\n", + "\n", + "Eq. ‑\n", + "$\\mathrm{\\Delta}_{f}C_{P} = C_{P} - \\sum_{}^{}{N_{i}_{\\ }^{0}{C_{P}}_{i}^{ref}}$\n", + "\n", + "It should be mentioned that one mole of a compound usually refers to one\n", + "mole of formula of stoichiometry of the compound. With a formula like\n", + "$A_{a}B_{b}C_{c}$, the compound is composed of total $(a + b + c)$ moles\n", + "of components. One should thus be very careful when dealing with\n", + "numerical values to be sure whether the data is in terms of per mole of\n", + "formula or per mole of components. At the same time the reference states\n", + "must be clearly defined. When the SER state defined in is selected as\n", + "the reference state, the above formation quantities are called standard\n", + "formation quantities such as standard enthalpy of formation.\n", + "\n", + "Since there are only two independent potentials in a one-component\n", + "system, its limit of stability can be evaluated with one potential kept\n", + "constant, i.e. either $T$ or $P$. Consequently, either Helmholtz energy\n", + "or enthalpy is to be used in deriving the limit of stability of a\n", + "homogeneous system. For the practical usefulness, let us use Helmholtz\n", + "energy because its natural variables of $T$ and *V* are measurable\n", + "quantities in typical experiments, while one of the natural variables of\n", + "enthalpy, entropy, is not. From and , the limit of stability for a\n", + "one-component system at constant temperature can be written as\n", "\n", - "Eq. 8‑91 $x{Li}^{+} + xe^{-} + {Li}_{1 - x}FePO_{4} = LiFePO_{4}$\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial( - P)}{\\partial V} \\right)_{T,N} = F_{VV} = \\frac{1}{V\\kappa_{T}} = \\frac{B}{V} = 0$\n", "\n", - "Eq. 8‑92 $xLi + {Li}_{1 - x}FePO_{4} = LiFePO_{4}$.\n", + "where the isothermal compressibility and bulk modulus, $\\kappa_{T}$ and\n", + "$B$, are defined in . The limit of stability is thus determined when the\n", + "isothermal compressibility diverges or the bulk modulus becomes zero\n", + "because $V$ has finite values at any temperatures. It is evident that\n", + "Helmholtz energy must have higher order dependence on volume than in for\n", + "a system with instability because $F_{VV}$ from is constant.\n", "\n", - "Its electric potential is also a function of $x$, i.e.\n", + "From , the consolute point is defined by\n", "\n", - "*Eq. 8‑93*\n", - "$\\varepsilon = - \\frac{1}{xf}\\left\\{_{\\ }^{0}G^{LiFePO_{4}} - x\\ ^{0}G^{Li} - G^{{Li}_{1 - x}FePO_{4}} \\right\\} = - \\frac{1}{f}\\left\\{ \\left( \\mu_{Li}^{{Li}_{1 - x}FePO_{4}} - \\ ^{0}\\mu_{Li} \\right) - \\frac{1}{x}\\left( \\mu_{LiFePO_{4}}^{{Li}_{1 - x}FePO_{4}} -_{\\ }^{0}G^{LiFePO_{4}} \\right) \\right\\}$\n", + "Eq. ‑\n", + "$F_{VVV} = \\left( \\frac{\\partial^{2}( - P)}{\\partial V^{2}} \\right)_{T,N} = \\frac{\\partial\\left( \\frac{1}{V\\kappa_{T}} \\right)}{\\partial V} = - \\frac{1 + \\frac{V}{\\kappa_{T}}\\frac{\\partial\\kappa_{T}}{\\partial V}}{\\kappa_{T}V^{2}} = 0$\n", "\n", - "The value in the first parenthesis in the above equation denotes the\n", - "chemical potential difference of Li between two electrodes, and the\n", - "value in the second parenthesis represents the chemical potential\n", - "difference of $LiFePO_{4}$ between the states in the solution phase of\n", - "${Li}_{1 - x}FePO_{4}$ and by itself. Consequently, Gibbs energy of\n", - "${Li}_{1 - x}FePO_{4}$ needs to be obtained as a function $x$ in order\n", - "to calculate the electric potential of the battery. It is known that\n", - "there are several miscibility gaps in the $FePO_{4}$ and $LiFePO_{4}$\n", - "psuedo-binary system, in which the chemical potentials are constants, so\n", - "is the electric potential, resulting in stable battery output.\n" + "Since $\\kappa_{T}$ becomes infinite at the limit of stability,\n", + "$\\frac{\\partial\\kappa_{T}}{\\partial V}$ approaches negative infinite\n", + "when the critical/consolute point is approached so that\n", + "$\\frac{V}{\\kappa_{T}}\\frac{\\partial\\kappa_{T}}{\\partial V} = - 1$ and\n", + "$F_{VVV} = 0$.\n" ], "text/plain": [ "" @@ -1340,82 +2518,115 @@ { "data": { "text/markdown": [ - "## Electrolyte reactions and electrochemical reactions\n", - "\n", - "Electrolytes that dissolve in a polar solvent such as water to produce\n", - "ionic species do not necessarily exhibit valence changes. A simple\n", - "example is the strong electrolyte NaCl(s) dissolving in water to produce\n", - "solvated ions\n", - "\n", - "*Eq. 8‑1* $NaCl(s)\\ \\ = \\ \\ {Na}^{+}(aq)\\ \\ + \\ \\ {Cl}^{–}(aq)$\n", - "\n", - "where the $(aq)$ indicates the ionic species in an aqueous solution. In\n", - "this system, the ion concentrations must become quite large before the\n", - "solution is saturated and can exist in equilibrium with $NaCl(s)$. Its\n", - "reaction constant, defined by , is shown as\n", - "$K_{e} = \\ \\ a_{{Na}^{+}}a_{{Cl}^{-}}$. If the product of the ion\n", - "activities is less than $K_{e}$, the solution is not saturated, and more\n", - "$NaCl(s)\\ \\ $ can be dissolved.\n", - "\n", - "The precipitation of $AgCl(s)$, a weak electrolyte, occurs quite readily\n", - "when ${Cl}^{–}$ ions are added to an aqueous solution containing\n", - "${Ag}^{+}(aq)$:\n", - "\n", - "*Eq. 8‑2* ${Ag}^{+}(aq)\\ + \\ \\ {Cl}^{–}(aq)\\ = AgCl(s)$\n", - "\n", - "The equilibrium constant for this reaction,\n", - "$K_{e} = \\ \\frac{1}{\\left( a_{{Ag}^{+}}a_{{Cl}^{-}} \\right)}$ is quite\n", - "large, so the equilibrium product of the ion activities, proportional to\n", - "their concentrations, is quite small. In the laboratory, the above\n", - "reaction could occur as a result of adding hydrochloric acid to a silver\n", - "nitrate solution. The accompanying $H^{+}(aq)$ \\[or ${H_{3}O}^{+}(aq)$\\]\n", - "and ${NO_{3}}^{-}(aq)$ ions in solution are not directly involved in the\n", - "silver chloride precipitation reaction so are not shown in reaction\n", - "represented by .\n", - "\n", - "The above ionic equilibria in the $AgCl(s) - H_{2}O$ system is not only\n", - "important for understanding this electrolyte system, but also critical\n", - "in electrochemical systems in which *Ag(s)* undergoes a valence change\n", - "at one electrode and reacts with a ${Cl}^{–}(aq)$ ion to produce\n", - "*AgCl(s)*, and an electron that is externally transported finite\n", - "distances to another electrode. The *oxidation* reaction occurs at the\n", - "Ag/AgCl electrode (*anode* half-cell reaction where electrons are\n", - "*added* into the system)\n", - "\n", - "*Eq. 8‑3* $Ag(s)\\ \\ + \\ {Cl}^{-}(aq)\\ \\ = \\ \\ AgCl(s)\\ \\ + \\ \\ e^{-}$\n", - "\n", - "A *reduction* reaction occurs at the other electrode (*cathode*\n", - "half-cell reaction where electrons are *consumed* by the reaction)\n", - "\n", - "*Eq. 8‑4* $\\frac{1}{2}{Cl}_{2}(g) + \\ \\ e^{-} = \\ {Cl}^{-}(aq)\\ \\ $\n", - "\n", - "The *net cell reaction* results in the formation AgCl(s) from its\n", - "elements\n", - "\n", - "*Eq. 8‑5* $Ag(s)\\ \\ + \\frac{1}{2}{Cl}_{2}\\ (g)\\ = \\ \\ AgCl(s)$\n", - "\n", - "Without knowledge of the physical system under which the reaction is\n", - "occurring, it would not be possible to know if reaction of was a result\n", - "of chlorine gas reacting directly with Ag(s), or if the reaction was\n", - "part of an electrochemical cell with a transport of electrons and ions\n", - "over finite distances. The addition of the two half-cell reactions gives\n", - "the *net cell reaction*, which does not show electrons as either\n", - "reactant or product species and may or may not include ionic species in\n", - "the reaction*.* A schematic of an electrochemical cell for the above\n", - "system is shown in Figure 8‑1.\n", - "\n", - "Figure ‑: Schematic diagram of an electrochemical cell consisting of a\n", - "chlorine electrode and a silver-silver chloride electrode.\n", - "\n", - "Oxidation and reduction can occur in electrolyte reactions without\n", - "creating an electrochemical cell. This is the case when chlorine gas\n", - "reacts directly with silver on a Ag(s) surface. Reaction of above is the\n", - "net reaction for this process, but the electrons produced from the\n", - "oxidation of Ag(s) are not transported over finite distances before\n", - "combining with Cl2(g) in its reduction to Cl(aq).\n", - "No anode or cathode half-cell reactions exist in this system. The\n", - "electrons and ions involved in the reaction move only over atomic-scale\n", - "distances.\n" + "## Phases with variable compositions: Random solutions\n", + "\n", + "The combined law of thermodynamics and the Gibbs-Duhem equation of a\n", + "solution phase with variable compositions are shown by and ,\n", + "respectively. A phase can be represented by a *c+1*-dimensional surface\n", + "in a *c+2*-dimensional space of potentials based on the Gibbs-Duhem\n", + "equation. The directions and curvature of the surface are represented by\n", + "the partial derivatives shown by and secondary derivatives shown by ,\n", + "both being negative for a stable phase. To develop a mathematical\n", + "formula for Gibbs energy of a phase with variable compositions, one can\n", + "consider a phase as a mixture of independent components that the phase\n", + "is made of. Its Gibbs energy function can be postulated as the summation\n", + "of Gibbs energy of the independent components of the same structure of\n", + "the solution, $_{\\ }^{0}G_{i}$, plus the contribution due to the mixing,\n", + "$_{\\ }^{mixing}G$ or $_{\\ }^{M}G$\n", + "\n", + "Eq. ‑ $G = \\sum_{}^{}{N_{i}_{\\ }^{0}G_{i}} +_{\\ }^{M}G$\n", + "\n", + "Since the system size usually is not important in thermodynamics, its\n", + "properties are typically normalized to one mole with its composition\n", + "represented by mole fractions of components. The molar Gibbs energy is\n", + "obtained as shown below with the molar Gibbs energy of mixing separated\n", + "into two parts: ideal Gibbs energy of mixing assuming no chemical\n", + "interaction among components, $_{\\ }^{ideal}G_{m}$ or $_{\\ }^{I}G_{m}$,\n", + "and excess Gibbs energy of mixing due to chemical reaction among\n", + "components, $_{\\ }^{excess}G_{m}$ or $_{\\ }^{E}G_{m}$\n", + "\n", + "Eq. ‑\n", + "$G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} +_{\\ }^{M}G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} +_{\\ }^{I}G_{m} +_{\\ }^{E}G_{m}$\n", + "\n", + "From , the chemical potential of a component is thus\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} +_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} + \\frac{\\partial\\left(_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} \\right)}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial\\left(_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} \\right)}{\\partial x_{j}}$\n", + "\n", + "One may define the chemical activity of component *i*, $a_{i}^{\\ }$, as\n", + "follows\n", + "\n", + "Eq. ‑\n", + "$RTlna_{i}^{\\ } = \\mu_{i} -_{\\ }^{0}G_{i}^{\\ } =_{\\ }^{I}{G_{m} +}\\frac{\\partial_{\\ }^{I}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{I}G_{m}}{\\partial x_{j}} +_{\\ }^{E}G_{m} + \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{j}}$\n", + "\n", + "In this definition, the chemical activity or simply activity is\n", + "calculated with respect to the pure elements in the structure of the\n", + "solution for practical reasons as one would like to understand the\n", + "chemical potential difference of components in the solution and by\n", + "itself with the same structure. It should be noted that this reference\n", + "state for chemical activity is usually different from the SER reference\n", + "state defined in as the solution may have a different structure than\n", + "those of pure components in their SER states. On the other hand, the\n", + "activity under the SER reference state can be easily obtained by\n", + "replacing $_{\\ }^{0}G_{i}$ with ${_{\\ }^{0}G}_{i}^{SER}$ from . In\n", + "principle, one may choose any structure as the reference state for\n", + "activity to be useful for practical applications, i.e.\n", + "\n", + "Eq. ‑ $RTlna_{i}^{ref} = \\mu_{i} -_{\\ }^{0}G_{i}^{ref}$\n", + "\n", + "For example, the activity of a component in a liquid solution is defined\n", + "with respect to the pure component in its liquid form from , but can\n", + "also be referred to its SER state which is solid using . The following\n", + "sections will discuss in more details how components mix when they are\n", + "brought together including concepts such as random mixing, short-range\n", + "ordering, and long-range ordering.\n", + "\n", + "The limit of stability of a solution with respect to composition\n", + "fluctuation under constant *T*, *P*, and *N1* can be derived\n", + "as follows from and\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},i > 1} > \\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{1},{\\mu_{2},N}_{j \\neq i},i,j > 2}\\ldots... > \\left( \\frac{\\partial\\mu_{c}}{\\partial N_{c}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = 0$\n", + "\n", + "The first term can be derived from as follows\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},i > 1} = \\sum_{j = 1}^{c}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}\\partial x_{j}}\\frac{\\partial x_{j}}{\\partial N_{i}} - \\sum_{j = 1}^{c}{x_{j}\\sum_{k = 1}^{c}{\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}\\partial x_{k}}\\frac{\\partial x_{k}}{\\partial N_{i}}}} = \\frac{1}{N}\\left( \\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}^{2}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}^{2}}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}\\partial x_{j}}} + \\sum_{j = 1}^{c}{\\sum_{k = 1}^{c}{{x_{j}x}_{k}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}\\partial x_{k}}}} \\right)$\n", + "\n", + "Denoting\n", + "$G_{ij} = \\left( \\frac{\\partial\\mu_{i}}{\\partial N_{j}} \\right)_{T,P,N_{k \\neq j}}$and\n", + "using to change the variables kept constant from molar quantities to\n", + "potentials one-by-one (see \\[1\\]), the limit of stability can be further\n", + "obtained as\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{c}}{\\partial N_{c}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = \\frac{\\det\\left( G_{ij}:2 \\leq i,j \\leq c \\right)}{\\det\\left( G_{ij}:2 \\leq i,j \\leq c - 1 \\right)} = 0$\n", + "\n", + "where $\\det$ stands for determinant. indicates that\n", + "$\\det\\left( G_{ij}:2 \\leq i,j \\leq c \\right) = 0$ at the limit of\n", + "stability. Considering $x_{1} = 1 - \\sum_{j \\neq 1}^{}x_{j}$, let us\n", + "introduce\n", + "\n", + "Eq. ‑\n", + "$g_{i} = \\mu_{i} - \\mu_{1} = \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{k \\neq i}} - \\left( \\frac{\\partial G_{m}}{\\partial x_{1}} \\right)_{x_{k \\neq 1}}$\n", + "\n", + "and\n", + "\n", + "Eq. ‑\n", + "$g_{ij} = \\frac{\\partial g_{i}}{\\partial x_{j}} = \\frac{\\partial\\left( \\mu_{i} - \\mu_{1} \\right)}{\\partial x_{j}} = \\frac{\\partial^{2}G_{m}}{\\partial x_{i}\\partial x_{j}} - \\frac{\\partial^{2}G_{m}}{\\partial x_{1}\\partial x_{j}} - \\frac{\\partial^{2}G_{m}}{\\partial x_{i}\\partial x_{1}} + \\frac{\\partial^{2}G_{m}}{\\partial\\left( x_{1} \\right)^{2}}$\n", + "\n", + "The limit of stability can be re-written as\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\left( \\mu_{c} - \\mu_{1} \\right)}{\\partial x_{c}} \\right)_{T,P,N,\\mu_{2} - \\mu_{1},\\ ...\\mu_{c - 1} - \\mu_{1}} = \\frac{\\det\\left( g_{ij}:2 \\leq i,j \\leq c \\right)}{\\det\\left( g_{ij}:2 \\leq i,j \\leq c - 1 \\right)} = 0$\n", + "\n", + "i.e. $\\det\\left( g_{ij}:2 \\leq i,j \\leq c \\right) = 0$. The consolute\n", + "point can be defined following\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial^{2}\\mu_{c}}{\\partial\\left( N_{c} \\right)^{2}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = \\left( \\frac{\\partial^{2}\\left( \\mu_{c} - \\mu_{1} \\right)}{\\partial\\left( x_{c} \\right)^{2}} \\right)_{T,P,N,\\mu_{2} - \\mu_{1},\\ ...\\mu_{c - 1} - \\mu_{1}} = 0$\n", + "\n", + "No closed mathematic form has been published in the literature.\n" ], "text/plain": [ "" @@ -1427,52 +2638,103 @@ { "data": { "text/markdown": [ - "### Fuel cells\n", - "\n", - "Fuel cells are devices to convert chemical energy to electricity and\n", - "heat through electrochemical reactions with the fuel and oxygen supplied\n", - "to the anode and cathode, respectively. Typical ions migrating through\n", - "the electrolyte are $H^{+}$, ${OH}^{-}$, ${CO}_{3}^{2 -}$, and\n", - "$O^{2 -}$. In fuel cells with $H^{+}$ as migrating ions, H2\n", - "molecules are dissociated into $H^{+}$ on the anode, which are combined\n", - "with O2 on the cathode to form H2O and release\n", - "heat with the half cell and the net cell reactions in their simplest\n", - "form as shown by for the anode, for the cathode, and for the net cell,\n", - "respectively. Commonly used electrolytes are polymer and phosphoric\n", - "acid, and both anode and cathode reactions are facilitated by catalyst,\n", - "typically platinum. The thermodynamic limit of power which can be\n", - "generated by the fuel cell is represented by\n", - "\n", - "*Eq. 8‑63*\n", - "$w = - \\mathrm{\\Delta}G = - \\mathrm{\\Delta}_{\\ }^{0}G_{cell} + RTln\\left( P_{H_{2}}P_{O_{2}}^{1/2} \\right)$\n", - "\n", - "For fuel cells with anions as migrating ions, the anions are generated\n", - "on the cathode with H2O formed and heat generated on the\n", - "anode. Their representative cathode reactions are\n", - "\n", - "*Eq. 8‑64* $\\frac{1}{2}O_{2} + H_{2}O + 2e^{-}{= 2OH}^{-}$\n", - "\n", - "*Eq. 8‑65* ${\\frac{1}{2}O}_{2} + CO_{2} + 2e^{-} = {CO}_{3}^{2 -}$\n", - "\n", - "*Eq. 8‑66* $\\frac{1}{2}O_{2} + 2e^{-} = O^{2 -}$.\n", - "\n", - "The anode reaction for is the reaction represented by , operating at low\n", - "temperatures and using catalyst for both electrodes. The anode reactions\n", - "for and are\n", - "\n", - "*Eq. 8‑67* ${CO}_{3}^{2 -} + H_{2} = H_{2}O + CO_{2} + 2e^{-}$\n", - "\n", - "*Eq. 8‑68* $O^{2 -} + H_{2} = H_{2}O + 2e^{-}$\n", - "\n", - "respectively. To enable the diffusion of ${CO}_{3}^{2 -}$ and $O^{2 -}$\n", - "through the cathode and the electrolyte, both fuel cells are operated at\n", - "relative high temperatures, with the former typically in molten\n", - "carbonate solutions and the latter through solid oxides. Due to the high\n", - "operating temperatures, fuels are converted to hydrogen within the fuel\n", - "cell itself by a process called internal reforming, removing the need\n", - "for precious-metal catalyst and enabling the use of a variety of fuels.\n", - "The net cell reaction for all three fuel cells is the same as in the\n", - "case of $H^{+}$, represented by .\n" + "### Random solutions\n", + "\n", + "The ideal Gibbs energy of mixing represents an ideal solution in which\n", + "all sites are equivalent and the distributions of components on the\n", + "sites are completely random. The number of different configurations to\n", + "arrange all components is\n", + "\n", + "Eq. ‑ $w = \\frac{N!}{\\prod_{}^{}\\left( N_{i}! \\right)}$\n", + "\n", + "Based on Boltzmann’s relation from statistic thermodynamics when all\n", + "configurations have the same probability to be observed, the ideal\n", + "configurational molar entropy of mixing due to the distribution is\n", + "\n", + "Eq. ‑\n", + "$_{\\ }^{ideal}S_{m} =_{\\ }^{I}S_{m} = \\frac{Rlnw}{N} = R\\frac{lnN! - \\sum_{}^{}\\ln\\left( N_{i}! \\right)}{N} \\cong R\\frac{NlnN - \\sum_{}^{}{N_{i}l{nN}_{i}}}{N} = - R\\sum_{}^{}{x_{i}l{nx}_{i}}$\n", + "\n", + "where $R$ is the gas constant. represents the entropy difference between\n", + "the ideal solution and the states when individual components are by\n", + "themselves, i.e. the mechanical mixing of components. As $x_{i}$ is\n", + "smaller than unity, the entropy production to form an ideal solution\n", + "from pure components is thus positive, indicating that it is a\n", + "spontaneous process. In such an ideal solution, it is assumed that there\n", + "are no interactions between components, and the enthalpy of mixing is\n", + "thus zero as the internal energy and the volume of the system do not\n", + "change. The ideal Gibbs energy of mixing is written as\n", + "\n", + "Eq. ‑ $_{\\ }^{I}G = - T_{\\ }^{I}S_{m} = RT\\sum_{}^{}{x_{i}l{nx}_{i}}$\n", + "\n", + "The Gibbs energy of real solutions, i.e. , becomes\n", + "\n", + "Eq. ‑\n", + "$G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} + RT\\sum_{}^{}{x_{i}l{nx}_{i}} +_{\\ }^{E}G_{m}$\n", + "\n", + "From , the chemical potential is obtained as\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} = G_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} +_{\\ }^{E}G_{m} + \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{j}}$\n", + "\n", + "From the chemical activity of , the activity coefficient, $\\gamma_{i}$,\n", + "can be defined as follows\n", + "\n", + "Eq. ‑\n", + "$\\gamma_{i} = \\frac{a_{i}}{x_{i}} = \\frac{1}{x_{i}}\\exp\\frac{G_{i} -_{\\ }^{0}G_{i}\\ }{RT}$\n", + "\n", + "The solution is an ideal solution with $\\gamma_{i} = 1$, and is said to\n", + "be positively or negatively deviating from an ideal solution with\n", + "$\\gamma_{i} > 1$ or $\\gamma_{i} < 1$, respectively. The chemical\n", + "potential is related to the activity and activity coefficient by the\n", + "following equation\n", + "\n", + "Eq. ‑\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} + RTlna_{i} =_{\\ }^{0}G_{i} + RTln\\gamma_{i}x_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} + RTln\\gamma_{i}$\n", + "\n", + "Let us further exam in more details in order to better understand the\n", + "relation between $G_{m}$ and $\\mu_{i}$. The partial derivatives in\n", + "represent the directions of molar Gibbs energy in the composition space,\n", + "i.e. the tangents of molar Gibbs energy with respect to mole fractions\n", + "of independent components. Collectively, they define the\n", + "multi-dimensional tangent plane of molar Gibbs energy at the given\n", + "composition, $x_{i}^{0}$. The mathematical representation of this\n", + "tangent plane, $z_{G_{m}}$, is defined by its directional derivatives\n", + "and the distance from the point where the derivatives are taken,\n", + "\n", + "Eq. ‑\n", + "$z_{G_{m}} = G_{m}\\left( x_{i}^{0} \\right) + \\sum_{i = 1}^{c}{\\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{i}^{0}}\\left( x_{i} - x_{i}^{0} \\right)}$\n", + "\n", + "The intercept of this tangent plane at each pure component axis, i.e.\n", + "$x_{i} = 1$ and $x_{j \\neq i} = 0$, is obtained as\n", + "\n", + "Eq. ‑\n", + "$z_{G_{m},x_{i} = 1} = G_{m}\\left( x_{i}^{0} \\right) + \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{i}^{\\ } = x_{i}^{0}} - \\sum_{j = 1}^{c}{x_{j}^{0}\\left( \\frac{\\partial G_{m}}{\\partial x_{j}} \\right)_{x_{i}^{\\ } = x_{i}^{0}}}$\n", + "\n", + "This is identical to at the point $x_{i}^{0}$. It is thus shown that the\n", + "chemical potential of a component in a solution is represented by the\n", + "intercept of the tangent plane of Gibbs energy of the solution on the\n", + "$G_{m}$ axis of the component. The distance between the intercept and\n", + "the Gibbs energy of the pure component in the same structure of the\n", + "solution is related to the chemical activity of the component as defined\n", + "by . On the other hand, it is evident that one can choose any other\n", + "structure of the pure element to define the chemical activity to compare\n", + "chemical potential of the component as shown by .\n", + "\n", + "The stability of a solution is evaluated following , and the derivatives\n", + "of chemical potential with respect to its moles, i.e. the elements in\n", + "the determinant, are obtained as follows from and ,\n", + "\n", + "Eq. ‑\n", + "$\\frac{N}{RT}\\frac{\\partial\\mu_{i}}{\\partial N_{i}} = \\frac{N}{RT}G_{ii} = \\frac{1 - x_{i}}{x_{i}} + \\frac{1}{\\gamma_{i}}\\left( \\frac{\\partial\\gamma_{i}}{\\partial x_{i}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial\\gamma_{i}}{\\partial x_{j}}} \\right)$\n", + "\n", + "Eq. ‑\n", + "$\\frac{N}{RT}\\frac{\\partial\\mu_{i}}{\\partial N_{k}} = \\frac{N}{RT}G_{ik} = - \\frac{x_{k}}{x_{i}} + \\frac{1}{\\gamma_{i}}\\left( 1 - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial\\gamma_{i}}{\\partial x_{j}}} \\right)$\n", + "\n", + "To further study Gibbs energy of solution phases, let us discuss the\n", + "details on the excess Gibbs energy of mixing. At this point, one can\n", + "start with lower-order systems with fewer components, i.e. two component\n", + "and three-component systems, noting that the Gibbs energy of phases with\n", + "one component is already presented in Chapter .\n" ], "text/plain": [ "" @@ -1484,156 +2746,282 @@ { "data": { "text/markdown": [ - "### Half cell potentials\n", - "\n", - "When electron current flows between electrodes, reactions are occurring\n", - "at the electrodes and concentration gradients causing polarization\n", - "develop around the electrodes. These gradients result in extraneous\n", - "potentials to occur at the electrodes. In such cases cell equilibrium is\n", - "not established and measured cell potentials are not those for true\n", - "partial equilibrium. If a cell is short-circuited with the electrodes\n", - "connected by a conductor, current will flow until the external potential\n", - "becomes zero, i.e. εext = 0, and equilibrium is established\n", - "with same conditions as non-electrochemical systems. If an external\n", - "potential, εext, is applied to the cell, chemical reactions\n", - "occur until the cell potential balances to εext, and no\n", - "current flows. This potential is called open-circuit voltage (OCV) in\n", - "the literature. It is important to realize that OCV includes all\n", - "reactions that occur on the electrode surface when the electrode is in\n", - "contact with the electrolyte, such as passivation discussed in Chapter .\n", - "Partial equilibrium in a cell is achieved when the cell potential is\n", - "balanced by an applied external potential. In such partial equilibrium\n", - "cases, equilibrium thermodynamic analyses can be used even though the\n", - "cell potential is not zero, i.e. εcell ≠ 0. This\n", - "differentiates electrochemical systems from other equilibrium systems\n", - "discussed previously.\n", - "\n", - "The number of electrons involved in a net cell reaction is important in\n", - "relating cell potential and the Gibbs energy change for the cell\n", - "reaction. As will be illustrated later in this section, this number\n", - "denotes the number of electrons involved in the half-cell reactions that\n", - "were added to yield the net cell reaction. The electrical work achieved\n", - "by the transport of an electrical charge through a cell potential can be\n", - "written as\n", - "\n", - "*Eq. 8‑20* $w = z\\ f\\ \\varepsilon$\n", - "\n", - "where *z* represents the moles of electrons in cell reaction, *f* the\n", - "Faraday constant equal to 96,485 J/V/mole-electron, and *ε* the\n", - "potential difference, often referred as electromotive force (emf) in the\n", - "literature. For a system at constant temperature, pressure, and\n", - "composition, this work is the same as the Gibbs energy difference\n", - "between the two electrodes, i.e.\n", - "\n", - "*Eq. 8‑21* $- \\Delta G = w = zf\\varepsilon$\n", - "\n", - "where the negative sign is because the system does work to the\n", - "surrounding when the Gibbs energy of the system is decreased. When the\n", - "applied external potential is larger than the cell potential, the\n", - "surrounding does work to the system, and a common example is the\n", - "charging of a battery. Thermodynamic relations discussed in previous\n", - "chapters can thus be directly applied to electrochemical systems with\n", - "some common equations shown in .\n", - "\n", - "Table ‑: Thermodynamic Equations for Electrochemical Cells\n", - "\n", - "*∆G = -z f ε*\n", - "\n", - "*∆S = - (∂∆G/∂T)P = + z f (∂ε/∂T)P*\n", - "\n", - "*∆H = \\[∂(∆G/T)/ ∂(1/T)\\]P = - z f \\[∂(ε/T)/∂(1/T)\\]P = z f \\[T(∂ε/∂T)P\n", - "– ε\\]*\n", - "\n", - "*∆CP = (∂∆H/∂T)P = T z f (∂2ε/∂T2)P*\n", - "\n", - "A half-cell reaction potential cannot be measured directly, only its\n", - "potential relative to another half-cell reaction. By convention, a\n", - "standard half-cell potential is measured relative to the standard\n", - "hydrogen half-cell reduction reaction at 25oC (298K) and 1\n", - "bar, which has a defined standard potential of zero volts,\n", - "\n", - "*Eq. 8‑22* H+(aq, a=1) + e- = 1/2 H2(g,\n", - "1 bar)\n", - "\n", - "with εo (H+/H2,g) = 0.00 volts. The\n", - "standard half-cell reduction reactions of metals at 25oC are\n", - "for the general reaction\n", - "\n", - "*Eq. 8‑23* Mz+(aq, a=1) + z e- = M(s)\n", - "\n", - "with εo (Mz+/M) volts. Half-cell reactions with\n", - "the most positive standard electrode potentials have a tendency to\n", - "spontaneously proceed toward reduction (cathode reactions). Half-cell\n", - "reactions with the most negative standard electrode potentials have a\n", - "tendency to spontaneously proceed toward oxidation (anode reactions).\n", - "\n", - "Consider, for example, a cell made up of a standard hydrogen electrode\n", - "and a standard zinc electrode with εo\n", - "(H+/H2,g) = 0.00 volts and εo\n", - "(Zn2+/Zn) = -0.762 volts. Thus, the H+ would tend\n", - "to be reduced, and the zinc metal would tend to be oxidized, and the\n", - "spontaneous reaction if all species had unit activities would be\n", - "\n", - "*Eq. 8‑24* 2 H+(aq, a=1)+ Zn = H2(1 bar) +\n", - "Zn2+(aq, a=1)\n", - "\n", - "with εocell = 0.762 volts and\n", - "$\\mathrm{\\Delta}_{\\ }^{0}G = - 2*96485*\\varepsilon_{cell}^{0}\\ $. The\n", - "cathode half-cell reaction would be the same as , while the anode\n", - "half-cell reaction would be\n", - "\n", - "*Eq. 8‑25* Zn = Zn2+(aq, a=1) + 2 e-\n", - "\n", - "When ion concentrations and H2 gas do not all have unit\n", - "activities, the Gibbs energy and cell potential of the cell reaction, ,\n", - "becomes\n", + "### Binary random solutions\n", + "\n", + "From , the Gibbs-Duhem equation of a binary system consisting of\n", + "components $A$ and $B$ is written as\n", + "\n", + "Eq. ‑ $0 = - SdT - Vd( - P) - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "This equation represents a four-dimensional surface. It is self-evident\n", + "that both and hold for stable binary solutions too, i.e. the directions\n", + "and the curvature of the surface are all negative. To visualize the\n", + "four-dimensional surface in the three-dimensional space, one needs to\n", + "fix one of the four potentials. As $T$ and $P$ are the natural variables\n", + "of Gibbs energy, they are usually chosen to be kept constant. One can\n", + "typically investigate behaviors of systems consisting of condensed\n", + "phases by varying the temperature at constant pressure. at constant\n", + "pressure thus becomes\n", + "\n", + "Eq. ‑ $0 = - SdT - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "Similar to and , the property of a phase can be represented by a\n", + "two-dimensional surface in the three-dimensional space composed of $T$,\n", + "$\\mu_{A}$, and $\\mu_{B}$ under constant $P$, keeping in mind the\n", + "following\n", "\n", - "*Eq. 8‑26*\n", - "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{a_{{Zn}^{2 +}}P_{H_{2}}}{\\left( a_{H^{+}} \\right)^{2}}$\n", + "Eq. ‑\n", + "$G_{m} = x_{A}\\mu_{A} + x_{B}\\mu_{B} = x_{A}_{\\ }^{0}G_{A} + x_{B}_{\\ }^{0}G_{B} + RT\\left( x_{A}l{nx}_{A} + x_{B}l{nx}_{B} \\right) +_{\\ }^{E}G_{m}$\n", "\n", - "*Eq. 8‑27*\n", - "$\\varepsilon_{cell} = \\varepsilon_{cell}^{0} - \\frac{RT}{zf}\\ln\\frac{a_{{Zn}^{2 +}}P_{H_{2}}}{\\left( a_{H^{+}} \\right)^{2}}$\n", + "Since $_{\\ }^{E}G_{m}$ must be zero for pure components $A$ and $B$, it\n", + "needs to be in the following form\n", "\n", - "The standard reduction potentials of some common metals at\n", - "25oC are given in .\n", + "Eq. ‑ $_{\\ }^{E}G_{m} = x_{A}x_{B}L_{AB}$\n", "\n", - "Table ‑: Standard reduction potentials of some common metals\n", + "with $L_{AB}$ being a parameter denoting the interaction between\n", + "components $A$ and $B$, called interaction parameter. When $L_{AB} = 0$,\n", + "the solution is an ideal solution. When $L_{AB}$ is a non-zero constant\n", + "independent of temperature and composition, the solution is called a\n", + "regular solution. Its excess entropy and excess enthalpy of mixing are\n", + "obtained as\n", "\n", - "A cell reaction can be established by different half-cell reactions. For\n", - "example, the following reaction can be derived from two different cells\n", + "Eq. ‑ $_{\\ }^{E}S_{m} = \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial T} = 0$\n", "\n", - "*Eq. 8‑28* $3\\ {Fe}^{2 + \\ }\\ = \\ \\ 2\\ {Fe}^{3 +}\\ \\ + \\ \\ Fe(s)$\n", + "Eq. ‑\n", + "$_{\\ }^{E}H_{m} =_{\\ }^{E}G_{m} - T_{\\ }^{E}S_{m} = x_{A}x_{B}L_{AB}$\n", "\n", - "cell A\n", + "The chemical potential of component $A$ or $B$ in a binary regular\n", + "solution can be derived as\n", "\n", - "*Eq. 8‑29* $3{Fe}^{2 +} + \\ 6\\ e - \\ = \\ \\ 3Fe(s)$ εo1 =\n", - "-0.440 V\n", + "Eq. ‑\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} + \\left( 1 - x_{i} \\right)^{2}L_{AB}$\n", "\n", - "*Eq. 8‑30* $2\\ Fe(s)\\ \\ = \\ \\ 2\\ {Fe}^{3 +}\\ \\ + \\ 6\\ e -$\n", - "εo2 = +0.036 V\n", + "In a dilute solution with $x_{i} \\rightarrow 0$, one can have\n", "\n", - "cell B\n", + "Eq. ‑\n", + "$RTln\\gamma_{i} = \\left( 1 - x_{i} \\right)^{2}L_{AB} \\approx L_{AB}$\n", "\n", - "*Eq. 8‑31* $2{Fe}^{2 +}\\ = \\ 2{Fe}^{3 + \\ \\ } + 2\\ e^{-}$\n", - "*εo4 = -0.772 V*\n", + "Eq. ‑ $\\gamma_{i} = e^{\\frac{L_{AB}}{RT}}$\n", "\n", - "*Eq. 8‑32* ${Fe}^{2 + \\ }\\ + \\ 2\\ e - \\ \\ = \\ \\ Fe(s)$ *εo5\n", - "= -0.440 V*\n", + "The activity is thus proportional to its mole fraction, which is called\n", + "Henry’s law. By the same token, for the solvent, i.e.\n", + "$x_{i} \\rightarrow 1$,\n", "\n", - "Both give the same net reaction shown by , but with 6 and 2 electrons\n", - "and standard cell potentials being εocell A = -0.404 V and\n", - "εocell B = -1.212 V, respectively. However, the standard\n", - "Gibbs energies of both cells are the same, i.e.\n", + "Eq. ‑ $RTln\\gamma_{i} = \\left( 1 - x_{i} \\right)^{2}L_{AB} \\approx 0$\n", "\n", - "*Eq. 8‑33* $\\mathrm{\\Delta}_{\\ }^{0}G$*cell A = -6 f (-0.404)\n", - "= + 2.424 f*\n", + "which gives $\\gamma_{i} \\approx 1$, and its activity approaches its mole\n", + "fraction. This is called Raoult’s law.\n", "\n", - "*Eq. 8‑34* $\\mathrm{\\Delta}_{\\ }^{0}G$*cell B = -2 f (-1.212)\n", - "= + 2.424 f*\n", + "The stability of a binary solution is derived from as\n", "\n", - "It is shown that $\\mathrm{\\Delta}_{\\ }^{0}G$ values are independent of\n", - "half-cell reactions and depend only on the net reaction because the net\n", - "reaction is neutral in electron and balanced in mass.\n" + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B}} = \\left\\lbrack \\frac{RT}{x_{A}} - 2\\left( 1 - x_{A} \\right)L_{AB} \\right\\rbrack\\frac{1 - x_{A}}{N}$\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{B}}{\\partial N_{B}} \\right)_{T,P,N_{A}} = \\left\\lbrack \\frac{RT}{x_{B}} - 2\\left( 1 - x_{B} \\right)L_{AB} \\right\\rbrack\\frac{1 - x_{B}}{N}$\n", + "\n", + "It should be noted that the two chemical potentials in a binary system\n", + "at constant temperature and pressure are dependent on each other due to\n", + "the Gibbs-Duhem equation shown in , i.e.\n", + "\n", + "Eq. ‑ $0 = - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "and the two chemical potentials depend on each other by the following\n", + "relation\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial\\mu_{B}} \\right)_{T,P} = - \\frac{N_{B}}{N_{A}}$\n", + "\n", + "Therefore, at the limit of stability, both and go to zero at the same\n", + "time, which is obtained when\n", + "\n", + "Eq. ‑ $RT = 2{x_{A}x_{B}L}_{AB}$\n", + "\n", + "As the absolute temperature cannot be negative, has no solution for a\n", + "solution phase with $L_{AB} < 0$, i.e. the solution phase is stable with\n", + "respect to the composition fluctuation. For a solution with\n", + "$L_{AB} > 0$, its limit of stability is represented .\n", + "\n", + "A schematic molar Gibbs energy of a solution with $L_{AB} < 0$ at\n", + "constant temperature and pressure is shown in along with the ideal and\n", + "excess Gibbs energy of mixing. A tangent line on the molar Gibbs energy\n", + "of the solution is drawn, and its two intercepts at $x_{B} = 0$ and\n", + "$x_{B} = 1$ give the chemical potentials of components $A$ and $B$,\n", + "$\\mu_{A}$ and $\\mu_{B}$ by , respectively. It is evident that $\\mu_{A}$\n", + "and $\\mu_{B}$ are not independent on each other as they are two points\n", + "on the same straight line. This is a graphic representation of the\n", + "Gibbs-Duhem equation of . The chemical activity of component $B$ is also\n", + "depicted with the reference state being the pure B with the same\n", + "structure. As shown in , other structures of pure B can be selected as\n", + "the reference states of the chemical activity of component B, resulting\n", + "in the different distances to its chemical potential in the solution,\n", + "thus different values of its chemical activities. It is clear that this\n", + "change of reference state for chemical activity does not affect the\n", + "chemical potential of the component in the solution.\n", + "\n", + "Figure ‑: Schematic molar Gibbs energy diagram with $L_{AB} < 0$\n", + "\n", + "When $L_{AB} > 0$, represents a parabola in the $T - x_{i}$\n", + "two-dimensional coordinate, symmetric with respect to $x_{A}$ and\n", + "$x_{B}$, shown in , i.e. the spinodal of the solution. The consolute\n", + "point is obtained by applying to and letting equal to zero at the\n", + "consolute point\n", + "\n", + "Eq. ‑\n", + "$\\left( \\frac{\\partial^{2}\\mu_{A}}{\\partial N_{A}^{2}} \\right)_{T,P,N_{B}} = \\left\\lbrack - \\frac{RT}{x_{A}^{2}} + 2L_{AB} \\right\\rbrack\\left( \\frac{1 - x_{A}}{N} \\right)^{2} = 0$\n", + "\n", + "which gives\n", + "\n", + "Eq. ‑ $T_{cons} = 2x_{A}^{2}L_{AB}$\n", + "\n", + "Solving and , one obtains $x_{A} = x_{B} = 0.5$ and\n", + "\n", + "Eq. ‑ $T_{cons} = \\frac{L_{AB}}{2R}$\n", + "\n", + "Figure ‑: A Spinodal curve with $L_{AB} > 0$\n", + "\n", + "A schematic molar Gibbs energy diagram at temperatures below the\n", + "consolute point is shown in . It can be seen that part of the molar\n", + "Gibbs energy has negative curvature, and the solution becomes unstable.\n", + "The chemical potential thus does not change monotonically with respect\n", + "to composition and its derivative changes sign at the inflexion point.\n", + "\n", + "Figure ‑: Schematic molar Gibbs energy diagram with $L_{AB} > 0$\n", + "\n", + "For more complex solutions, $L_{AB}$ can be a function of temperature,\n", + "pressure, and compositions. In principle, the temperature and pressure\n", + "dependences can be treated by means of formula similar to . There are\n", + "various approaches in the literature to consider the composition\n", + "dependence of $L_{AB}$. The empirical Redlich-Kister polynomial stands\n", + "out as the one most widely used because it can be extrapolated to\n", + "ternary and multi-component systems consistently, which will be\n", + "discussed in Chapter .\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "### Ternary random solutions\n", + "\n", + "From , the Gibbs-Duhem equation of a ternary system consisting of\n", + "components $A$, $B$ and $C$ is written as\n", + "\n", + "Eq. ‑\n", + "$0 = - SdT - Vd( - P) - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B} - {N_{C}d\\mu}_{C}$\n", + "\n", + "This equation represents a five-dimensional surface. It can be\n", + "visualized in a three-dimensional space with two of the five potentials\n", + "fixed. Usually $T$ and $P$ are kept constant as they are the natural\n", + "variables of $G$, and reduces to\n", + "\n", + "Eq. ‑ $0 = - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B} - {N_{C}d\\mu}_{C}$\n", + "\n", + "A phase can thus be represented by a surface in the three-dimensional\n", + "space of $\\mu_{A}$, $\\mu_{B}$, and $\\mu_{C}$ at constant $T$ and $P$\n", + "with similar geometric appearance as .\n", + "\n", + "From , Gibbs energy of a ternary solution is written as\n", + "\n", + "Eq. ‑\n", + "$G_{m} = x_{A}_{\\ }^{0}G_{A} + x_{B}_{\\ }^{0}G_{B} + x_{C}_{\\ }^{0}G_{C} + RT\\left( x_{A}l{nx}_{A} + x_{B}l{nx}_{B} + x_{C}l{nx}_{C} \\right) +_{\\ }^{E}G_{m}$\n", + "\n", + "When the mole fraction of one component approaches zero,\n", + "$_{\\ }^{E}G_{m}$ reduces to the excess Gibbs energy of mixing of the\n", + "binary systems of the remaining two components, represented by .\n", + "However, for a given composition of a ternary solution, there is no\n", + "unique way to assign the contributions from $_{\\ }^{E}G_{m}$ of each\n", + "binary to $_{\\ }^{E}G_{m}$ of the ternary solution because\n", + "$_{\\ }^{E}G_{m}$ of the ternary solution contains information of both\n", + "binary and ternary interactions. A variety of models is available in the\n", + "literature (see \\[1\\]). One intuitive approach would be to use the same\n", + "formula as that in the binary system, i.e. , with the mole fractions\n", + "substituted by the values in the ternary system, and $_{\\ }^{E}G_{m}$ of\n", + "a ternary solution may thus be defined as the following by including the\n", + "ternary interaction involving all three components,\n", + "\n", + "Eq. ‑\n", + "$_{\\ }^{E}G_{m} = x_{A}x_{B}L_{AB} + x_{A}x_{C}L_{AC} + x_{B}x_{C}L_{BC} + x_{A}x_{B}x_{C}L_{ABC}$\n", + "\n", + "The chemical potential of a component is represented by . When all\n", + "interaction parameters in are constant, i.e. a ternary regular solution,\n", + "the chemical potential of component $A$ can be derived as\n", + "\n", + "Eq. ‑\n", + "$\\mu_{A} = G_{A} =_{\\ }^{0}G_{A} + RTlnx_{A} + x_{B}L_{AB} + x_{C}L_{AC} -_{\\ }^{E}G_{m} =_{\\ }^{0}G_{A} + RTlnx_{A} + x_{B}{\\left( 1 - x_{A} \\right)L}_{AB} + x_{C}\\left( 1 - x_{A} \\right)L_{AC} - x_{B}x_{C}L_{BC} + x_{B}x_{C}\\left( 1 - 2x_{A} \\right)L_{ABC} =_{\\ }^{0}G_{A} + RTlnx_{B} + x_{B}^{2}L_{AB} + x_{C}^{2}L_{AC} + x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) + x_{B}x_{C}\\left( 1 - 2x_{A} \\right)L_{ABC}$\n", + "\n", + "Similar equations can be derived for component $B$ and C with\n", + "$L_{AB} = L_{BA}$, $L_{AC} = L_{CA}$, and $L_{BC} = L_{CB}$. A schematic\n", + "molar Gibbs energy diagram at constant temperature and pressure is shown\n", + "in with all three binary systems having $L_{ij} < 0$ of similar values.\n", + "\n", + "Figure ‑: Schematic ternary molar Gibbs energy diagram as a function of\n", + "compositions for given temperature and pressure\n", + "\n", + "To evaluate the stability of a ternary solution, one needs to calculate\n", + "the elements in the determinant shown in . Using the mole of component\n", + "$C$ as the independent molar quantity, the limit of stability is\n", + "expresses as\n", + "\n", + "Eq. ‑ $G_{AA}G_{BB} - G_{AB}G_{BA} = 0$\n", + "\n", + "As an example, $G_{AA}$ is shown in the following equation, which must\n", + "be positive for the solution to be stable\n", + "\n", + "Eq. ‑\n", + "${N\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)}_{T,P,N_{B},N_{C}} = NG_{AA} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}} - 2x_{B}^{2}L_{AB} - 2x_{C}^{2}L_{AC} - 2x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) - 2x_{B}x_{C}\\left( 2 - 3x_{A} \\right)L_{ABC}$\n", + "\n", + "It is evident that any instability in binary systems with positive\n", + "interaction parameters extends into the ternary system. It can also be\n", + "seen that even if all binary interaction parameters are negative, i.e.\n", + "no instability in the binary systems, it is possible that becomes\n", + "negative for some combinations of the binary interaction parameters such\n", + "that $\\mathrm{\\Delta}L = L_{AB} + L_{AC} - L_{BC}$ becomes very positive\n", + "and overshadows the contributions due to $L_{AB}$ and $L_{AC}$, i.e.\n", + "$L_{BC}$ is more negative than $L_{AB}$ and $L_{AC}$ combined. In an\n", + "extreme case with $L_{AB} = L_{AC} = L_{ABC} = 0$ and $L_{BC} < 0$, i.e.\n", + "ideal solutions for the $A - B$ and $A - C$ binary systems, stable\n", + "solution in the $B - C$ binary system, and no additional ternary\n", + "interaction, reduces to\n", + "\n", + "Eq. ‑\n", + "$N\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B},N_{C}} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}} + 2x_{B}x_{C}L_{BC}$\n", + "\n", + "Setting\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B},N_{C}} = 0$,\n", + "one obtains\n", + "\n", + "Eq. ‑\n", + "$- \\frac{RT}{2L_{BC}} = \\frac{x_{A}x_{B}x_{C}}{1 - x_{A}} = \\frac{{\\left( 1 - x_{B} - x_{C} \\right)x}_{B}x_{C}}{x_{B} + x_{C}}$\n", + "\n", + "With $- \\frac{RT}{2L_{BC}}$ being positive due to $L_{BC} < 0$, there is\n", + "a parabola-shaped composition area in which the solution is unstable at\n", + "constant temperature and pressure. This is reasonable because the system\n", + "tends to maximize the number of B-C bonds due to its lower energy, which\n", + "competes with the entropy of mixing among the three elements and results\n", + "in segregation of B-C bonds, thus miscibility gap at low temperatures.\n", + "\n", + "To evaluate the ternary consolute point, the second derivatives for\n", + "component A and B are obtained as\n", + "\n", + "Eq. ‑\n", + "${N\\left( \\frac{\\partial_{\\ }^{2}\\mu_{A}}{\\partial N_{A}^{2}} \\right)}_{T,P,N_{B},N_{C}} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}^{2}} + 4x_{B}^{2}L_{AB} + 4x_{C}^{2}L_{AC} + 4x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) + 2x_{B}x_{C}\\left( 7 - 9x_{A} \\right)L_{ABC} = 0$\n", + "\n", + "Eq. ‑\n", + "${N\\left( \\frac{\\partial_{\\ }^{2}\\mu_{B}}{\\partial N_{B}^{2}} \\right)}_{T,P,N_{A},N_{C}} = \\frac{RT\\left( 1 - x_{B} \\right)}{x_{B}^{2}} + 4x_{A}^{2}L_{AB} + 4x_{C}^{2}L_{BC} + 4x_{A}x_{C}\\left( L_{AB} + L_{BC} - L_{AC} \\right) + 2x_{A}x_{C}\\left( 7 - 9x_{B} \\right)L_{ABC} = 0$\n", + "\n", + "The consolute point can then be obtained using , and .\n", + "\n", + "It is observed in that $\\left( 1 - 2x_{A} \\right)L_{ABC} = 0$ at\n", + "$x_{A} = 0.5$, i.e. the ternary interaction parameter does not\n", + "contribute to the chemical potential of $A$. It is also observed in that\n", + "the contribution from the ternary interaction parameter changes sign at\n", + "$x_{i} = 2/3$ due to $\\left( 2 - 3x_{A} \\right)L_{ABC} = 0$.\n" ], "text/plain": [ "" @@ -1644,15 +3032,13 @@ } ], "source": [ - " if INTERACTIVE:\n", - " md = await get_organized_markdown()\n", - " display(*md[md.str.contains(\"\\$\")].iloc[:10].apply(Markdown))" + " INTERACTIVE and display(*documents.md[documents.md.str.contains(\"\\$\")].iloc[:10].apply(Markdown))" ] }, { "cell_type": "code", "execution_count": null, - "id": "28541e2b-2e80-4ae3-b148-784cafdaa641", + "id": "d3046373-4dc9-4214-ab7d-169ce2317917", "metadata": {}, "outputs": [], "source": [] diff --git a/src/nobook/mime.types b/src/nobook/mime.types new file mode 100644 index 0000000..76ac134 --- /dev/null +++ b/src/nobook/mime.types @@ -0,0 +1,6 @@ +application/x-ipynb+json ipynb +text/markdown md markdown +text/toml toml +application/x-yaml yaml yml +text/ini ini cfg +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx \ No newline at end of file diff --git a/src/nobook/utils.py b/src/nobook/utils.py new file mode 100644 index 0000000..57429c7 --- /dev/null +++ b/src/nobook/utils.py @@ -0,0 +1,582 @@ +"""reusable pandas and jinja components for dacs""" + +import asyncio +from configparser import ConfigParser +import enum +from functools import lru_cache, partial, partialmethod, singledispatch +from mimetypes import MimeTypes +from operator import attrgetter +from re import S +from textwrap import dedent, indent +from typing import AsyncGenerator, AsyncIterable, AsyncIterator, Coroutine +from numpy import isin, nan +from pandas import DataFrame, Index, MultiIndex, Series +import pandas +import anyio +import jinja2.ext +from pathlib import Path +from enum import auto, IntFlag + +import slugify + +HERE = Path(__file__).parent +TEMPLATES = HERE / "templates" + +MIME = MimeTypes((HERE / "mime.types",)) + + +class Kind(IntFlag): + INDEX, SERIES, DATAFRAME = auto(), auto(), auto() + + +INDEX, SERIES, FRAME = Kind.INDEX, Kind.SERIES, Kind.DATAFRAME + + +@singledispatch +def apply(x, f, *args, **kwargs): + """a generalized, async-aware apply method for pandas collections""" + return apply_index(Index(x), f, *args, **kwargs) + + +@apply.register(Index) +def apply_index(x, f, *args, **kwargs): + return apply_series(x.to_series(), f, *args, **kwargs) + + +@apply.register(Series) +def apply_series(x, f, *args, _name=None, **kwargs): + if _name is None: + _name = getattr(f, "__name__", None) + return x.apply(f, args=args, **kwargs).rename(_name).pipe(_sync_or_async) + + +@apply.register(DataFrame) +def apply_frame(x, f, *args, **kwargs): + return x.apply(f, args=args, axis=1, **kwargs).pipe(_sync_or_async) + + +@apply.register(pandas.core.groupby.DataFrameGroupBy) +def apply_group(x, f, *args, **kwargs): + return Series(dict((k, f(y, *args, **kwargs)) for k, y in x)).pipe(_sync_or_async) + + +async def _asyncgen(x): + return [x async for x in x] + + +async def _update(s): + from asyncio import gather + + if not len(s): + return () + if isinstance(s[0], (AsyncGenerator, AsyncIterable, AsyncIterator)): + s = s.apply(_asyncgen) + if isinstance(s[0], Coroutine): + y = await gather(*s) + if isinstance(s, Series): + s.update(Series(y, s.index)) + elif isinstance(s, DataFrame): + s = s.combine_first(pandas.DataFrame(y, s.index)) + return s + + +def _sync_or_async(s): + return _update(s) if _isasync(s) else s + + +def _isasync(x): + if len(x): + return isinstance( + x.iloc[0], (AsyncGenerator, AsyncIterable, AsyncIterator, Coroutine) + ) + return False + + +class Accessor: + """a base class for accessor extensions""" + + def __init__(self, object): + self.object = object + + def __init_subclass__(cls, method=None, types=INDEX | SERIES | FRAME, name=None): + cls.method = method + + for t in (INDEX, SERIES, FRAME): + if t in types: + getattr(pandas.api.extensions, f"register_{t.name.lower()}_accessor")( + name or cls.__name__.lower() + )(cls) + + def apply(self, f, *args, **kwargs): + return apply(self.object, f, *args, **kwargs) + + ACC_METHODS = {Index: "index", Series: "series", DataFrame: "dataframe"} + + +class Method(Accessor): + """the method accessor base class places ALL the public methods and of the `method` provided.""" + + def __init_subclass__(cls, method=None, types=INDEX | SERIES | FRAME, name=None): + super().__init_subclass__(method=method, types=types, name=name) + cls._register_methods(method) + + @classmethod + def _register_methods(cls, method, properties=True, methods=True): + for k in dir(method): + if hasattr(cls, k): + continue # break when the attribute exists + v = getattr(method, k) + if methods and callable(v) and not isinstance(v, classmethod): + cls._register_method(k, v) + elif properties and isinstance(v, property): + cls._register_property(k, v) + + @classmethod + def _register_method(cls, k, v): + setattr(cls, k, partialmethod(cls.apply, v)) + + @classmethod + def _register_property(cls, k, v): + setattr(cls, k, property(lambda x: x.apply(attrgetter(k)))) + + +class _attrgetter(Accessor, types=INDEX | SERIES, name="attrgetter"): + def __call__(self, *args, **kwargs): + return apply(self.object, attrgetter(*args, **kwargs)) + + +class _methodcaller(Accessor, types=INDEX | SERIES, name="methodcaller"): + def __call__(self, *args, **kwargs): + from operator import methodcaller + + return apply(self.object, methodcaller(*args, **kwargs)) + + +class _itemgetter(Accessor, types=INDEX | SERIES, name="itemgetter"): + def __call__(self, *args, **kwargs): + from operator import itemgetter + + return apply(self.object, itemgetter(*args, **kwargs)) + + +class explode_index(Accessor, types=SERIES, name="explode_index"): + def __call__(self, *args, **kwargs): + if isinstance(self.object, pandas.Series): + return pandas.concat({k: pandas.Series(v) for k, v in self.object.items()}) + elif isin(self.object, pandas.DataFrame): + return + raise NotImplemented() + + +class _aseries(Accessor, types=SERIES, name="aseries"): + def __call__(self, *args, **kwargs): + return self.object.apply(pandas.Series, *args, **kwargs) + + +class _gather(Accessor, types=SERIES, name="gather"): + async def __call__(self, *args, **kwargs): + return pandas.Series( + await asyncio.gather(*self.object), self.object.index, *args, **kwargs + ) + + +async def run(command, **kwargs): + import anyio + + result = await anyio.run_process(command, **kwargs) + return pandas.Series([result.stdout, result.stderr], ["stdout", "stderr"]) + + +class Shell(Accessor, types=INDEX | SERIES, name="sh"): + async def run(self, **kwargs): + return (await self.apply(run, **kwargs)).apply(pandas.Series) + + +class Bytes(Method, types=INDEX | SERIES, method=bytes): + pass + + +def get_mimetype(object, mime=MIME): + """infer the mime type of our object""" + if isinstance(object, str): + if object.startswith("."): + object = "x" + object + return mime.guess_type(object)[0] + + +@lru_cache +def get_markdown(): + import midgy.tangle + + md = midgy.tangle.Tangle().parser + md.options.update(highlight=highlight) + return md + + +def markdown(md, **kwargs): + return get_markdown().render(md, **kwargs) + + +def markdown_parse(md, **kwargs): + return get_markdown().render(md, **kwargs) + + +def highlight(code, lang="python", attrs=None): + import pygments, html + + try: + return pygments.highlight( + code, + pygments.lexers.get_lexer_by_name(lang or "python"), + pygments.formatters.get_formatter_by_name( + "html", debug_token_types=True, title=f"{lang} code" + ), + ) + except: + return f"""
{html.escape(code)}
""" + + +HERE = Path(__file__).parent +TEMPLATES = HERE / "templates" + + +@lru_cache +def get_environment(): + import jinja2, builtins + from html import escape + from slugify import slugify + + env = jinja2.Environment( + enable_async=True, + loader=jinja2.ChoiceLoader( + [jinja2.FileSystemLoader(TEMPLATES), jinja2.DictLoader({})] + ), + extensions=["jinja2.ext.loopcontrols", "jinja2.ext.with_", "jinja2.ext.do"], + ) + env.globals.update(vars(builtins), markdown=get_markdown().render) + env.filters.update( + markdown=get_markdown().render, + highlight=highlight, + escape=escape, + slug=slugify, + dedent=dedent, + indent=indent, + ) + return env + + +class _Jinja2(Accessor, types=SERIES | FRAME | INDEX, name="template"): + template_name = None # need a default template + + def __init__(self, object): + super().__init__(object) + self.environment = get_environment() + + def render_one(self, row, template=None, **kwargs): + if not isinstance(template, jinja2.Template): + template = self.environment.get_template( + template or row.get("template_name") + ) + data = row.to_dict() + data.update(kwargs) + + data.update(row=row) + if self.environment.is_async: + return template.render_async(row=row, **{**kwargs, **row.to_dict()}) + return template.render(row=row, **{**kwargs, **row.to_dict()}) + + def render_template(self, template=None, **kwargs): + object = self.object + if isinstance(object, MultiIndex): + object = object.to_frame() + elif isinstance(object, Index): + object = object.to_series() + object = object.replace({nan: None}) + if isinstance(object, Series): + object = object.to_frame() + else: + try: + object = object.reset_index().set_index(object.index) + except ValueError: + pass # dont reset on duplicate names + return apply_frame(object, self.render_one, template=template, **kwargs) + + def render_string(self, template, **kwargs): + return self.render_template(self.environment.from_string(template), **kwargs) + + +async def get__file_index( + path=None, include="", exclude=None, recursive=False +) -> pandas.DataFrame: + if not isinstance(recursive, bool): + recursive -= 1 + return [ + path + async for path in get__file_index_iter( + anyio.Path(path), include, exclude, recursive + ) + ] + + +async def get__file_index_iter( + path=None, include=[".ipynb", ".py", ".md"], exclude=None, recursive=False +) -> AsyncGenerator[anyio.Path, None]: + if isinstance(exclude, str): + import pathspec + + exclude = pathspec.PathSpec.from_lines( + pathspec.patterns.GitWildMatchPattern, exclude.splitlines() + ) + if await path.is_dir(): + async for path in path.iterdir(): + if await path.is_file(): + if path.suffix in include: + if (not exclude) or not exclude.match_file(path): + yield path + elif recursive: + async for path in get__file_index_iter( + path, include, exclude, recursive + ): + yield path + + +def get_mimetype(object): + if isinstance(object, str): + if object.startswith("."): + object = "xxxxx" + object + return MIME.guess_type(object)[0] + + +def loads(x, mime=None): + try: + f = LOADERS[mime] + except KeyError: + return x + return f(x) + + +LOADERS = dict() + + +@partial(setattr, loads, "register") +def loads_register(mime, callable=None): + if callable is None: + return partial(loads.register, mime) + LOADERS[mime] = callable + return callable + + +@loads.register("text/toml") +def loads_toml(x): + return __import__("tomli").loads(x.read_text()) + + +@loads.register("application/x-ipynb+json") +@loads.register("application/json") +def loads_json(x): + data = __import__("json").loads(x.read_text()) + for i, x in enumerate(data["cells"]): + x.update(source="".join(x["source"]), count=i) + return data + + +@loads.register("application/x-yaml") +def loads_yaml(x): + try: + return __import__("ruamel.yaml").yaml.safe_load(x.read_text()) + except ModuleNotFoundError: + return __import__("yaml").safe_load(x.read_text()) + + +@loads.register("text/ini") +def loads_ini(x): + parser = ConfigParser() + parser.read_string(x.read_text()) + return parser._sections + + +@loads.register( + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" +) +def loads_docx(x): + import docx + + return docx.Document(x) + + +def get_cell(x, cell_type="markdown", **kwargs): + return dict(cell_type=cell_type, source=x) + + +@singledispatch +def get_notebook(x, **kwargs): + return get_cell(x, kwargs.pop("cell_type", "raw"), **kwargs) + + +@get_notebook.register +def get_notebook_dict(x: dict, **kwargs): + if "cells" in x and "metadata" in x: + return x + return dict(metadata=x) + + +@get_notebook.register +def get_notebook_str(x: str, cell_type="markdown", **kwargs): + return dict(cells=[get_cell(x, cell_type, **kwargs)]) + + +def get_parent_glob(path, pattern): + path = path.absolute() + while path.parent is not path: + x = list(path.glob(pattern)) + if x: + return x + path = path.parent + + +class Path(type(Path())): + def load(self): + return loads(self.read_text(), Path.mime(self)) + + def notebook(self, **kwargs): + return get_notebook(Path.load(self), **kwargs) + + def mime(self): + return get_mimetype(self) + + iglob = get_parent_glob + + +async def aget_parent_glob(path, pattern): + path = await path.absolute() + paths = list() + while path.parent is not path: + async for x in path.glob(pattern): + paths.append(x) + if paths: + return paths + path = path.parent + return [] + + +class APath(anyio.Path): + async def load(self): + return loads(await self.read_text(), APath.mime(self)) + + async def notebook(self, **kwargs): + return get_notebook(await APath.load(self), **kwargs) + + def mime(self): + return get_mimetype(self) + + iglob = aget_parent_glob + + +class _Path(Method, method=Path, types=INDEX | SERIES, name="path"): + def __call__(self, *args, **kwargs): + if isinstance(self.object, Index): + return self.object.map(self.method) + return self.object.apply(self.method) + + def find(self, *args, **kwargs): + x = self.apply(get__file_index, *args, **kwargs) + return x.explode().pipe(pandas.Index, name="path") + + def glob(self, *patterns, method="glob"): + return pandas.concat( + self.apply(getattr(self.method, method), x).apply(list) for x in patterns + ).explode() + + rglob = partialmethod(glob, method="rglob") + iglob = partialmethod(glob, method="iglob") + + async def notebook(self, **kwargs): + return self.apply(self.method.notebook).apply(pandas.Series) + + +class _APath(Method, method=APath, types=INDEX | SERIES, name="apath"): + def __call__(self, *args, **kwargs): + if isinstance(self.object, Index): + return self.object.map(self.method) + return self.object.apply(self.method) + + async def find(self, *args, **kwargs): + x = await self.apply(get__file_index, *args, **kwargs) + return x.explode().pipe(pandas.Index, name="path") + + async def glob(self, *patterns, method="glob"): + return pandas.concat( + await asyncio.gather( + *(self.apply(getattr(self.method, method), x) for x in patterns) + ) + ).explode() + + rglob = partialmethod(glob, method="rglob") + iglob = partialmethod(glob, method="iglob") + + async def notebook(self, **kwargs): + return (await self.apply(self.method.notebook)).apply(pandas.Series) + + +@singledispatch +def get_soup(x, *args, **kwargs): + return x + + +@get_soup.register(str) +def get_soup_str(x, *args, **kwargs): + import bs4 + + kwargs.setdefault("features", "html.parser") + return bs4.BeautifulSoup(x, *args, **kwargs) + + +class _html(Accessor, types=SERIES | INDEX, name="html"): + import bs4 + from html import escape + + escape = partialmethod(Method.apply, escape) + soup = partialmethod(Method.apply, get_soup) + select_one = partialmethod(Method.apply, bs4.BeautifulSoup.select_one) + + def select(self, *args, **kwargs): + import bs4 + + return ( + self.object.html.soup().method.apply( + bs4.BeautifulSoup.select, *args, **kwargs + ) + ).explode() + + def select_one(self, *args, **kwargs): + import bs4 + + return self.object.html.soup().method.apply( + bs4.BeautifulSoup.select_one, *args, **kwargs + ) + + +class _git(Accessor, types=SERIES | INDEX, name="git"): + async def authors(self): + return ( + ( + await ( + await self.object.rename("path").template.render_string( + "cd {{path.parent}} && git log --format='%an<%ae>' -- {{path.name}} | sort | uniq" + ) + ).sh.run() + ) + .stdout.bytes.decode() + .apply(str.splitlines) + .pipe(lambda x: x[x.apply(bool)]) + .explode() + .str.rstrip(">") + .str.rpartition("<", expand=True)[[0, 2]] + .rename(columns={0: "name", 2: "email"}) + .groupby(["path", "email"]) + .name.agg(list) + .reset_index("email") + .groupby("path") + .apply(lambda x: x.to_dict(orient="records")) + .rename("authors") + ) diff --git a/src/psu410/src/psu410/applications_to_chemical_reactions/ellingham_diagram_and_buffered_systems.ipynb b/src/psu410/src/psu410/applications_to_chemical_reactions/ellingham_diagram_and_buffered_systems.ipynb new file mode 100644 index 0000000..dd897f9 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_chemical_reactions/ellingham_diagram_and_buffered_systems.ipynb @@ -0,0 +1,162 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "86ba3e23", + "cell_type": "markdown", + "source": [ + "## Ellingham diagram and buffered systems\n", + "\n", + "One type of chemical reactions is between a pure element in liquid or\n", + "solid states and its oxides involving one mole of oxygen gas, i.e.\n", + "\n", + "*Eq. 7\u20117* $\\frac{4}{v_{M}}M + O_{2}(gas) = M_{4/v_{M}}O_{2}$\n", + "\n", + "with $v_{M}$ being the valence of the element $M$ in the oxide. Taking\n", + "the pure $M$ and the gaseous $O_{2}$ at the reaction temperature and one\n", + "atmospheric pressure as their respective reference states, both\n", + "activities of the pure $M$ solid or liquid phase and its oxide are\n", + "unity, and the activity of $O_{2}$ equals to its partial pressure in an\n", + "ideal gas. becomes\n", + "\n", + "*Eq. 7\u20118*\n", + "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S$\n", + "\n", + "Based on , one can plot $\\mathrm{\\Delta}_{\\ }^{0}G$ as a function of\n", + "temperature for various oxidation reactions, which is called Ellingham\n", + "diagram. The intercept at $T = 0K$ is given by\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H$, and the slope is represented by\n", + "$- \\mathrm{\\Delta}_{\\ }^{0}S$, depicted by the following equation\n", + "\n", + "*Eq. 7\u20119*\n", + "$\\mathrm{\\Delta}_{\\ }^{0}S = S_{M_{4/v_{M}}O_{2}} - S_{O_{2}} - \\frac{4}{v_{M}}S_{M}$\n", + "\n", + "Since the entropy of one mole of $O_{2}$ gas is significantly larger\n", + "than those of the pure element and its oxide when they are in solid or\n", + "liquid states and the entropy difference between the pure element and\n", + "its oxide, the entropy of reaction is thus dominated by the reduction of\n", + "the entropy by one mole of $O_{2}$ gas. Consequently, the entropies of\n", + "reaction are approximately the same for most reactions when the pure\n", + "elements and their oxides are solid as seen in where most lines have\n", + "similar slopes.\n", + "\n", + "Figure \u2011: Ellingham Diagram for a number of metal-oxide systems.\n", + "\n", + "For a chemical reaction on the Ellingham diagram at a given temperature,\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G$ can be read from the y-axis of the diagram,\n", + "and the equilibrium partial pressure of $O_{2}$ gas can be calculated\n", + "using . Alternatively, one can plot the left part of for a given\n", + "$P_{O_{2}}$ as a function of temperature on the Ellingham diagram, i.e.\n", + "\n", + "*Eq. 7\u201110* $\\mathrm{\\Delta}_{\\ }^{0}{G =}RTlnP_{O_{2}}$\n", + "\n", + "This results in straight lines, representing iso-partial-pressure lines\n", + "of $O_{2}$, with the intercept being zero at $T = 0K$ and slopes of\n", + "$RlnP_{O_{2}}$, which are negative for $P_{O_{2}}$ lower than one\n", + "atmospheric pressure (1atm). The values of $P_{O_{2}}$ are marked on the\n", + "secondary axis on the right of the Ellingham diagram. The intersection\n", + "of the isoactivitiy line and the equilibrium line of the chemical\n", + "reaction thus gives the relation of equilibrium temperature and\n", + "equilibrium partial pressure of $O_{2}$. This is demonstrated in .\n", + "\n", + "Figure \u2011: Intersection of iso-partial-pressure lines of $O_{2}$ and\n", + "equilibrium lines in the Ellingham diagram\n", + "\n", + "For each chemical reaction in the Ellingham diagram, the three phases\n", + "are in equilibrium on the line represented by , i.e. metal, metal\n", + "oxides, and O2 gas. For conditions above the line, the value\n", + "of $P_{O_{2}}$ is larger than its equilibrium value, and the metal will\n", + "be oxidized. For conditions below the line, the value of $P_{O_{2}}$ is\n", + "lower than its equilibrium value, and the metal oxide will be reduced.\n", + "Therefore, the metal oxides in the upper part of the Ellingham diagram\n", + "can be reduced by the metals in the lower part of the diagram, and vice\n", + "versus, metals in the lower part of the diagram can be oxidized by the\n", + "metal oxides in the upper part of the diagram. For example, in , Ca can\n", + "reduce all oxides, and Cu2O is the least stable oxide.\n", + "\n", + "From the above Ellingham diagram, it is noted that equilibrium partial\n", + "pressures of $O_{2}$ are very low for most chemical reactions with many\n", + "of them lower than $10^{- 12}\\ atm$. One approach to obtain such a low\n", + "pressure is to use auxiliary reactions containing $O_{2}$ that are easy\n", + "to control and are independent of the equilibrium system of interest\n", + "except the sharing of the oxygen partial pressure. Two common auxiliary\n", + "reactions are the $H_{2}$/$H_{2}O$ and $CO$/$CO_{2}$ mixtures. For the\n", + "$H_{2}$/$H_{2}O$ mixture, the chemical reaction is\n", + "\n", + "*Eq. 7\u201111* $2H_{2}(gas) + O_{2}(gas) = 2H_{2}O(gas)$\n", + "\n", + "The equilibrium oxygen partial pressure is obtained as\n", + "\n", + "*Eq. 7\u201112*\n", + "$- RTln\\left\\{ {\\frac{1}{P_{O_{2}}}\\left( \\frac{P_{H_{2}O}}{P_{H_{2}}} \\right)}^{2} \\right\\} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S = - 498488\\ + 112.972T\\ (J)$\n", + "\n", + "where the $\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$\n", + "are taken from the substance thermodynamic database (SSUB4) compiled by\n", + "Scientific Group Thermodata Europe (SGTE) \\[59\\], which are slightly\n", + "dependent on temperature, and the values in are evaluated at 1273K using\n", + "Thermo-Calc \\[60\\]. At any given temperature, one has the following\n", + "relation\n", + "\n", + "*Eq. 7\u201113*\n", + "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S - 2RTln\\frac{P_{H_{2}}}{P_{H_{2}O}} = - 498488 + \\left( 112.972 - 2Rln\\frac{P_{H_{2}}}{P_{H_{2}O}} \\right)T$\n", + "\n", + "Its intercept at $T = 0K$ is given by\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H = - 498,488\\ (J)$, and the slope by\n", + "$- \\mathrm{\\Delta}_{\\ }^{0}S - 2Rln\\left( \\frac{P_{H_{2}}}{P_{H_{2}O}} \\right) = 112.972 - 2Rln\\left( \\frac{P_{H_{2}}}{P_{H_{2}O}} \\right)$.\n", + "The values of the $\\frac{P_{H_{2}}}{P_{H_{2}O}}$ ratio are marked on\n", + "another secondary axis on the right of the Ellingham diagram. The\n", + "intersection of the iso-partial-pressure-ratio line and the equilibrium\n", + "line of the chemical reaction gives the relation of equilibrium\n", + "temperature and equilibrium partial pressure ratio\n", + "$\\frac{P_{H_{2}}}{P_{H_{2}O}}$ for desired $P_{O_{2}}$ of the chemical\n", + "equilibrium.\n", + "\n", + "For the $CO$/$CO_{2}$mixture, the chemical reaction is shown below\n", + "\n", + "*Eq. 7\u201114* $2CO(gas) + O_{2}(gas) = 2CO_{2}(gas)$\n", + "\n", + "Similar, from the SSUB database, the following equation is obtained\n", + "\n", + "*Eq. 7\u201115*\n", + "$- RTln\\left\\{ {\\frac{1}{P_{O_{2}}}\\left( \\frac{P_{{CO}_{2}}}{P_{CO}} \\right)}^{2} \\right\\} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S = - 562,927 - 172.020T\\ (J)$\n", + "\n", + "with $\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$\n", + "calculated at 1273K, which are also slightly temperature-dependent as in\n", + "the case of the $H_{2}$/$H_{2}O$ mixture. The iso-partial-pressure-ratio\n", + "lines are written as\n", + "\n", + "*Eq. 7\u201116*\n", + "$RTlnP_{O_{2}} = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S - 2RTln\\frac{P_{CO}}{P_{{CO}_{2}}} = - 562,927 + \\left( 172.020 - 2Rln\\frac{P_{CO}}{P_{{CO}_{2}}} \\right)T\\ $\n", + "\n", + "Its intercept at $T = 0K$ is given by\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H = - 562,927\\ (J)$, and the slope by\n", + "$172.020 - - 2Rln\\left( \\frac{P_{CO}}{P_{{CO}_{2}}} \\right)$. The values\n", + "of the $\\frac{P_{CO}}{P_{{CO}_{2}}}$ ratio are marked on the third\n", + "secondary axis on the right of the Ellingham diagram. The intersection\n", + "of the iso-partial-pressure-ratio line and the equilibrium line of the\n", + "chemical reaction gives the relation of equilibrium temperature and\n", + "equilibrium partial pressure ratio $\\frac{P_{CO}}{P_{{CO}_{2}}}$ for\n", + "desired $P_{O_{2}}$ of the chemical equilibrium.\n", + "\n", + "Therefore, one can use a mixture of the $H_{2}$/$H_{2}O$ or\n", + "$CO$/$CO_{2}$ to obtain the desired low $P_{O_{2}}$ values using and or\n", + "calculating from the SSUB database. For example,\n", + "$P_{O_{2}} = 10^{- 15}\\ atm$ at 1273K, the calculated values from the\n", + "SSUB database are $\\frac{P_{H_{2}}}{P_{H_{2}O}} \\approx 1.67$ and\n", + "$\\frac{P_{CO}}{P_{{CO}_{2}}} \\approx 2.78$, respectively, in which the\n", + "temperature dependences of $\\mathrm{\\Delta}_{\\ }^{0}H$ and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}S$ and the many more gaseous species in the gas\n", + "phase are taken into account. On the other hand, the reading from the\n", + "Ellingham diagram gives $\\frac{P_{H_{2}}}{P_{H_{2}O}} \\approx 2.0$ and\n", + "$\\frac{P_{CO}}{P_{{CO}_{2}}} \\approx 2.4$, and the agreement with the\n", + "more accurate calculations above is remarkable keeping in mind the\n", + "uncertainties in graphically drawing the lines and reading both values\n", + "in the logarithmic scales from the diagram, indicating the robustness of\n", + "the Ellingham diagram.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_chemical_reactions/index.ipynb b/src/psu410/src/psu410/applications_to_chemical_reactions/index.ipynb new file mode 100644 index 0000000..5cba631 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_chemical_reactions/index.ipynb @@ -0,0 +1,28 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "9ccb7396", + "cell_type": "markdown", + "source": [ + "# Applications to chemical reactions\n", + "\n", + "A chemical reaction can be viewed as a framework dividing a system into\n", + "two closed subsystems: reactants and products. The phases and species of\n", + "reactants and products are selected from possible phases and species\n", + "that may form from the independent components of the system. A chemical\n", + "reaction can thus be considered as an internal process to transfer heat\n", + "and work between the two subsystems of reactants and products. It is\n", + "evident that this subset of phases and species only represents partial\n", + "equilibrium information of the system under given external conditions,\n", + "and more stable equilibrium states may exist by including more phases\n", + "and species with the global equilibrium depicted by phase diagrams\n", + "discussed in previous chapters with all known phases and species\n", + "included.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_chemical_reactions/internal_process_and_differential_and_integrated_driving_forces.ipynb b/src/psu410/src/psu410/applications_to_chemical_reactions/internal_process_and_differential_and_integrated_driving_forces.ipynb new file mode 100644 index 0000000..13630bf --- /dev/null +++ b/src/psu410/src/psu410/applications_to_chemical_reactions/internal_process_and_differential_and_integrated_driving_forces.ipynb @@ -0,0 +1,102 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "1a5ed192", + "cell_type": "markdown", + "source": [ + "## Internal process and differential and integrated driving forces\n", + "\n", + "The driving force for an internal process can be defined as following\n", + "using $U$, $H$, $F$, or $G$ as discussed in Chapter and depending on\n", + "what system variables are kept constant\n", + "\n", + "*Eq. 7\u20111*\n", + "$- D = \\left( \\frac{\\partial U}{\\partial\\xi} \\right)_{S,\\ V,N_{i}\\ } = \\left( \\frac{\\partial H}{\\partial\\xi} \\right)_{S,\\ P,N_{i}\\ } = \\left( \\frac{\\partial F}{\\partial\\xi} \\right)_{T,\\ V,N_{i}\\ } = \\left( \\frac{\\partial G}{\\partial\\xi} \\right)_{T,P,N_{i}\\ }$\n", + "\n", + "This can be termed as differential driving force as it relates the\n", + "derivative of energy with respect to an internal process so the change\n", + "is infinitesimally small and does not affect the properties of the\n", + "system significantly. For a system under constant $T$ and $P$, let us\n", + "consider an internal process for forming a new phase $\\alpha$ with the\n", + "composition $x_{i}^{\\alpha}$ and Gibbs energy\n", + "$G_{m}^{\\alpha}\\left( x_{i}^{\\alpha} \\right)$. The differential driving\n", + "force for such an internal process can thus be defined as\n", + "\n", + "*Eq. 7\u20112*\n", + "$- D = G_{m}^{\\alpha}\\left( x_{i}^{\\alpha} \\right) - \\sum_{i}^{}x_{i}^{\\alpha}\\mu_{i} = \\sum_{i}^{}x_{i}^{\\alpha}\\left( \\mu_{i}^{\\alpha} - \\mu_{i} \\right)$\n", + "\n", + "where $\\mu_{i}$ is the chemical potential of component *i* in the\n", + "system. This may also be called as nucleation driving force as if the\n", + "$\\alpha$ phase is nucleating in the system. As discussed in Chapter ,\n", + "chemical potentials are the intercepts on the Gibbs energy axis by the\n", + "tangent plane of Gibbs energy. thus represents the distance between the\n", + "tangent planes of the original system and the $\\alpha$ phase at the\n", + "composition of the $\\alpha$ phase. Evidently, this distance is at its\n", + "maximum when the two tangent planes are parallel to each other, i.e. the\n", + "commonly called parallel tangent construction when evaluating nucleation\n", + "driving force.\n", + "\n", + "The situation is different for chemical reactions where the amount of\n", + "each component in reactants is the same as that in products, i.e. there\n", + "is a mass balance between reactants and products. The driving force for\n", + "a chemical reaction is defined by the Gibbs energy difference between\n", + "the reactants and products as if all the reactants are transferred to\n", + "the products. This driving force may thus be called integrated driving\n", + "force as it describes the energy difference of a system under two\n", + "different states, i.e.\n", + "\n", + "*Eq. 7\u20113*\n", + "$- \\int_{}^{}{Dd\\xi} = \\mathrm{\\Delta}G = \\sum_{p}^{}{n_{p}G_{p}} - \\sum_{r}^{}{n_{r}G_{r}}$\n", + "\n", + "where superscripts $p$ and $r$ denote products and reactants, $n_{p}$\n", + "and $n_{r}$ their corresponding moles, $G_{p}$and $G_{r}$ the Gibbs\n", + "energies in per mole of formula of their respective stoichiometries as\n", + "written in the chemical reaction. Conventionally, the products and\n", + "reactants are represented by species or stoichiometric compounds rather\n", + "than individual phases. This is particularly evident when various\n", + "gaseous species are considered in a chemical reaction. Consequently,\n", + "$G_{p}$and $G_{r}$ in represent the chemical potentials of product and\n", + "reactant species. For species with a fixed composition, its chemical\n", + "potential is the same as its Gibbs energy as shown by . For a species in\n", + "a solution phase, its chemical potential is related to its activity as\n", + "shown in . can thus be further written as\n", + "\n", + "*Eq. 7\u20114*\n", + "$\\mathrm{\\Delta}G = \\sum_{p}^{}{n_{p}_{\\ }^{0}G_{p}} - \\sum_{r}^{}{n_{r}_{\\ }^{0}G_{r}} + RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}}$\n", + "\n", + "It is evident from that for stoichiometric phases in a chemical\n", + "reaction, their activities equal to one. At equilibrium, the integrated\n", + "driving force becomes zero, i.e. $\\mathrm{\\Delta}G = 0$, and is\n", + "re-arranged to become\n", + "\n", + "*Eq. 7\u20115*\n", + "$- RTln\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} = - RTlnK_{e} = \\mathrm{\\Delta}_{\\ }^{0}G = \\mathrm{\\Delta}_{\\ }^{0}H - T\\mathrm{\\Delta}_{\\ }^{0}S$\n", + "\n", + "where $K_{e}$ is often called reaction constant relating the activities\n", + "of products and reactants at equilibrium. In a system with\n", + "$\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} > K_{e}$,\n", + "the chemical reaction goes to left, and the products are decomposed,\n", + "while\n", + "$\\frac{\\prod_{p}^{}\\left( a_{p} \\right)^{n_{p}}}{\\prod_{r}^{}\\left( a_{r} \\right)^{n_{r}}} < K_{e}$,\n", + "the chemical reaction goes to right, and the products are formed. is\n", + "often recast into the following form by dividing $\u2013RT$ on both sides of\n", + "the equation\n", + "\n", + "*Eq. 7\u20116*\n", + "$\\ln K_{e} = - \\frac{\\mathrm{\\Delta}_{\\ }^{0}H}{RT} + \\frac{\\mathrm{\\Delta}_{\\ }^{0}S}{R}$\n", + "\n", + "With $\\ln K_{e}$ plotted with respect to $1/T$, indicates that the slope\n", + "is $- \\mathrm{\\Delta}_{\\ }^{0}H$/R and the intercept on the y axis is\n", + "$\\mathrm{\\Delta}_{\\ }^{0}{S/R}$ as shown in .\n", + "\n", + "Figure \u2011: $\\ln K_{e}$ plotted with respect to $1/T$ for several M-O\n", + "systems at 1 bar and $K_{e}$ represented by the partial pressure ratio\n", + "of CO2 and CO.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_chemical_reactions/maximum_reaction_rate_and_chemical_transport_reactions_.ipynb b/src/psu410/src/psu410/applications_to_chemical_reactions/maximum_reaction_rate_and_chemical_transport_reactions_.ipynb new file mode 100644 index 0000000..fc91abf --- /dev/null +++ b/src/psu410/src/psu410/applications_to_chemical_reactions/maximum_reaction_rate_and_chemical_transport_reactions_.ipynb @@ -0,0 +1,159 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "e2171527", + "cell_type": "markdown", + "source": [ + "## Maximum reaction rate and chemical transport reactions \n", + "\n", + "Equilibrium thermodynamics can be used to calculate the maximum rates of\n", + "reaction that are possible in dynamically reacting systems, such as when\n", + "a corrosive gas passes over a heated sample. Other examples of such\n", + "reactions include the reduction of a metal oxide in flowing hydrogen,\n", + "the evaporation of a material in a vacuum, and the deposition of a thin\n", + "film by a chemical vapour deposition process. The basic assumption used\n", + "in calculating these maximum reaction rates is that local equilibrium\n", + "exists at the location of the considered reaction.\n", + "\n", + "This section examines several examples in which maximum reaction rates\n", + "are calculated. The system can typically be divided into three regions:\n", + "(1) the input region, which is usually near room temperature, (2) the\n", + "high temperature region in which the primary reaction of interest is\n", + "occurring, and (3) the exit region. Such a system is almost always at\n", + "constant pressure throughout the system. Since the three regions have\n", + "different temperatures, the key is to use the mass conservation of the\n", + "carrier gas in all three regions. With the input gas at $T = 298K$ and\n", + "$P = 1atm$, the volume of one mole of ideal gas is\n", + "$0.0244\\left( m^{3} \\right) = 24.4(liter)$. The number of moles of input\n", + "gas flowing through the system can be written as\n", + "\n", + "*Eq. 7\u201117*\n", + "$n_{gas}^{0} = \\frac{Pf_{gas}}{RT} = \\frac{f_{gas}}{24.4} = 0.0409f_{gas}$\n", + "\n", + "where $f_{gas}$ is the input gas flow rate in liter per unit time at\n", + "$T = 298K$ and $P = 1atm$, and $R$ the gas constant.\n", + "\n", + "The first example is the evaporation of water in a flowing stream of dry\n", + "hydrogen. A schematic diagram of the system being considered is given in\n", + ". The goal of the calculation is to determine the maximum rate of\n", + "$H_{2}O(liquid)$ loss, $n_{H_{2}O}^{\\ }$, through vaporization in a\n", + "flowing stream of $H_{2}$, e.g. for generating a given $H_{2}O/H_{2}$\n", + "ratio for producing a given $O_{2}$ pressure in a high temperature\n", + "system as related to the Ellingham diagram discussed in Chapter . The\n", + "maximum rate is determined by saturating the $H_{2}$ with the\n", + "equilibrium vapour pressure of $H_{2}O(liquid)$ with the number of moles\n", + "of $H_{2}$ being $n_{H_{2}}^{0} = 0.0409f_{H_{2}}$ and $f_{H_{2}}$ being\n", + "the input flow rate of $H_{2}$ in liter per unit time.\n", + "\n", + "Figure \u2011: Schematic diagram of vaporization of water in a flowing stream\n", + "of dry hydrogen\n", + "\n", + "In the first input region, the total number moles of gas is\n", + "$N = n_{H_{2}}^{0}$. In the second high temperature region with the\n", + "temperature and pressure being $T_{sys}$ and $P_{sys}$, the total number\n", + "moles of gas is $N = n_{H_{2}}^{0} + n_{H_{2}O}^{\\ }$, which is the same\n", + "for the third exit region with $T_{exit}$. To avoid condensation, one\n", + "needs to maintain $T_{exit} > T_{sys}$. The vapour pressure of $H_{2}O$\n", + "at $T_{sys}$, $P_{H_{2}O\\ }$, can be obtained from equilibrium\n", + "thermodynamic calculations. Since the $H_{2}$ and $H_{2}O$ are occupying\n", + "the same volume at the same temperature, the maximum number of moles\n", + "$H_{2}O$ can be calculated from the following relation based on the\n", + "ideal gas law\n", + "\n", + "*Eq. 7\u201118*\n", + "$n_{H_{2}O}^{\\ } = \\frac{P_{H_{2}O}^{\\ }}{P_{H_{2}}^{\\ }}n_{H_{2}}^{0} = \\frac{P_{H_{2}O}^{\\ }}{P_{sys}^{\\ } - P_{H_{2}O}^{\\ }}n_{H_{2}}^{0} = \\frac{P_{H_{2}O}^{\\ }}{P_{sys}^{\\ } - P_{H_{2}O}^{\\ }}\\frac{f_{H_{2}}}{24.4}$\n", + "\n", + "For $P_{sys}^{\\ } = 101325Pa$, one can calculate $P_{H_{2}O}^{\\ }$ and\n", + "plot $\\frac{n_{H_{2}O}^{\\ }}{f_{H_{2}}}$ as a function of temperature\n", + "from the SSUB database as shown in . The corresponding partial pressure\n", + "ratio, $P_{H_{2}O}/P_{H_{2}}$ , is plotted in , which can be used to\n", + "calculate $P_{O_{2}}^{\\ }$ at any given temperatures. An example is\n", + "shown in with $T_{sys} = 348.15K$ and $P_{H_{2}O}/P_{H_{2}} = 0.607$.\n", + "\n", + "Figure \u2011: Ratio of maximum number of moles $H_{2}O$ with respect to\n", + "hydrogen flow rate, $\\frac{n_{H_{2}O}^{\\ }}{f_{H_{2}}}$, plotted as a\n", + "function of temperature.\n", + "\n", + "Figure \u2011: Partial pressure ratio, $P_{H_{2}O}/P_{H_{2}}$, corresponding\n", + "to .\n", + "\n", + "Figure \u2011: Partial pressure of oxygen, $P_{O_{2}}^{\\ }$, as a function of\n", + "temperature with $T_{sys} = 348.15K$ and $P_{H_{2}O}/P_{H_{2}} = 0.607$.\n", + "\n", + "The second example is the corrosion of $SiO_{2}$(s) by flowing $H_{2}$\n", + "gas at high temperatures. Considering $T_{sys}^{\\ } = 1700K$,\n", + "$P_{sys}^{\\ } = 101325Pa$, and $f_{H_{2}} = 1\\ liter/min$, the system is\n", + "thus defined with 0.0409 moles of $H_{2}$ and an equilibrium between the\n", + "gas phase and the tridymite $SiO_{2}$. The equilibrium calculation gives\n", + "0.04092 moles of gas with its constitutions as\n", + "$H_{2}:H_{2}O:SiO = 0.998887:4.833 \\bullet 10^{- 4}:4.832 \\bullet 10^{- 4}$.\n", + "The corrosion rate of SiO2(s) is thus\n", + "$0.04092x4.832 \\bullet 10^{- 4} = 1.98 \\bullet 10^{- 5}mol/min = 1.19gram/min.$\n", + "\n", + "Another example is to consider that the flowing $CO$ gas of 298K and\n", + "1atm ($= 101325Pa$) at a rate of $1\\ liter/min$ passes through and\n", + "equilibrates with single phase $C(s)$ at 1500K. The equilibrium system\n", + "is defined by $T = 1500K$, $P = 1atm$, and 0.0409 moles of $CO$ with the\n", + "equilibrium between the gas phase and C(s). The equilibrium calculation\n", + "gives 0.040872 moles of gas phase with the mole fraction of $CO$ being\n", + "0.999327, resulting in the loss of *CO* or the deposition of *C(s)* at a\n", + "rate of\n", + "$0.0409 - 0.040872 \\bullet 0.999327 = 5.55 \\bullet 10^{- 5}mole/min$.\n", + "\n", + "A chemical transport reaction is a reaction in which a condensed phase\n", + "reacts with a gas phase to form vapour-phase products, which in turn\n", + "undergo the reverse reformation of the condensed phase. Two well-known\n", + "examples of such reactions are\n", + "\n", + "*Eq. 7\u201119* $M(s) + \\frac{n}{2}I_{2}(g) = MI_{n}(g)$\n", + "\n", + "*Eq. 7\u201120* $Ni(s) + 4CO(g) = Ni{(CO)}_{4}(g)$\n", + "\n", + "which are used in the purification of metals by the iodide process and\n", + "in the purification of nickel by the Mond-Langer process. In both\n", + "processes the forward reaction is favoured by lower temperatures and the\n", + "reverse reaction by higher temperatures, resulting in the deposition of\n", + "the metal. The most common technique for causing a chemical transport of\n", + "a condensed substance makes use of the temperature dependence of the\n", + "equilibrium constant. As was discussed previously, the enthalpy of\n", + "reaction, $\\mathrm{\\Delta}_{\\ }^{0}H$, determines the manner in which\n", + "$K_{e}$ changes with temperature (see ). The value of $K_{e}$ increases\n", + "with increasing *T* for $\\mathrm{\\Delta}_{\\ }^{0}H > 0$, $K_{e}$\n", + "decreases with increasing *T* for $\\mathrm{\\Delta}_{\\ }^{0}H < 0$, and\n", + "$K_{e}$ is independent of T for $\\mathrm{\\Delta}_{\\ }^{0}H = 0$. The\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$ values for\n", + "chemical transport reactions may be either positive or negative. For\n", + "reactions by both are positive, and for reactions by both are negative.\n", + "\n", + "In a typical experiment the starting solid is located at the point in a\n", + "temperature gradient that corresponds to the largest $K_{e}$ value for\n", + "the experimental condition. As the gaseous species migrate to other\n", + "locations in the system with temperatures corresponding to lower $K_{e}$\n", + "values, the reverse reaction occurs to satisfy the new equilibrium\n", + "requirements, and the solid phase is deposited. The dependence of\n", + "$K_{e}$ on $\\mathrm{\\Delta}_{\\ }^{0}H$ results in a material transport\n", + "from hot to cold for $\\mathrm{\\Delta}_{\\ }^{0}H > 0$ (the same as for\n", + "vaporization-condensation reactions), from cold to hot for\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H < 0$, and no transport for\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H = 0$.\n", + "\n", + "The success of a particular reaction in causing an appreciable transport\n", + "of a condensed phase depends mainly upon the partial pressure gradients\n", + "or concentration gradients of the gaseous species in the system. A\n", + "reaction whose equilibrium is extreme toward either the reactant side or\n", + "the product side will not give an appreciable transport of material. The\n", + "concentration gradients are too small in such a system. Reactions with\n", + "equilibrium constants near unity at the experimental temperatures\n", + "usually give the largest transport since small changes in $K_{e}$ cause\n", + "large changes in concentrations. The general condition required for\n", + "obtaining a $K_{e}$ value near unity at a reasonable temperature is that\n", + "$\\mathrm{\\Delta}_{\\ }^{0}H$ and $\\mathrm{\\Delta}_{\\ }^{0}S$ both have\n", + "the same sign, resulting from the equalities of .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_chemical_reactions/trends_of_entropies_of_reactions.ipynb b/src/psu410/src/psu410/applications_to_chemical_reactions/trends_of_entropies_of_reactions.ipynb new file mode 100644 index 0000000..3521e82 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_chemical_reactions/trends_of_entropies_of_reactions.ipynb @@ -0,0 +1,84 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "fb0726b5", + "cell_type": "markdown", + "source": [ + "## Trends of entropies of reactions\n", + "\n", + "The reaction entropy, $\\mathrm{\\Delta}_{\\ }^{0}S$ in , plays an\n", + "important role in determining equilibria of high-temperature reactions.\n", + "The most important single factor that determines the entropy of a\n", + "reaction is the net change in the number of moles of gas as briefly\n", + "mentioned in the discussion of the Ellingham diagram above. The reason\n", + "this is true can be explained as follows.\n", + "\n", + "The entropy of a substance can be thought of as being the sum of four\n", + "parts: (i) translational, (ii) rotational, (iii) vibrational, and (iv)\n", + "electronic. The translational entropy of a gas is the largest entropy\n", + "term under most conditions. To the extent that the other contributions\n", + "cancel between reactants and products, the entropy of reaction is\n", + "determined by the change in the number of moles of gaseous molecules.\n", + "Based on the literature data or calculations from the SSUB database, the\n", + "net change in the number of moles of gas in a reaction results\n", + "approximately in an entropy of reaction of about 175\u00b145 J/K/mole-gas at\n", + "298K for many halides and oxides. The chemical reactions of and\n", + "discussed above both reduce the gas by one mole, and their entropies of\n", + "reaction are -113 and -172 J/K at 1273K, and -89 and -173J/K at 298K,\n", + "respectively, indicating that the chemical reaction of is an exception\n", + "of the empirical rule. For chemical reactions shown in the Ellingham\n", + "diagram, their entropies of reaction follow this empirical rule pretty\n", + "well with some of them shown in calculated from the SGTE database.\n", + "\n", + "Table \u2011: Entropies of reactions with gas at 298.15K, J/K\n", + "\n", + "Reaction: Si+O2 =SiO2 -182\n", + "\n", + "Reaction: Ti+O2=TiO2 -185\n", + "\n", + "Reaction: 2Mg+O2=2MgO -217\n", + "\n", + "Reaction: 2Ca+O2=2CaO -212\n", + "\n", + "Reaction: 2Mn+O2=2MnO -150\n", + "\n", + "Since the entropy of a reaction is primarily determined by the net\n", + "change in the number of moles of gas, the entropies for reactions\n", + "involving only condensed phases must be small. The entropies of fusion\n", + "of monatomic solids are usually in the range 8-15 J/K/mole-atom as shown\n", + "for some elements in . Most metals and many ionic salts have values that\n", + "lie in this range when given in terms of per mole of atom of material.\n", + "There are few exceptions such as silicon and boron shown in the table.\n", + "For solid-state reactions, the average values can be approximated as\n", + "0\u00b18J/K/mole-atom as also shown in the table.\n", + "\n", + "Table \u2011: Entropies of reactions of condensed phases at 298.15K, J/K\n", + "\n", + "Reaction: Si(s)=Si(l) 29.762\n", + "\n", + "Reaction: Ti(s2)=Ti(l) 7.288\n", + "\n", + "Reaction: Mg(s2)=Mg(l) 9.184\n", + "\n", + "Reaction: Ca(s2)=Ca(l) 7.659\n", + "\n", + "Reaction: Mn(s2)=Mn(l) 11.443\n", + "\n", + "Reaction: W(s)=W(l) 14.158\n", + "\n", + "Reaction: B(s)=B(l) 21.380\n", + "\n", + "Reaction: 3Fe+C=CFe3 17.060\n", + "\n", + "Reaction: S+Mn=MnS 13.909\n", + "\n", + "Reaction: NiO+Fe2O3=Fe2NiO4\n", + "0.464\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/application_examples.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/application_examples.ipynb new file mode 100644 index 0000000..f780138 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/application_examples.ipynb @@ -0,0 +1,393 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "58e74cef", + "cell_type": "markdown", + "source": [ + "## Application examples\n", + "\n", + "Among many applications of electrochemistry, several of them are briefly\n", + "discussed in this section.\n" + ], + "metadata": {} + }, + { + "id": "153afcb4", + "cell_type": "markdown", + "source": [ + "### Metastability and passivation\n", + "\n", + "Our modern industrial society is built on various metals such as Fe, Ni,\n", + "Al, Ti, and Zr alloys which are reactive, but exhibit extraordinary\n", + "kinetic stabilities in oxidizing environments due to the existence of a\n", + "thin reaction product film on the surface. This film effectively\n", + "isolates the metal from the corrosive environment, a phenomenon called\n", + "passivation. One interesting experiment by Faraday in 1836 who reported\n", + "that iron corrodes freely in dilute nitric acid, while in concentrated\n", + "nitric acid, no reaction apparently occurred. To understand this\n", + "phenomenon, let us exam a simple, schematic Pourbaix diagram for the\n", + "iron-water system shown in .\n", + "\n", + "Figure \u2011: Schematic Pourbaix diagram for iron illustrating the\n", + "resolution of the Faraday paradox in the corrosion of iron in nitric\n", + "acid \\[61\\]. Lines (a) (b), and (c) correspond to the equilibria: (a)\n", + "$H^{+} + e^{-} = 1/2H_{2}$; (b) $O_{2} + 4H^{+} + 4e^{-} = 2H_{2}O$; (c)\n", + "$NO_{3}^{-} + 3H^{+} + 2e^{-} = HNO_{2} + H_{2}O$, respectively\n", + "\n", + "For iron in deaerated acid solution, the partial anodic and cathodic\n", + "reactions are Line 1 $\\left( Fe/{Fe}^{2 +} \\right)$ and Line (a),\n", + "respectively, resulting in a corrosion potential that lies between Lines\n", + "$1$ and $a$. In oxygenated (aerated) solutions, the corrosion potential\n", + "may lie between Lines $1$ and $b$, because the reduction of oxygen is a\n", + "possible (likely) cathodic reaction. Since dilute HNO3 is\n", + "only a weak oxidizing agent, the principal cathodic reaction was most\n", + "likely hydrogen evolution, and hence the corrosion potential is expected\n", + "to lie between Lines $1$ and $a$ at relatively high pH, as shown. Since\n", + "the $Fe/{Fe}^{2 +}$ reaction is relatively fast compared with\n", + "$H^{+}/H_{2}$ on iron, if the corrosion potential is situated below the\n", + "extension of Line 2 (Fe/Fe3O4) into the\n", + "${Fe}^{2 +}$ stability region, Fe3O4 cannot form\n", + "on the surface, even as a metastable phase.\n", + "\n", + "On the other hand, concentrated HNO3 is a strong oxidizing\n", + "agent due to the reaction:\n", + "$NO_{3}^{-} + 3H^{+} + 2e^{-} = HNO_{2} + H_{2}O$, so that the corrosion\n", + "potential can lie anywhere between Lines $1$ and $c$ at low pH. Since\n", + "Reaction (2) is likely to be fast, the corrosion potential will be high\n", + "and certainly will be more positive than the extension of Line 2 into\n", + "the stability region for ${Fe}^{2 +}$ at low pH. Therefore,\n", + "Fe3O4 becomes metastable and can form between the\n", + "aqueous solution and iron. The thickness of this\n", + "Fe3O4 film depends on its dissolution rate into\n", + "the aqueous solution and its growth rate at the interface with iron,\n", + "which depends on the diffusion of ionic species across the film. Its\n", + "existence results in passivity and the observed kinetic inactivity of\n", + "iron in this medium. When the potential becomes even more positive above\n", + "the extension of Line $3$, Fe2O3 may form on\n", + "Fe3O4 as an additional metastable phase, resulting\n", + "in the commonly observed bilayer structure.\n" + ], + "metadata": {} + }, + { + "id": "83ea110b", + "cell_type": "markdown", + "source": [ + "### Galvanic protection\n", + "\n", + "A galvanic reaction takes place between two different materials at the\n", + "two respective electrodes, each with different tendency to hold on to\n", + "electrons. Consider the following electrochemical cell used to protect\n", + "Cu tanks against oxidation by using a \u201csacrificial\u201d Fe electrode\n", + "\n", + "anode solution cathode\n", + "\n", + "Fe(s) \\| Fe2+ \\| SO4= \\|\n", + "Cu2+\\| Cu(s) \\|\n", + "\n", + "Cathode reduction: Cu2+ + 2 e- = Cu \u03b5o\n", + "(volts) = 0.34\n", + "\n", + "Anode oxidation: Fe(s) = Fe2+ + 2 e- \u03b5o (volts) =\n", + "0.44\n", + "\n", + "Net reaction: Cu2+ + Fe =\\> Cu + Fe2+\n", + "\u03b5o (volts) = 0.78\n", + "\n", + "If the cell has a direct connection between the electrodes, i.e. it has\n", + "a short circuit: \u2206G \u2192 0 and thus \u03b5cell \u2192 0. Since the value\n", + "of \u03b5ocell \\> 0 for the net cell reaction, the equilibrium\n", + "constant *Ke* \\> 1, which means\n", + "\\[Fe2+\\]/\\[Cu2+\\] \\> 1. By assuming an ideal\n", + "electrolyte solution, the activities in *Ke* can be\n", + "represented by concentrations (in molar concentration units), assuming\n", + "that solid Fe and Cu are present at unit activities. If the electrodes\n", + "of Cu and Fe are short circuited while in contact with the same\n", + "\"electrolyte solution\", the final equilibrium concentrations can be\n", + "calculated by the standard equation,\n", + "\n", + "*Eq. 8\u201161* *Ke* = \\[Fe2+\\]/\\[Cu2+\\] =\n", + "exp (-\u2206oG/RT)\n", + "\n", + "or, using the Nernst equations,\n", + "\n", + "*Eq. 8\u201162* \u03b5 = \u03b5o -(RT/z f) ln (\\[Fe2+\\]/\\[Cu2+\\])\n", + "= 0\n", + "\n", + "and the above standard cell potential:\n", + "\\[Fe2+\\]/\\[Cu2+\\] = 2.4\u20221026\n", + "\n", + "With this large ratio it can be seen that the tendency to produce\n", + "Cu+2 ions, i.e., the tendency to corrode the Cu(s), is\n", + "extremely small if a sacrificial Fe electrode is configured in an\n", + "electrochemical cell with the Cu tank.\n" + ], + "metadata": {} + }, + { + "id": "8f8d4045", + "cell_type": "markdown", + "source": [ + "### Fuel cells\n", + "\n", + "Fuel cells are devices to convert chemical energy to electricity and\n", + "heat through electrochemical reactions with the fuel and oxygen supplied\n", + "to the anode and cathode, respectively. Typical ions migrating through\n", + "the electrolyte are $H^{+}$, ${OH}^{-}$, ${CO}_{3}^{2 -}$, and\n", + "$O^{2 -}$. In fuel cells with $H^{+}$ as migrating ions, H2\n", + "molecules are dissociated into $H^{+}$ on the anode, which are combined\n", + "with O2 on the cathode to form H2O and release\n", + "heat with the half cell and the net cell reactions in their simplest\n", + "form as shown by for the anode, for the cathode, and for the net cell,\n", + "respectively. Commonly used electrolytes are polymer and phosphoric\n", + "acid, and both anode and cathode reactions are facilitated by catalyst,\n", + "typically platinum. The thermodynamic limit of power which can be\n", + "generated by the fuel cell is represented by\n", + "\n", + "*Eq. 8\u201163*\n", + "$w = - \\mathrm{\\Delta}G = - \\mathrm{\\Delta}_{\\ }^{0}G_{cell} + RTln\\left( P_{H_{2}}P_{O_{2}}^{1/2} \\right)$\n", + "\n", + "For fuel cells with anions as migrating ions, the anions are generated\n", + "on the cathode with H2O formed and heat generated on the\n", + "anode. Their representative cathode reactions are\n", + "\n", + "*Eq. 8\u201164* $\\frac{1}{2}O_{2} + H_{2}O + 2e^{-}{= 2OH}^{-}$\n", + "\n", + "*Eq. 8\u201165* ${\\frac{1}{2}O}_{2} + CO_{2} + 2e^{-} = {CO}_{3}^{2 -}$\n", + "\n", + "*Eq. 8\u201166* $\\frac{1}{2}O_{2} + 2e^{-} = O^{2 -}$.\n", + "\n", + "The anode reaction for is the reaction represented by , operating at low\n", + "temperatures and using catalyst for both electrodes. The anode reactions\n", + "for and are\n", + "\n", + "*Eq. 8\u201167* ${CO}_{3}^{2 -} + H_{2} = H_{2}O + CO_{2} + 2e^{-}$\n", + "\n", + "*Eq. 8\u201168* $O^{2 -} + H_{2} = H_{2}O + 2e^{-}$\n", + "\n", + "respectively. To enable the diffusion of ${CO}_{3}^{2 -}$ and $O^{2 -}$\n", + "through the cathode and the electrolyte, both fuel cells are operated at\n", + "relative high temperatures, with the former typically in molten\n", + "carbonate solutions and the latter through solid oxides. Due to the high\n", + "operating temperatures, fuels are converted to hydrogen within the fuel\n", + "cell itself by a process called internal reforming, removing the need\n", + "for precious-metal catalyst and enabling the use of a variety of fuels.\n", + "The net cell reaction for all three fuel cells is the same as in the\n", + "case of $H^{+}$, represented by .\n" + ], + "metadata": {} + }, + { + "id": "3014d564", + "cell_type": "markdown", + "source": [ + "### Ion transport membranes\n", + "\n", + "Ion transport membranes (ITMs) are ceramic membranes conducting both\n", + "electrons and oxygen ions, but no other species. The chemical potential\n", + "difference of oxygen between two sides of a membrane provides the\n", + "driving force for oxygen to diffuse through the membrane. Commonly used\n", + "ITM oxides include perovskite and fluorite, with the chemical formula of\n", + "ABO3 and AO2, respectively, typically with more\n", + "than one elements in the A-site and / or the B-site to tailor the\n", + "electron and ionic conductivities. Key thermodynamic properties of ITM\n", + "oxides are their stability in service environments, vacancy\n", + "concentrations in the oxygen and cation sites, valances of cations. On\n", + "the high oxygen partial pressure side, the reaction is as the following\n", + "\n", + "*Eq. 8\u201169* $\\frac{1}{2}O_{2} + 2e^{-} = O^{2 -}$\n", + "\n", + "At the same time the number of oxygen vacancy is reduced, resulting in a\n", + "lower concentration of oxygen vacancy and higher oxygen activity in the\n", + "oxide on the high oxygen partial pressure side. On the low oxygen\n", + "partial pressure side, the reaction is reversed to produce oxygen\n", + "molecules, i.e.\n", + "\n", + "*Eq. 8\u201170* $O^{2 -} = \\frac{1}{2}O_{2} + 2e^{-}$\n", + "\n", + "This reaction results in higher oxygen vacancy concentration and lower\n", + "oxygen activity. At both sides, the charge neutrality is compensated by\n", + "the valance changes of cations, resulting in the electron flow in the\n", + "opposite direction of oxygen diffusion. The ionic conductivity is\n", + "dictated by the oxygen transportation across the membrane with the\n", + "driving force of the following net reaction\n", + "\n", + "*Eq. 8\u201171*\n", + "$\\frac{1}{2}O_{2}\\left( P_{high} \\right) = \\frac{1}{2}O_{2}\\left( P_{low} \\right)$\n", + "\n", + "*Eq. 8\u201172*\n", + "$\\mathrm{\\Delta}G = 0.5RTln\\left( \\frac{P_{low}}{P_{high}} \\right)$.\n", + "\n", + "The oxygen transportation is closely related to the concentration of\n", + "oxygen vacancy in the membrane, which is obtained by minimizing the\n", + "Gibbs energy of the phase under given temperature and oxygen partial\n", + "pressure conditions. High vacancy concentrations can be obtained by\n", + "cation dopants with lower valances or small energy differences between\n", + "various valance states. However, at the same time, high vacancy\n", + "concentrations reduce the thermodynamic stability of the membrane, which\n", + "may result in its decomposition into more stable phases.\n" + ], + "metadata": {} + }, + { + "id": "863f2b4a", + "cell_type": "markdown", + "source": [ + "### Electrical batteries\n", + "\n", + "Batteries utilize electrochemical reactions to generate electricity for\n", + "various devices. The theoretic voltage of a battery can be calculated\n", + "from and , i.e.\n", + "\n", + "*Eq. 8\u201173*\n", + "$\\varepsilon = - \\frac{\\mathrm{\\Delta}G}{zf} = \\varepsilon^{0} - \\frac{RTlnQ}{zf}$\n", + "\n", + "with $\\mathrm{\\Delta}G$ being the driving force of the net cell reaction\n", + "and $Q$ being the reaction activity quotient. The actual voltage of a\n", + "battery is lower than the theoretical one due to kinetic limitations of\n", + "cell reactions and resistance to ion diffusion through the electrolyte.\n", + "Based on whether the cell reactions are reversible or not, batteries\n", + "typically categorized as either primary disposable or secondary\n", + "rechargeable batteries. The net cell reactions in primary disposable\n", + "batteries are not easily reversible, and electrode materials may not\n", + "return to their original forms by applying a higher external potential\n", + "of opposite sign. Consequently, primary batteries cannot be reliably\n", + "recharged. On the other hand, the net cell reactions in secondary\n", + "batteries are easily reversible. Furthermore, two half-cells in\n", + "batteries may use different electrolytes with each half-cell enclosed in\n", + "a container and a separator permeable to conducting ions but not the\n", + "bulk of the electrolytes.\n", + "\n", + "One common primary battery is zinc-carbon battery with a zinc anode\n", + "cylinder and a carbon cathode central rod. The electrolytes are ammonium\n", + "or zinc chloride next to the zinc anode and a mixture of ammonium\n", + "chloride and manganese dioxide next to the carbon cathode. The half cell\n", + "and net reactions with ammonium chloride are as follows\n", + "\n", + "*Eq. 8\u201174* Zn + 2NH3 \u2192\n", + "Zn(NH3)22+ + 2 e-\n", + "\n", + "*Eq. 8\u201175* 2NH4Cl + 2MnO2 + 2 e- \u2192\n", + "2NH3 + Mn2O3 +\n", + "H2O+2Cl\u2212\n", + "\n", + "*Eq. 8\u201176* Zn + 2MnO2 + 2NH4Cl \u2192\n", + "Mn2O3 +\n", + "Zn(NH3)2Cl2 + H2O.\n", + "\n", + "The electric potential of the reaction is, treating all compounds as\n", + "stoichiometric compounds\n", + "\n", + "Eq. 8\u201177\n", + "$\\varepsilon = - \\frac{\\mathrm{\\Delta}G}{2f} = - \\frac{\\mathrm{\\Delta}^{0}G}{2f} = \\frac{1}{2f}\\left(_{\\ }^{0}G^{Zn} + 2_{\\ }^{0}G^{{MnO}_{2}} + 2_{\\ }^{0}G^{{NH}_{4}Cl} -_{\\ }^{0}G^{H_{2}O} -_{\\ }^{0}G^{Zn\\left( {NH}_{3} \\right)_{2}{Cl}_{2}} -_{\\ }^{0}G^{{{Mn}_{2}O}_{3}} \\right)$.\n", + "\n", + "The Gibbs energy of $Zn\\left( {NH}_{3} \\right)_{2}{Cl}_{2}$ is not\n", + "available in current databases and has been recently estimated to be\n", + "\u2212505,375 J/mole-formula \\[62\\]. The value of at 298.15K is thus obtained\n", + "as 1.67 V, which is pretty close to the actual operating voltage of the\n", + "battery around 1.5 V.\n", + "\n", + "While with zinc chloride, the cell reactions and electric potential may\n", + "be written as\n", + "\n", + "Eq. 8\u201178 Zn + ZnCl2 + 2OH\u2212 \u2192 2ZnOHCl + 2\n", + "e-\n", + "\n", + "*Eq. 8\u201179* MnO2 + H2O + e- \u2192 MnOOH +\n", + "OH-\n", + "\n", + "*Eq. 8\u201180* Zn + 2 MnO2 + ZnCl2 + 2 H2O\n", + "\u2192 2 MnOOH + 2 ZnOHCl\n", + "\n", + "*Eq. 8\u201181*\n", + "$\\varepsilon = \\frac{1}{2f}\\left(_{\\ }^{0}G^{Zn} + 2_{\\ }^{0}G^{{MnO}_{2}} +_{\\ }^{0}G^{Zn{Cl}_{2}} + 2_{\\ }^{0}G^{H_{2}O} - 2_{\\ }^{0}G^{MnOOH} - 2_{\\ }^{0}G^{ZnOHCl} \\right)$\n", + "\n", + "Secondary batteries can be recharged by applying an external electrical\n", + "potential, which reverses the net cell reaction that occur during\n", + "discharging. The oldest form of rechargeable battery is the lead-acid\n", + "batteries used in automotive, and the latest development is the\n", + "lithium-ion (Li-ion) batteries. A lead-acid battery typically uses Pb\n", + "and PbO2 as the cathode and anode electrodes and a 35% sulfuric acid and\n", + "65% water solution as the electrolyte. Its anode and cathode reactions\n", + "can be simplified as follows\n", + "\n", + "Eq. 8\u201182 $Pb + SO_{4}^{2 -} = PbSO_{4} + 2e^{-}$\n", + "\n", + "Eq. 8\u201183 $PbO_{2} + 4H^{+} + SO_{4}^{2 -} + 2e^{-} = PbSO_{4} + 2H_{2}O$\n", + "\n", + "The net cell reaction is\n", + "\n", + "Eq. 8\u201184 $Pb + PbO_{2} + 2H_{2}SO_{4}^{\\ } = 2PbSO_{4} + 2H_{2}O$.\n", + "\n", + "Its electric potential is represented by the following equation\n", + "\n", + "*Eq. 8\u201185*\n", + "$\\varepsilon = - \\frac{1}{2f}\\left( 2_{\\ }^{0}G^{H_{2}O} + 2_{\\ }^{0}G^{{PbSO}_{4}} -_{\\ }^{0}G^{Pb} -_{\\ }^{0}G^{{PbO}_{2}} - 2_{\\ }^{0}G^{H_{2}SO_{4}} \\right)$\n", + "\n", + "with the value at 298.15K being 2.651 V calculated from Thermo-Calc\n", + "\\[60\\]. During discharging, the reaction goes to right, and $PbSO_{4}$\n", + "is formed on both anode and cathode, while during charging, the reaction\n", + "goes to the left, and $Pb$ and $PbO_{2}$ are restored. In practical\n", + "applications, other ionic species such as ${H_{3}O}^{+}$ and\n", + "$HSO_{4}^{-}$ may form in the electrolyte, complicating the reactions\n", + "and affecting its potential.\n", + "\n", + "In lithium ion batteries, lithium ions migrate in electrolytes between\n", + "electrodes made of intercalated lithium compounds during charging and\n", + "discharging. LiCoO2 and LiFePO4 are two of the\n", + "several cathode materials used in lithium ion batteries, and the anode\n", + "is typically made of carbon or metallic Li. The anode and cathode\n", + "reactions for LiCoO2 batteries can be written in simple forms as follows\n", + "\n", + "Eq. 8\u201186 ${Li}_{x}C_{6} = x{Li}^{+} + xe^{-} + 6C$\n", + "\n", + "Eq. 8\u201187 $x{Li}^{+} + xe^{-} + {Li}_{1 - x}CoO_{2} = LiCoO_{2}$\n", + "\n", + "with the net reaction and electric potential being\n", + "\n", + "Eq. 8\u201188 ${Li}_{x}C_{6} + {Li}_{1 - x}CoO_{2} = LiCoO_{2} + 6C$\n", + "\n", + "*Eq. 8\u201189*\n", + "$\\varepsilon = - \\frac{1}{xf}\\left\\{ 6_{\\ }^{0}G^{C} +_{\\ }^{0}G^{{LiCoO}_{2}} - G^{{{Li}_{x}C}_{6}} - G^{{{Li}_{1 - x}CoO}_{2}} \\right\\} = - \\frac{1}{f}\\left\\{ \\left( \\mu_{Li}^{{Li}_{1 - x}CoO_{2}} - \\mu_{Li}^{{Li}_{x}C} \\right) - \\frac{1}{x}\\left( \\mu_{LiCoO_{2}}^{{Li}_{1 - x}CoO_{2}} -_{\\ }^{0}G^{{LiCoO}_{2}} \\right) \\right\\}$\n", + "\n", + "The electric potential is a function of $x$. The value in the first\n", + "parenthesis in the above equation denotes the chemical potential\n", + "difference of Li between two electrodes, and the value in the second\n", + "parenthesis represents the chemical potential difference of\n", + "${LiCoO}_{2}$ between the states in the solution phase of\n", + "${Li}_{1 - x}CoO_{2}$ and by itself. Gibbs energies of ${{Li}_{x}C}_{6}$\n", + "and ${{Li}_{1 - x}CoO}_{2}$ need to be obtained as a function $x$ in\n", + "order to calculate the electric potential of the battery.\n", + "\n", + "LiFePO4 uses metallic lithium as the anode with following\n", + "half-cell and net cell reactions\n", + "\n", + "Eq. 8\u201190 $xLi = x{Li}^{+} + xe^{-}$\n", + "\n", + "Eq. 8\u201191 $x{Li}^{+} + xe^{-} + {Li}_{1 - x}FePO_{4} = LiFePO_{4}$\n", + "\n", + "Eq. 8\u201192 $xLi + {Li}_{1 - x}FePO_{4} = LiFePO_{4}$.\n", + "\n", + "Its electric potential is also a function of $x$, i.e.\n", + "\n", + "*Eq. 8\u201193*\n", + "$\\varepsilon = - \\frac{1}{xf}\\left\\{_{\\ }^{0}G^{LiFePO_{4}} - x\\ ^{0}G^{Li} - G^{{Li}_{1 - x}FePO_{4}} \\right\\} = - \\frac{1}{f}\\left\\{ \\left( \\mu_{Li}^{{Li}_{1 - x}FePO_{4}} - \\ ^{0}\\mu_{Li} \\right) - \\frac{1}{x}\\left( \\mu_{LiFePO_{4}}^{{Li}_{1 - x}FePO_{4}} -_{\\ }^{0}G^{LiFePO_{4}} \\right) \\right\\}$\n", + "\n", + "The value in the first parenthesis in the above equation denotes the\n", + "chemical potential difference of Li between two electrodes, and the\n", + "value in the second parenthesis represents the chemical potential\n", + "difference of $LiFePO_{4}$ between the states in the solution phase of\n", + "${Li}_{1 - x}FePO_{4}$ and by itself. Consequently, Gibbs energy of\n", + "${Li}_{1 - x}FePO_{4}$ needs to be obtained as a function $x$ in order\n", + "to calculate the electric potential of the battery. It is known that\n", + "there are several miscibility gaps in the $FePO_{4}$ and $LiFePO_{4}$\n", + "psuedo-binary system, in which the chemical potentials are constants, so\n", + "is the electric potential, resulting in stable battery output.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/aqueous_solution_and_pourbaix_diagram.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/aqueous_solution_and_pourbaix_diagram.ipynb new file mode 100644 index 0000000..f542ee5 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/aqueous_solution_and_pourbaix_diagram.ipynb @@ -0,0 +1,263 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "54708f15", + "cell_type": "markdown", + "source": [ + "## Aqueous solution and Pourbaix diagram\n", + "\n", + "The importance of aqueous solutions in all aspects of life is so well\n", + "known and needs not be discussed further. Since many electrochemical\n", + "processes involve electrolyte solutions in an aqueous solvent,\n", + "electrochemical processes including water, hydrogen, and/or oxygen are\n", + "discussed in more details. The hydrogen-oxygen cell can be described for\n", + "both acidic electrolytes and alkaline electrolytes. With acidic\n", + "electrolytes, H+ is in much higher concentrations than\n", + "OH-, and thus half-cell reactions with H+ as an\n", + "ionic transport species are more important than those involving\n", + "OH-. The reverse is true for alkaline electrolytes that\n", + "contain high OH-concentrations. Other than for nearly neutral\n", + "acid-base systems, either H+ or OH- dominates the\n", + "other by several orders of magnitude as can be seen from the value of\n", + "the 298 K dissociation constant for H2O:\n", + "\n", + "*Eq. 8\u201135* H2O(l) = H+(aq) + OH-(aq)\n", + "\n", + "with the reaction constant being Ke =\n", + "\\[H+\\]\\[OH-\\] = 10-14 and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G$= -RT *ln* Ke *\u03b2*= +79,908 J. By\n", + "convention, one defines pH = - log \\[H+\\] and pOH = - log\n", + "\\[OH-\\], and then pH + pOH = 14.\n", + "\n", + "Under acidic electrolyte conditions of low pH (high \\[H+\\]\n", + "concentrations) the anode reaction in a hydrogen-oxygen cell is:\n", + "\n", + "*Eq. 8\u201136* \u00bd H2(g) = H+(aq) + e-\n", + "\n", + "with \u03b51o = 0.0 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{1}$= 0 J. The corresponding cathode\n", + "(reduction) reaction is:\n", + "\n", + "*Eq. 8\u201137* 2 H+(aq) + \u00bd O2(g) + 2 e- =\n", + "H2O(l)\n", + "\n", + "with \u03b52o = 1.229 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{2}$ = -2\\*1.229\\*96,485 J = -237,160 J. The\n", + "net cell reaction for acidic electrolytes is:\n", + "\n", + "*Eq. 8\u201138* H2(g) + \u00bd O2(g) = H2O(l)\n", + "\n", + "with \u03b5ocell = 1.229 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{cell}$ = -2\\*1.229\\*96,485 J = -237,160 J\n", + "\n", + "Under alkaline electrolyte conditions of high pH (high\n", + "\\[OH-\\] concentrations) the anode reaction in a\n", + "hydrogen-oxygen cell is:\n", + "\n", + "*Eq. 8\u201139* 2 OH-(aq) + H2(g) = 2\n", + "H2O(l) + 2 e-\n", + "\n", + "with \u03b53o = 0.828 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{3}$= -2\\*0.828\\*96,485 J = -159,779 J. The\n", + "corresponding cathode (reduction) reaction is:\n", + "\n", + "*Eq. 8\u201140* H2O(l) + \u00bd O2(g) + 2 e- = 2\n", + "OH-(aq)\n", + "\n", + "with \u03b54o = 0.401 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{4}$ = -2\\*0.401\\*96,485 J = -77,381 J. The\n", + "net cell reaction for alkaline electrolytes is:\n", + "\n", + "*Eq. 8\u201141* H2(g) + \u00bd O2(g) = H2O(l)\n", + "\n", + "with \u03b5ocell = 1.229 V and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G_{cell}$ = -2\\*1.229\\*96,485 J = -237,160 J.\n", + "\n", + "Plots of \u03b5 versus pH for a given chemical system have been typically\n", + "used to exhibit the stability relationships of ionic species and solid\n", + "phases in aqueous-based electrochemical systems. These graphs are often\n", + "called Pourbaix diagrams after the inventor and are at constant\n", + "temperature and constant pressure diagrams for a constant concentration,\n", + "usually for one metallic element. By convention, the \u03b5 in a Pourbaix\n", + "diagram corresponds to the potential for the cathode reduction reactions\n", + "in the electrochemical half-cell with electrons as reactants. Pourbaix\n", + "diagrams can be extended to multi-component materials when thermodynamic\n", + "properties of the components are available in both the materials and the\n", + "aqueous solution.\n", + "\n", + "An example of an \u03b5 versus pH diagram is shown in for the\n", + "Ni-H2O system at a 298K, 1 bar, and $c_{{Ni}^{2 +}} = 0.001$\n", + "molality. Three stability regions for Ni species are shown: Ni(s),\n", + "NiO(s), and \\[Ni2+\\]. The two dashed lines on this diagram\n", + "correspond to hydrogen reduction () and oxygen reduction () reactions,\n", + "respectively.\n", + "\n", + "Figure \u2011: An \u03b5 versus pH, Pourbaix diagram for the Ni-H2O at\n", + "298K, 1 bar, and $c_{{Ni}^{2 +}} = 0.001$ molality.\n", + "\n", + "For the \u03b5 and pH conditions within the boundaries of the Ni(s) region,\n", + "no solid phase other than Ni(s) is stable, no ionic species with a\n", + "concentration of 1 molarity is stable, and no gas species with a\n", + "pressure of 1 bar is stable. Similar statements could be made about the\n", + "NiO(s) and \\[Ni2+\\] areas on the diagram. In the\n", + "\\[Ni2+\\] area, introduction of Ni(s) or NiO(s) into the\n", + "system would result in the dissolution of these solid phases since they\n", + "are not stable with respect to the \\[Ni2+\\] aqueous solution.\n", + "The corresponding chemical reactions proceed spontaneously to the right\n", + "as follows until the solid phases are consumed:\n", + "\n", + "*Eq. 8\u201142* Ni(s) \u2192 Ni2+(1 molarity) + 2 e-\n", + "\n", + "*Eq. 8\u201143* NiO(s) + 2 H+(aq) \u2192 Ni2+(1 molarity) +\n", + "H2O(l)\n", + "\n", + "No H+(aq) in involved in the first reaction, , so the\n", + "boundary line separating Ni(s) and Ni2+ is independent of pH.\n", + "No oxidation or reduction occurs in the second reaction, , i.e. no\n", + "electrons are reactants or products in the reaction, the boundary line\n", + "separating NiO(s) and Ni2+ is independent of \u03b5.\n", + "\n", + "Note the convention that the \u03b5 is the potential for a cathode reduction\n", + "reaction, and boundary lines between two stability regions depict\n", + "conditions under which partial equilibrium occurs for the two species\n", + "for the \u03b5 and pH values at any point on these lines. For the boundary\n", + "line separating Ni(s) and Ni2+ in an ideal aqueous solution,\n", + "i.e. the reverse of , the following equation is obtained.\n", + "\n", + "*Eq. 8\u201144* \u03b5 = \u03b5o = -0.268 V\n", + "\n", + "For the NiO(s)-Ni2+ boundary line of an ideal solution, the\n", + "reaction, , is a complete equilibrium, and thus the relationship is\n", + "\n", + "*Eq. 8\u201145*\n", + "$0 = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}} = \\mathrm{\\Delta}_{\\ }^{0}G + 2 \\cdot 2.303 \\cdot RT \\cdot pH$\n", + "\n", + "*Eq. 8\u201146*\n", + "$pH = - \\frac{\\mathrm{\\Delta}_{\\ }^{0}G}{2 \\cdot 2.303 \\cdot RT}$\n", + "\n", + "where $\\mathrm{\\Delta}_{\\ }^{0}G$ is obtained as follows and can be\n", + "calculated from the SSUB database and the standard potential of Ni,\n", + "\n", + "*Eq. 8\u201147*\n", + "\n", + "At a specified temperature, only one standard free energy and only one\n", + "equilibrium constant exists for this chemical reaction, and thus only\n", + "one specific value of $pH = 6.631$ exists for the reaction represented\n", + "by in this Pourbaix diagram.\n", + "\n", + "The diagonal line in represents the equilibrium between Ni(s) and NiO(s)\n", + "and is for a partial equilibrium reaction that is the sum of reactions\n", + "of and\n", + "\n", + "*Eq. 8\u201148* NiO(s) + 2 H+(aq) + 2 e- \u2550 Ni(s) +\n", + "H2O(l)\n", + "\n", + "The reduction of Ni from a divalent state in NiO to metallic Ni(s)\n", + "occurs, but the reaction also depends on the H+\n", + "concentration, the pH. The corresponding Gibbs energy and Nernst\n", + "equations are,\n", + "\n", + "*Eq. 8\u201149*\n", + "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}} = - 23,939 + 2 \\cdot 2.303 \\cdot RT \\cdot pH$\n", + "\n", + "*Eq. 8\u201150*\n", + "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{2f}\\ln\\frac{1}{\\left( c_{H^{+}} \\right)^{2}}\\ = 0.124\\ \u2013\\ \\frac{2.303 \\cdot RT}{f}pH$\n", + "\n", + "where $\\mathrm{\\Delta}_{\\ }^{0}G$ can be calculated as follows\n", + "\n", + "*Eq. 8\u201151*\n", + "\n", + "The two additional lines in correspond to the reduction reactions\n", + "related to H2 and O2 gases, i.e. the stability of\n", + "H2O. The lower one is for the reverse of under \u03b5o\n", + "= 0 and $P_{H_{2}} = 1$ with the Nernst equation being\n", + "\n", + "*Eq. 8\u201152*\n", + "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{f}\\ln\\frac{\\left( P_{H_{2}} \\right)^{1/2}}{c_{H^{+}}}\\ = - \\frac{2.303 \\cdot RT}{f}pH$\n", + "\n", + "As the pH increases from 0, \u03b5 becomes more negative as is depicted. The\n", + "top dashed line corresponds to the oxygen reduction reaction represented\n", + "by under \u03b5o = 1.225 calculated from the aqueous solution\n", + "database in Thermo-Calc \\[60\\] and $P_{O_{2}} = 1$ with the Nernst\n", + "equation being\n", + "\n", + "Eq. 8\u201153\n", + "$\\varepsilon\\ = \\ \\varepsilon^{0}\\ - \\ \\frac{RT}{2f}\\ln\\frac{\\left( P_{O_{2}} \\right)^{1/2}}{\\left( c_{H^{+}} \\right)^{2}}\\ = 1.225\\ \u2013\\ \\frac{2.303 \\cdot RT}{f}pH$\n", + "\n", + "The dependence of \u03b5 on pH is identical for both reduction reaction and ,\n", + "and their intercepts at $pH = 0$ differ by their difference in their\n", + "\u03b5o values.\n", + "\n", + "In this simple Pourbaix diagram of Ni in an ideal aqueous solution, all\n", + "boundary lines are straight because there is only one ionic species of\n", + "Ni in the aqueous solution, i.e. Ni2+. When there are more\n", + "than one ionic species in the aqueous solution, the boundary lines may\n", + "no longer be straight due to the competition between species. One\n", + "example is Cu with two main ionic species of Cu+2 and\n", + "CuOH+, and the reduction reaction between the metallic Cu and\n", + "the aqueous solution involves both two species, i.e.\n", + "\n", + "*Eq. 8\u201154*\n", + "${xCu}^{2 + \\ }\\ + \\ (1 - x){CuOH}^{+} + (1 - x)H^{+} + 2\\ e - \\ \\ = \\ \\ Cu(s) + {(1 - x)H}_{2}O$\n", + "\n", + "with\n", + "\n", + "*Eq. 8\u201155*\n", + "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}}c_{H^{+}} \\right)^{1 - x}} = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}} \\right)^{1 - x}} + 2.303(1 - x) \\cdot RT \\cdot pH$\n", + "\n", + "*Eq. 8\u201156*\n", + "$\\varepsilon = \\varepsilon^{0} - \\frac{RT}{2f}\\ln\\frac{1}{\\left( c_{{Cu}^{2 +}} \\right)^{x}\\left( c_{{CuOH}^{+}} \\right)^{1 - x}} - \\frac{2.303(1 - x) \\cdot RT}{2f}pH$.\n", + "\n", + "It is evident that both the slope and the intercept at $pH = 0$ are a\n", + "function of the concentration of ${CuOH}^{+}$, which is a function of\n", + "$pH$. Consequently, the boundary between the metallic Cu and the aqueous\n", + "solution is no longer a straight line as shown in .\n", + "\n", + "Figure \u2011: An \u03b5 versus pH, Pourbaix diagram for the Cu-H2O\n", + "system at 298K, 1 bar, and $c_{Cu} = 0.001$ molality.\n", + "\n", + "The concentrations of various species in the aqueous solution, i.e.\n", + "commonly called speciation, are plotted in , showing the change of\n", + "dominant species as a function of pH value.\n", + "\n", + "Figure \u2011: Concentrations of ionic species in the aqueous solution at\n", + "$\\varepsilon = 0.3\\ V$ from .\n", + "\n", + "In Pourbaix diagrams for alloys with two or more elements, activities of\n", + "individual elements are to be used in calculating the potentials of\n", + "reduction reactions. Considering a Fe-Ni alloy with Fe2+ and\n", + "Ni2+ in the aqueous solution, the reduction reactions for Fe\n", + "and Ni can be written separately as\n", + "\n", + "*Eq. 8\u201157* Ni2+(cNi) + 2 e- \u2192 Ni\n", + "(aNi in alloy)\n", + "\n", + "*Eq. 8\u201158* Fe2+(cFe) + 2 e- \u2192 Fe\n", + "(aFe in alloy)\n", + "\n", + "with their potentials as\n", + "\n", + "*Eq. 8\u201159*\n", + "$\\varepsilon_{Ni}\\ = \\ \\varepsilon_{Ni}^{0} - \\frac{2.303RT}{2f}\\ln\\frac{a_{Ni}}{c_{Ni}} = \\ - 0.268 - \\frac{2.303RT}{2f}\\ln\\frac{a_{Ni}}{c_{Ni}}$\n", + "\n", + "*Eq. 8\u201160*\n", + "$\\varepsilon_{Fe}\\ = \\ \\varepsilon_{Fe}^{0} - \\frac{2.303RT}{2f}\\ln\\frac{a_{Fe}}{c_{Fe}} = \\ - 0.441 - \\frac{2.303RT}{2f}\\ln\\frac{a_{Fe}}{c_{Fe}}$\n", + "\n", + "In principle, there are two scenarios for a given set of $a_{Ni}$ and\n", + "$a_{Fe}$ of the alloy. The first scenario is at the limit of a dilute\n", + "aqueous solution, i.e. $c_{Ni} = c_{Fe} = 0.001\\ $molarity,\n", + "$\\varepsilon_{Ni}$ and $\\varepsilon_{Fe}$ can be calculated, and the\n", + "element with the lower potential has the tendency to dissolve first,\n", + "which can result in the so-called dialloying effect. The second scenario\n", + "is for the equal potential, i.e. $\\varepsilon_{Ni} = \\varepsilon_{Fe}$\n", + "due to the externally imposed potential, and the equilibrium\n", + "concentrations of Fe+2 and Ni+2 can be calculated\n", + "from and .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/concentrations_activities_and_reference_states_of_electrolyte_species.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/concentrations_activities_and_reference_states_of_electrolyte_species.ipynb new file mode 100644 index 0000000..c173033 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/concentrations_activities_and_reference_states_of_electrolyte_species.ipynb @@ -0,0 +1,79 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "0dbe4f22", + "cell_type": "markdown", + "source": [ + "## Concentrations, activities, and reference states of electrolyte species\n", + "\n", + "Thermodynamic descriptions of ionic species in solutions are different\n", + "from those of neutral species, which leads to a need for defining\n", + "concentration units, standard states, activities, and activity\n", + "coefficients of ionic solutions. In most studies of electrochemical\n", + "corrosion and electrodeposition, and in applied work of electrochemical\n", + "engineers, ionic species concentrations are given in units of molarity,\n", + "the number of moles of a species in a liter of solution (mol/l)\n", + "symbolically represented in equations by either *ci* or\n", + "\\[M+Z\\]. The other common concentration used for ionic\n", + "species is molality, which is defined as the number of moles of a\n", + "species in 1000g of solvent. For dilute aqueous solutions, molarity and\n", + "molality values are very similar.\n", + "\n", + "As discussed in Chapter , a practical definition of the activity of a\n", + "species *i* is the thermodynamic reactivity, or tendency to react, of\n", + "species *i* in the system of interest as compared to *i* in its\n", + "reference state form. The reference state of a species is typically\n", + "chosen as a specific chemical/physical state of the species at 1 atm\n", + "external pressure and the temperature of interest. Similarly, a typical\n", + "reference state for ionic species in aqueous solutions is the 1 molar\n", + "ideal solution at 1 bar external pressure and the temperature of\n", + "interest. If an electrolyte solution behaves ideally, then the activity\n", + "of species *i* in solution is\n", + "\n", + "*Eq. 8\u20116*\n", + "$a_{i} = \\frac{c_{i}\\left( \\frac{mol}{l} \\right)}{c_{i}^{0}\\left( \\frac{mol}{l} \\right)} = \\frac{c_{i}\\left( \\frac{mol}{l} \\right)}{1\\left( \\frac{mol}{l} \\right)} = c_{i}(dimensionless)$\n", + "\n", + "where $c_{i}$ is the molar concentration of *i* in the solution divided\n", + "by $c_{i}^{0}$, the 1 molar reference state ideal solution\n", + "concentration. Thus, in ideal solutions, the activity of an electrolyte\n", + "species is numerically equal to its molar concentration. The above\n", + "treatment of ionic species is equivalent to the common practice of\n", + "depicting the activity of a gas by the value of its ideal gas partial\n", + "pressure in units of bar.\n", + "\n", + "The activity coefficient corrects for the nonideality of the species in\n", + "solution as defined in . If the solution is ideal, $\\gamma_{i} = 1$ for\n", + "all concentrations of a species in solution. For all solutions, one\n", + "expects $\\gamma_{i} \\rightarrow 1$ as $c_{i} \\rightarrow 1$. It is not\n", + "possible to measure $\\gamma_{i^{+}}$ or $\\gamma_{i^{-}}$ for individual\n", + "charged ions, only a geometric mean of the positive and negative ion\n", + "values. Consider the following ionic solution\n", + "\n", + "Eq. 8\u20117\n", + "\n", + "Its chemical potential can be written as\n", + "\n", + "*Eq. 8\u20118*\n", + "\n", + "Its geometric average or mean activity and activity coefficient are\n", + "defined as\n", + "\n", + "*Eq. 8\u20119*\n", + "\n", + "*Eq. 8\u201110*\n", + "\n", + "For example, one can define\n", + "$\\gamma_{\\pm} = \\left( \\gamma_{{Na}^{+}}\\gamma_{{Cl}^{-}} \\right)^{1/2}$\n", + "and\n", + "$\\gamma_{\\pm} = \\left( \\gamma_{{Al}^{3 +}}^{2}\\gamma_{{{SO}_{4}}^{2 -}}^{3} \\right)^{1/5}$\n", + "for NaCl and Al2(SO4)3, respectively.\n", + "For idea, weak electrolytes, $\\gamma_{\\pm} = 1$, and for non-ideal,\n", + "strong electrolytes, $\\gamma_{\\pm} \\neq 1$.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/electrochemical_cells_and_half_cell_potentials.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/electrochemical_cells_and_half_cell_potentials.ipynb new file mode 100644 index 0000000..707ab02 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/electrochemical_cells_and_half_cell_potentials.ipynb @@ -0,0 +1,306 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "0fbd6eac", + "cell_type": "markdown", + "source": [ + "## Electrochemical cells and half cell potentials\n", + "\n", + "An electrochemical system must fulfill certain requirements in order to\n", + "apply equilibrium thermodynamic descriptions of the system, including\n", + "\n", + "- The cell must be reversible when slight changes in conditions\n", + " (potentials, concentrations, pressures, temperature) cause\n", + " electrochemical reactions and an external flow of electrons to occur\n", + " in the direction needed to re-establish equilibrium.\n", + "\n", + "- All non-electrochemical reactions in the system must be prevented as\n", + " such reactions would cause a shift in equilibrium without causing a\n", + " shift in cell potential and thus a driving force for external electron\n", + " flow.\n", + "\n", + "- Chemical reactions must occur only when an external current flows.\n", + " These finite distances for external electron transport can be a short\n", + " as grain size-dimensions in many corrosion reactions, or this\n", + " transport may be through an external electrical conductor connecting\n", + " the anode and cathode half-cell as in batteries.\n", + "\n", + "- Charge balance as well as mass balance is required of all reactions.\n" + ], + "metadata": {} + }, + { + "id": "6e9264ef", + "cell_type": "markdown", + "source": [ + "### Electrochemical cells\n", + "\n", + "A potential difference, i.e. voltage difference, can be generated\n", + "between the electrodes in a cell from differences in the potentials of\n", + "the half-cell reactions. This potential can originate from potential\n", + "differences of two chemically different half-cells (a *galvanic cell*),\n", + "or concentration differences in two otherwise identical half-cells (a\n", + "*concentration cell*). Each type of cell is illustrated below.\n", + "\n", + "The reaction between copper ions and zinc illustrated below represents\n", + "the *net cell reaction* of a *galvanic* cell in which the oxidation of\n", + "Zn(s) occurs at the *anode* electrode, and the reduction of\n", + "Cu+2 occurs at the *cathode* electrode\n", + "\n", + "*Eq. 8\u201111* Cu2+(aq) + Zn(s) = Cu(s) + Zn2+(aq).\n", + "\n", + "The reaction at each electrode, the *half-cell reaction*, includes ions\n", + "and electrons as reactant and/or product species. The anode, oxidation\n", + "reaction is represented by\n", + "\n", + "*Eq. 8\u201112* Zn(s) = Zn2+(aq) + 2 e-.\n", + "\n", + "Electrons are products of anode reactions and flow externally from anode\n", + "to cathode. By convention the activities of the electrons in an\n", + "equilibrium cell are taken as unity. The cathode, reduction reaction is\n", + "written as\n", + "\n", + "*Eq. 8\u201113* Cu2+(aq) + 2 e- = Cu(s)\n", + "\n", + "Electrons are reactants of cathode reactions and supplied by an external\n", + "flow from the anode. In addition to consuming electrons at the cathode\n", + "at the same rate as they are produced at the anode, charge balance is\n", + "maintained in the electrolyte by the generation of Zn2+ ions\n", + "at the same rate that Cu2+ ions are consumed. A schematic\n", + "diagram in illustrates the simple physical relationships in such an\n", + "electrochemical cell.\n", + "\n", + "Figure \u2011: Schematic diagram of a galvanic electrochemical cell\n", + "consisting of a zinc electrode and a copper electrode.\n", + "\n", + "A concentration cell in which an electrochemical potential is developed\n", + "because of concentration differences between otherwise equivalent anode\n", + "and cathode reactions is illustrated below. Such a cell can be produced\n", + "by the oxidation and reduction of copper at two separate electrodes as\n", + "is depicted in the following reactions\n", + "\n", + "*Eq. 8\u201114* Cu(s) = Cu2+(aq, ca) + 2 e- (anode)\n", + "\n", + "*Eq. 8\u201115* Cu2+(aq, cb) + 2 e- = Cu(s) (cathode)\n", + "\n", + "where ca and cb are the respective concentrations\n", + "of Cu2+ in the aqueous solutions at the anode and cathode,\n", + "and ca \\< cb. The net cell reaction is\n", + "\n", + "*Eq. 8\u201116* Cu2+(aq, cb) = Cu2+(aq,\n", + "ca)\n", + "\n", + "where the reaction occurs spontaneously to decrease cb and to\n", + "increase ca until the two concentrations become the same,\n", + "cb = ca. A schematic diagram of such a cell is\n", + "shown in .\n", + "\n", + "Figure \u2011: Schematic diagram of a concentration electrochemical cell\n", + "consisting of two copper electrodes.\n", + "\n", + "A semi-impermeable membrane, or a salt bridge, must exist in such a cell\n", + "to maintain charge balance. As Cu+2 ions are produced at the\n", + "anode and consumed at the cathode, the negatively charged ions in the\n", + "solution, for example Cl-, must be transferred from the\n", + "cathode region to the anode region of the cell to maintain electrically\n", + "neutral solutions.\n", + "\n", + "The above concentration cell provides a good example for illustrating a\n", + "standard notation for depicting an electrochemical cell. This cell can\n", + "be represented by .\n", + "\n", + "Figure \u2011: Standard notation of an electrochemical cell\n", + "\n", + "The anode where oxidation occurs is always denoted on the left, and the\n", + "cathode where reduction occurs is on the right. A *single line*\n", + "separating phases denotes an *interface* between two phases. The above\n", + "anode electrode and reaction of are symbolically represented by\n", + "\n", + "*Eq. 8\u201117* \\| Cu(s) \\| Cu2+(ca).\n", + "\n", + "The interface between the external conductor and Cu(s) is depicted by\n", + "the single line to the left of Cu(s), while the single line between the\n", + "Cu(s) and Cu2+(ca) depicts the interface between\n", + "the anode electrode and the electrolyte solution. Similarly, the cathode\n", + "electrode and reaction of are symbolically represented by\n", + "\n", + "*Eq. 8\u201118* Cu2+(cb) \\| Cu(s) \\|.\n", + "\n", + "A double line between the two copper ions in the notation denotes a\n", + "physical separation of two solution phases, the anode and cathode\n", + "electrolyte regions that exhibit different concentrations of copper ions\n", + "\n", + "*Eq. 8\u201119* Cu2+(ca) \\| \\|\n", + "Cu2+(cb).\n", + "\n", + "These solution phases are physically connected by a semi-impermeable\n", + "membrane or salt bridge that allows a common negative ion, for example\n", + "Cl-, of the solution phases to diffuse from one region to the\n", + "other in order to maintain charge balance as the cell reaction occurs.\n", + "The Cu2+ ions cannot be transported from one region to the\n", + "other.\n" + ], + "metadata": {} + }, + { + "id": "e194b4c0", + "cell_type": "markdown", + "source": [ + "### Half cell potentials\n", + "\n", + "When electron current flows between electrodes, reactions are occurring\n", + "at the electrodes and concentration gradients causing polarization\n", + "develop around the electrodes. These gradients result in extraneous\n", + "potentials to occur at the electrodes. In such cases cell equilibrium is\n", + "not established and measured cell potentials are not those for true\n", + "partial equilibrium. If a cell is short-circuited with the electrodes\n", + "connected by a conductor, current will flow until the external potential\n", + "becomes zero, i.e. \u03b5ext = 0, and equilibrium is established\n", + "with same conditions as non-electrochemical systems. If an external\n", + "potential, \u03b5ext, is applied to the cell, chemical reactions\n", + "occur until the cell potential balances to \u03b5ext, and no\n", + "current flows. This potential is called open-circuit voltage (OCV) in\n", + "the literature. It is important to realize that OCV includes all\n", + "reactions that occur on the electrode surface when the electrode is in\n", + "contact with the electrolyte, such as passivation discussed in Chapter .\n", + "Partial equilibrium in a cell is achieved when the cell potential is\n", + "balanced by an applied external potential. In such partial equilibrium\n", + "cases, equilibrium thermodynamic analyses can be used even though the\n", + "cell potential is not zero, i.e. \u03b5cell \u2260 0. This\n", + "differentiates electrochemical systems from other equilibrium systems\n", + "discussed previously.\n", + "\n", + "The number of electrons involved in a net cell reaction is important in\n", + "relating cell potential and the Gibbs energy change for the cell\n", + "reaction. As will be illustrated later in this section, this number\n", + "denotes the number of electrons involved in the half-cell reactions that\n", + "were added to yield the net cell reaction. The electrical work achieved\n", + "by the transport of an electrical charge through a cell potential can be\n", + "written as\n", + "\n", + "*Eq. 8\u201120* $w = z\\ f\\ \\varepsilon$\n", + "\n", + "where *z* represents the moles of electrons in cell reaction, *f* the\n", + "Faraday constant equal to 96,485 J/V/mole-electron, and *\u03b5* the\n", + "potential difference, often referred as electromotive force (emf) in the\n", + "literature. For a system at constant temperature, pressure, and\n", + "composition, this work is the same as the Gibbs energy difference\n", + "between the two electrodes, i.e.\n", + "\n", + "*Eq. 8\u201121* $- \\Delta G = w = zf\\varepsilon$\n", + "\n", + "where the negative sign is because the system does work to the\n", + "surrounding when the Gibbs energy of the system is decreased. When the\n", + "applied external potential is larger than the cell potential, the\n", + "surrounding does work to the system, and a common example is the\n", + "charging of a battery. Thermodynamic relations discussed in previous\n", + "chapters can thus be directly applied to electrochemical systems with\n", + "some common equations shown in .\n", + "\n", + "Table \u2011: Thermodynamic Equations for Electrochemical Cells\n", + "\n", + "*\u2206G = -z f \u03b5*\n", + "\n", + "*\u2206S = - (\u2202\u2206G/\u2202T)P = + z f (\u2202\u03b5/\u2202T)P*\n", + "\n", + "*\u2206H = \\[\u2202(\u2206G/T)/ \u2202(1/T)\\]P = - z f \\[\u2202(\u03b5/T)/\u2202(1/T)\\]P = z f \\[T(\u2202\u03b5/\u2202T)P\n", + "\u2013 \u03b5\\]*\n", + "\n", + "*\u2206CP = (\u2202\u2206H/\u2202T)P = T z f (\u22022\u03b5/\u2202T2)P*\n", + "\n", + "A half-cell reaction potential cannot be measured directly, only its\n", + "potential relative to another half-cell reaction. By convention, a\n", + "standard half-cell potential is measured relative to the standard\n", + "hydrogen half-cell reduction reaction at 25oC (298K) and 1\n", + "bar, which has a defined standard potential of zero volts,\n", + "\n", + "*Eq. 8\u201122* H+(aq, a=1) + e- = 1/2 H2(g,\n", + "1 bar)\n", + "\n", + "with \u03b5o (H+/H2,g) = 0.00 volts. The\n", + "standard half-cell reduction reactions of metals at 25oC are\n", + "for the general reaction\n", + "\n", + "*Eq. 8\u201123* Mz+(aq, a=1) + z e- = M(s)\n", + "\n", + "with \u03b5o (Mz+/M) volts. Half-cell reactions with\n", + "the most positive standard electrode potentials have a tendency to\n", + "spontaneously proceed toward reduction (cathode reactions). Half-cell\n", + "reactions with the most negative standard electrode potentials have a\n", + "tendency to spontaneously proceed toward oxidation (anode reactions).\n", + "\n", + "Consider, for example, a cell made up of a standard hydrogen electrode\n", + "and a standard zinc electrode with \u03b5o\n", + "(H+/H2,g) = 0.00 volts and \u03b5o\n", + "(Zn2+/Zn) = -0.762 volts. Thus, the H+ would tend\n", + "to be reduced, and the zinc metal would tend to be oxidized, and the\n", + "spontaneous reaction if all species had unit activities would be\n", + "\n", + "*Eq. 8\u201124* 2 H+(aq, a=1)+ Zn = H2(1 bar) +\n", + "Zn2+(aq, a=1)\n", + "\n", + "with \u03b5ocell = 0.762 volts and\n", + "$\\mathrm{\\Delta}_{\\ }^{0}G = - 2*96485*\\varepsilon_{cell}^{0}\\ $. The\n", + "cathode half-cell reaction would be the same as , while the anode\n", + "half-cell reaction would be\n", + "\n", + "*Eq. 8\u201125* Zn = Zn2+(aq, a=1) + 2 e-\n", + "\n", + "When ion concentrations and H2 gas do not all have unit\n", + "activities, the Gibbs energy and cell potential of the cell reaction, ,\n", + "becomes\n", + "\n", + "*Eq. 8\u201126*\n", + "$\\mathrm{\\Delta}G = \\mathrm{\\Delta}_{\\ }^{0}G + RTln\\frac{a_{{Zn}^{2 +}}P_{H_{2}}}{\\left( a_{H^{+}} \\right)^{2}}$\n", + "\n", + "*Eq. 8\u201127*\n", + "$\\varepsilon_{cell} = \\varepsilon_{cell}^{0} - \\frac{RT}{zf}\\ln\\frac{a_{{Zn}^{2 +}}P_{H_{2}}}{\\left( a_{H^{+}} \\right)^{2}}$\n", + "\n", + "The standard reduction potentials of some common metals at\n", + "25oC are given in .\n", + "\n", + "Table \u2011: Standard reduction potentials of some common metals\n", + "\n", + "A cell reaction can be established by different half-cell reactions. For\n", + "example, the following reaction can be derived from two different cells\n", + "\n", + "*Eq. 8\u201128* $3\\ {Fe}^{2 + \\ }\\ = \\ \\ 2\\ {Fe}^{3 +}\\ \\ + \\ \\ Fe(s)$\n", + "\n", + "cell A\n", + "\n", + "*Eq. 8\u201129* $3{Fe}^{2 +} + \\ 6\\ e - \\ = \\ \\ 3Fe(s)$ \u03b5o1 =\n", + "-0.440 V\n", + "\n", + "*Eq. 8\u201130* $2\\ Fe(s)\\ \\ = \\ \\ 2\\ {Fe}^{3 +}\\ \\ + \\ 6\\ e -$\n", + "\u03b5o2 = +0.036 V\n", + "\n", + "cell B\n", + "\n", + "*Eq. 8\u201131* $2{Fe}^{2 +}\\ = \\ 2{Fe}^{3 + \\ \\ } + 2\\ e^{-}$\n", + "*\u03b5o4 = -0.772 V*\n", + "\n", + "*Eq. 8\u201132* ${Fe}^{2 + \\ }\\ + \\ 2\\ e - \\ \\ = \\ \\ Fe(s)$ *\u03b5o5\n", + "= -0.440 V*\n", + "\n", + "Both give the same net reaction shown by , but with 6 and 2 electrons\n", + "and standard cell potentials being \u03b5ocell A = -0.404 V and\n", + "\u03b5ocell B = -1.212 V, respectively. However, the standard\n", + "Gibbs energies of both cells are the same, i.e.\n", + "\n", + "*Eq. 8\u201133* $\\mathrm{\\Delta}_{\\ }^{0}G$*cell A = -6 f (-0.404)\n", + "= + 2.424 f*\n", + "\n", + "*Eq. 8\u201134* $\\mathrm{\\Delta}_{\\ }^{0}G$*cell B = -2 f (-1.212)\n", + "= + 2.424 f*\n", + "\n", + "It is shown that $\\mathrm{\\Delta}_{\\ }^{0}G$ values are independent of\n", + "half-cell reactions and depend only on the net reaction because the net\n", + "reaction is neutral in electron and balanced in mass.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/electrolyte_reactions_and_electrochemical_reactions.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/electrolyte_reactions_and_electrochemical_reactions.ipynb new file mode 100644 index 0000000..cb1a075 --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/electrolyte_reactions_and_electrochemical_reactions.ipynb @@ -0,0 +1,90 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "db31d1be", + "cell_type": "markdown", + "source": [ + "## Electrolyte reactions and electrochemical reactions\n", + "\n", + "Electrolytes that dissolve in a polar solvent such as water to produce\n", + "ionic species do not necessarily exhibit valence changes. A simple\n", + "example is the strong electrolyte NaCl(s) dissolving in water to produce\n", + "solvated ions\n", + "\n", + "*Eq. 8\u20111* $NaCl(s)\\ \\ = \\ \\ {Na}^{+}(aq)\\ \\ + \\ \\ {Cl}^{\u2013}(aq)$\n", + "\n", + "where the $(aq)$ indicates the ionic species in an aqueous solution. In\n", + "this system, the ion concentrations must become quite large before the\n", + "solution is saturated and can exist in equilibrium with $NaCl(s)$. Its\n", + "reaction constant, defined by , is shown as\n", + "$K_{e} = \\ \\ a_{{Na}^{+}}a_{{Cl}^{-}}$. If the product of the ion\n", + "activities is less than $K_{e}$, the solution is not saturated, and more\n", + "$NaCl(s)\\ \\ $ can be dissolved.\n", + "\n", + "The precipitation of $AgCl(s)$, a weak electrolyte, occurs quite readily\n", + "when ${Cl}^{\u2013}$ ions are added to an aqueous solution containing\n", + "${Ag}^{+}(aq)$:\n", + "\n", + "*Eq. 8\u20112* ${Ag}^{+}(aq)\\ + \\ \\ {Cl}^{\u2013}(aq)\\ = AgCl(s)$\n", + "\n", + "The equilibrium constant for this reaction,\n", + "$K_{e} = \\ \\frac{1}{\\left( a_{{Ag}^{+}}a_{{Cl}^{-}} \\right)}$ is quite\n", + "large, so the equilibrium product of the ion activities, proportional to\n", + "their concentrations, is quite small. In the laboratory, the above\n", + "reaction could occur as a result of adding hydrochloric acid to a silver\n", + "nitrate solution. The accompanying $H^{+}(aq)$ \\[or ${H_{3}O}^{+}(aq)$\\]\n", + "and ${NO_{3}}^{-}(aq)$ ions in solution are not directly involved in the\n", + "silver chloride precipitation reaction so are not shown in reaction\n", + "represented by .\n", + "\n", + "The above ionic equilibria in the $AgCl(s) - H_{2}O$ system is not only\n", + "important for understanding this electrolyte system, but also critical\n", + "in electrochemical systems in which *Ag(s)* undergoes a valence change\n", + "at one electrode and reacts with a ${Cl}^{\u2013}(aq)$ ion to produce\n", + "*AgCl(s)*, and an electron that is externally transported finite\n", + "distances to another electrode. The *oxidation* reaction occurs at the\n", + "Ag/AgCl electrode (*anode* half-cell reaction where electrons are\n", + "*added* into the system)\n", + "\n", + "*Eq. 8\u20113* $Ag(s)\\ \\ + \\ {Cl}^{-}(aq)\\ \\ = \\ \\ AgCl(s)\\ \\ + \\ \\ e^{-}$\n", + "\n", + "A *reduction* reaction occurs at the other electrode (*cathode*\n", + "half-cell reaction where electrons are *consumed* by the reaction)\n", + "\n", + "*Eq. 8\u20114* $\\frac{1}{2}{Cl}_{2}(g) + \\ \\ e^{-} = \\ {Cl}^{-}(aq)\\ \\ $\n", + "\n", + "The *net cell reaction* results in the formation AgCl(s) from its\n", + "elements\n", + "\n", + "*Eq. 8\u20115* $Ag(s)\\ \\ + \\frac{1}{2}{Cl}_{2}\\ (g)\\ = \\ \\ AgCl(s)$\n", + "\n", + "Without knowledge of the physical system under which the reaction is\n", + "occurring, it would not be possible to know if reaction of was a result\n", + "of chlorine gas reacting directly with Ag(s), or if the reaction was\n", + "part of an electrochemical cell with a transport of electrons and ions\n", + "over finite distances. The addition of the two half-cell reactions gives\n", + "the *net cell reaction*, which does not show electrons as either\n", + "reactant or product species and may or may not include ionic species in\n", + "the reaction*.* A schematic of an electrochemical cell for the above\n", + "system is shown in Figure 8\u20111.\n", + "\n", + "Figure \u2011: Schematic diagram of an electrochemical cell consisting of a\n", + "chlorine electrode and a silver-silver chloride electrode.\n", + "\n", + "Oxidation and reduction can occur in electrolyte reactions without\n", + "creating an electrochemical cell. This is the case when chlorine gas\n", + "reacts directly with silver on a Ag(s) surface. Reaction of above is the\n", + "net reaction for this process, but the electrons produced from the\n", + "oxidation of Ag(s) are not transported over finite distances before\n", + "combining with Cl2(g) in its reduction to Cl\u2013(aq).\n", + "No anode or cathode half-cell reactions exist in this system. The\n", + "electrons and ions involved in the reaction move only over atomic-scale\n", + "distances.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/applications_to_electrochemical_systems/index.ipynb b/src/psu410/src/psu410/applications_to_electrochemical_systems/index.ipynb new file mode 100644 index 0000000..c7d54fe --- /dev/null +++ b/src/psu410/src/psu410/applications_to_electrochemical_systems/index.ipynb @@ -0,0 +1,33 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "3bb06c52", + "cell_type": "markdown", + "source": [ + "# Applications to electrochemical systems\n", + "\n", + "The two basic types of chemical processes involving ions as reactant\n", + "and/or product species are electrolyte reactions and electrochemical\n", + "reactions. *Electrolyte reactions* are accompanied by the *atomic-scale\n", + "movement* of ionic species and possibly electrons. Chemical changes that\n", + "produce changes in valence and *electron and ion transport over finite\n", + "distances* constitute an area of science termed *electrochemistry*. The\n", + "latter chemical changes occur in an electrochemical cell comprised of\n", + "two electrodes, an anode and a cathode, which are coupled by an\n", + "electrolyte and an external electron conductor. Most thermodynamic\n", + "concepts and analyses described in previous chapters remain unchanged\n", + "when applied to electrochemistry, but the analysis of electrochemical\n", + "systems does require some new terminology, new definitions, and new\n", + "conventions. The primary focus of this chapter is on applications of\n", + "thermodynamics to electrochemical reactions that involve either aqueous\n", + "electrolyte solutions or solid state electrolytes. Since all\n", + "electrochemical systems include ionized species as reactant and/or\n", + "product species, electrolyte reactions will also be discussed.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/importance_of_lattice_stability.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/importance_of_lattice_stability.ipynb new file mode 100644 index 0000000..d559428 --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/importance_of_lattice_stability.ipynb @@ -0,0 +1,121 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "46bb1c6e", + "cell_type": "markdown", + "source": [ + "## Importance of lattice stability\n", + "\n", + "For modeling of Gibbs energy of individual phases, it is necessary to\n", + "define the values of $_{\\ }^{0}G_{i}$ in . However, the independent\n", + "component *i* may not be stable in the crystal structure of the phase\n", + "under consideration, so its Gibbs energy could not be obtained directly\n", + "from experiments and must be estimated with respect to the Gibbs energy\n", + "of their stable crystal structure. In the pioneering work by Kaufman\n", + "\\[47\\], this Gibbs energy difference was termed as lattice stability and\n", + "obtained through extrapolations in either temperature-pressure or\n", + "temperature-composition phase diagrams. It is evident from that the\n", + "values of $_{\\ }^{0}G_{i}$ and $_{\\ }^{M}G$ jointly contribute to the\n", + "Gibbs energy of the solution, and Kaufman had to simplify the treatment\n", + "of $_{\\ }^{M}G$ in order to show the importance of the concept of\n", + "lattice stability. Using ideal or regular solution models, Kaufman was\n", + "able to define the lattice stability for pure elements and remarkably\n", + "reproduce many features of binary phase diagrams by introducing the\n", + "interaction parameters afterwards.\n", + "\n", + "Over the years, there had been various revisions of lattice stability\n", + "values for common crystal structures \\[48\\], and every revision\n", + "necessitates the re-evaluation of interaction parameters in the solution\n", + "phase shown in . It was until the lattice stability values established\n", + "by the Scientific Group Thermodata Europe (SGTE) \\[52\\] that the\n", + "development of binary thermodynamic models using the same thermodynamic\n", + "models of pure elements became possible, and those binary models thus\n", + "developed in different groups around the world can be combined to create\n", + "thermodynamic models of ternary and multi-component systems. Clearly,\n", + "any further modifications of the SGTE pure element database will require\n", + "the re-modeling of all binary and ternary systems in which the models of\n", + "pure elements are changed. This challenge is briefly addressed in the\n", + "later part of this chapter.\n", + "\n", + "A less addressed issue is the Gibbs energy of end-members in\n", + "non-stoichiometric compounds, i.e. , where each sublattice contains only\n", + "one element. In case all sublattices are occupied by the same element,\n", + "it is the lattice stability of the elements in the structure of the\n", + "compound. Since the stable composition ranges of non-stoichiometric\n", + "compounds are typically small, the existing method cannot be used to\n", + "reliably evaluate the Gibbs energy of end-members, and currently there\n", + "is not a commonly accepted lattice stability database for compounds.\n", + "Most values used in the existing databases have been either roughly\n", + "estimated or computed from first-principles calculations. Such a\n", + "standard database is highly desirable in order to make various models of\n", + "compounds compatible.\n", + "\n", + "In an effort to compare the lattice stability from the CALPHAD models\n", + "and the first-principles calculations, Wang et al. \\[53\\] systematically\n", + "calculated the total energies of 78 pure elements at zero Kelvin in the\n", + "face-centered-cubic (fcc), body-centered-cubic (bcc), and\n", + "hexagonal-close-packed (hcp) crystal structures using the projector\n", + "augmented-wave (PAW) method within the generalized gradient\n", + "approximation (GGA). The calculated values are compared with the values\n", + "in the SGTE database as shown in and . For non-transition metal\n", + "elements, the differences between the SGTE data and the PAW-GGA data are\n", + "typically around 1\u223c2 kJ/mole-of-atoms or less, while for some transition\n", + "metal elements, the differences can be quite large, for example, as high\n", + "as about 54 kJ/mole-of-atoms for and about 40 kJ/mole-of-atoms for . and\n", + "present the differences between the PAW-GGA data and the SGTE data, for\n", + "elements from the Ti group to the Ni group, respectively.\n", + "\n", + "Table \u2011: Lattice stability Ebcc-fcc (kJ/mole-of-atoms).\n", + "\n", + "Table \u2011: Lattice stability Ehcp-fcc (kJ/mole-of-atoms).\n", + "\n", + "Figure \u2011: Lattice stability difference between bcc and fcc, , for\n", + "selected elements between PAW-GGA and SGTE\n", + "\n", + "Figure \u2011: Lattice stability difference between hcp and fcc, , for\n", + "selected elements between PAW-GGA and SGTE\n", + "\n", + "The large differences between the first-principles calculations and the\n", + "SGTE data could partly be attributed to the instability of the\n", + "higher-energy phases, the entropies of which at finite *T* become\n", + "abnormal. The lattice instabilities along the tetragonal transformation\n", + "path between fcc and bcc structures with the continuous change of the\n", + "c/a ratio defined in a bcc-based tetragonal lattice are demonstrated for\n", + "bcc Mo, Ta, W in and for fcc Al, Cu, Ni in . It is shown that the fcc\n", + "structure of bcc Mo, Ta, and W is a local maximum with respect to the\n", + "tetragonal transformation, and the higher the maximum is, the larger the\n", + "discrepancy between the SGTE data and the present PAW-GGA data, while\n", + "for fcc Al, Cu, Ni, the bcc structure is at a local maximum. Similarly,\n", + "the lattice instabilities along the tetragonal transformation path for\n", + "the hcp metals Ru and Os as shown in . The behavior of energy against\n", + "c/a ratio of these two hcp metals is very similar to those of fcc\n", + "elements.\n", + "\n", + "Figure \u2011: Total energy, , along the Bain deformation path between bcc\n", + "and fcc for Mo, Ta, and W.\n", + "\n", + "Figure \u2011: Total energy, , along the tetragonal transformation path\n", + "between bcc and fcc for Ni, Al, and Cu.\n", + "\n", + "Figure \u2011: Total energy, , along the tetragonal transformation path for\n", + "Ru and Os\n", + "\n", + "It can be concluded that a fcc structure for elements with bcc being the\n", + "ground state or a bcc structure for elements with fcc being the ground\n", + "state, is unstable with respect to the tetragonal transformation. For an\n", + "unstable structure, the harmonic description of its vibrational entropy\n", + "is thermodynamically incorrect since the potential surface seen by the\n", + "lattice ion can no longer be approximated by a parabola. If an unstable\n", + "structure of a pure element is stabilized at high temperatures, its\n", + "entropy has to be abnormal. The instability issue has been recently\n", + "addressed by ab initio molecular dynamics simulations at high\n", + "temperatures using W as an example \\[54\\], which is beyond the scope of\n", + "the book and thus not discussed here.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/index.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/index.ipynb new file mode 100644 index 0000000..c5d2f92 --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/index.ipynb @@ -0,0 +1,59 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "e744c055", + "cell_type": "markdown", + "source": [ + "# CALPAHD modeling of thermodynamics\n", + "\n", + "CALPHAD modeling of thermodynamics was pioneered by Kaufman \\[47\\] and\n", + "has been reviewed in details by Saunders and Miodownik \\[48\\] and Lukas,\n", + "Fries and Sundman \\[49\\]. Information on features of software tools for\n", + "CALPHAD modeling can be found at two series of publications in the\n", + "CALPHAD journal \\[50-51\\]. The key feature of the CALPHAD method is the\n", + "modeling of Gibbs energy of individual phases using both thermodynamic\n", + "and phase equilibrium data. The main significances of the CALPHAD method\n", + "are as follows\n", + "\n", + "1. It enabled the development of the concept of lattice stability, i.e.\n", + " the energy difference of a pure element with stable and non-stable\n", + " crystal structures;\n", + "\n", + "2. The Gibbs energy expression of each phase covers the full\n", + " temperature, pressure, and composition spaces including both stable\n", + " and non-stable regions of the phase. This enables the evaluation of\n", + " the Gibbs energy of a system as a function of non-equilibrium state,\n", + " i.e. with \u03be as an independent variable;\n", + "\n", + "3. Thermodynamic data are usually obtained by measurements of heat such\n", + " as enthalpy of transition and heat capacity as discussed in Chapter\n", + " , which bear large uncertainties typically in the range of\n", + " kilojoules per mole-of-atom. On the other hand, phase equilibrium\n", + " data as discussed in Chapter , though more accurate, only contain\n", + " information on compositions of phases at equilibria, i.e., the\n", + " relative Gibbs energy of phases at equilibrium. The combination of\n", + " these two sets of data is foundational in CALPHAD modeling that\n", + " allows for accurate modeling of thermodynamic properties of\n", + " individual phases and reliable calculations of phase stability and\n", + " driving forces;\n", + "\n", + "4. It provides a framework to model thermodynamic properties of\n", + " multi-component systems of industrial importance, enabling the\n", + " computational materials design. It has also been extended to model a\n", + " range of properties of individual phases in multi-component systems\n", + " such as diffusion coefficients, elastic coefficients, and thermal\n", + " expansion, supplying input data for computational simulations of\n", + " phase transformations during materials processing.\n", + "\n", + "In this chapter, the basics of CALPHAD modeling of Gibbs energy of\n", + "individual phases are presented. For detailed implementations in various\n", + "software packages and modeling procedures, readers are referred to the\n", + "references listed above.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_pure_elements.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_pure_elements.ipynb new file mode 100644 index 0000000..6dff134 --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_pure_elements.ipynb @@ -0,0 +1,76 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "9020233c", + "cell_type": "markdown", + "source": [ + "## Modeling of pure elements\n", + "\n", + "In modeling the Gibbs energy of pure elements in the SER structure in\n", + "terms of , the coefficients in are evaluated using the heat capacity\n", + "data, $b^{'}$ in is evaluated by the value of $S_{298.15}$, and $a$ in\n", + "is evaluated by $H_{298.15}^{SER} = 0$, respectively. For the high\n", + "temperature phase, the enthalpy of transformation from the low\n", + "temperature phase to the high temperature phase,\n", + "${\\mathrm{\\Delta}H}_{trans}^{}$, can be measured by calorimetry methods\n", + "discussed in Chapter , and the entropy of transformation,\n", + "${\\mathrm{\\Delta}S}_{trans}^{}$, is then calculated using the\n", + "equilibrium condition of equal Gibbs energy of the two phases, i.e.\n", + "\n", + "*Eq. 6\u20111*\n", + "${\\mathrm{\\Delta}S}_{trans}^{} = \\frac{{\\mathrm{\\Delta}H}_{trans}^{}}{T_{trans}^{}}$\n", + "\n", + "where $T_{trans}^{}$ is the transition temperature.\n", + "${\\mathrm{\\Delta}H}_{trans}^{}$ and ${\\mathrm{\\Delta}S}_{trans}^{}$ are\n", + "then used to evaluate the integration constants, $b^{'}$ and $a$, in the\n", + "place of $S_{298.15}$ and $H_{298.15}^{SER}$ for the structure in the\n", + "SER state.\n", + "\n", + "This works well for the stable temperature range of each phase. However,\n", + "there is an issue in extrapolation above and below the melting\n", + "temperature (Tm). It is known that the heat capacity of the\n", + "solid phase, , increases with temperature, while that of the liquid\n", + "phase, , is typically constant. The extrapolation of the Gibbs energy of\n", + "a solid phase to above its melting temperature can result in the solid\n", + "phase becoming more stable than the liquid phase at high temperatures.\n", + "By the same token, the extrapolation of the Gibbs energy of a liquid\n", + "phase to below its melting temperature can result in the liquid phase\n", + "becoming more stable than the solid phase at low temperatures. To\n", + "address this problem, it is proposed by SGTE that the heat capacity of\n", + "the solid phase approaches that of the liquid at high temperatures, and\n", + "that of the liquid phase approaches that of the solid phase at low\n", + "temperatures using the following equations\n", + "\n", + "1. for solid at T\\>Tm\n", + "\n", + "*Eq. 6\u20112*\n", + "\n", + "*Eq. 6\u20113*\n", + "\n", + "2. for liquid at T\\m\n", + "\n", + "*Eq. 6\u20114*\n", + "\n", + "*Eq. 6\u20115*\n", + "\n", + "As an example, the heat capacity of solid fcc Al and liquid Al in the\n", + "SGTE pure element database is plotted in . It can be seen that the heat\n", + "capacity of fcc Al approaches that of liquid Al at high temperatures,\n", + "while the heat capacity of liquid Al approaches that of fcc Al at low\n", + "temperatures. It ensures that the liquid Al is stable at high\n", + "temperatures, and fcc Al is stable at low temperatures. However, this\n", + "simple model for liquid is often not satisfactory, in comparison with\n", + "available experimental data in supercooled liquid, particularly those\n", + "systems with glass transitions. New models are thus needed and are being\n", + "developed in the CALPHAD community.\n", + "\n", + "Figure \u2011: Heat capacity of fcc Al solid and liquid as a function of\n", + "temperature\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_random_solution_phases.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_random_solution_phases.ipynb new file mode 100644 index 0000000..3fae5e1 --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_random_solution_phases.ipynb @@ -0,0 +1,63 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "9c4cc802", + "cell_type": "markdown", + "source": [ + "## Modeling of random solution phases\n", + "\n", + "Depending on the degree of short-range ordering in a solution phase,\n", + "various Gibbs energy models are available as discussed in Chapter . When\n", + "the short-range ordering is weak, it can be accounted for by the\n", + "composition-dependence of excess Gibbs energy in a binary system in\n", + "terms of the Redlich-Kister polynomial as follows\n", + "\n", + "*Eq. 6\u20117*\n", + "\n", + "where the interaction parameters, , can be temperature dependent or even\n", + "have contributions from heat capacity in the form of when data is\n", + "available. shows that and are symmetrical with respect of composition,\n", + "while is asymmetrical. Their individual contributions to the excess\n", + "Gibbs energy are shown in with all interaction parameters being -30,000\n", + "J/mole-of-atoms.\n", + "\n", + "Figure \u2011: Contributions of interactions parameters to the excess Gibbs\n", + "energy\n", + "\n", + "It can be seen in that even though all interaction parameters are\n", + "negative, the asymmetrical feature of results in the curvature change in\n", + "the excess Gibbs energy as a function of composition. This indicates the\n", + "tendency to form a miscibility gap at low temperatures. The interaction\n", + "parameters are to be evaluated from the data of enthalpy, entropy, and\n", + "heat capacity of mixing. The experimental data on enthalpy of mixing are\n", + "available for the liquid phase in some systems, but typically very\n", + "limited for solid solution phases. The first-principles calculations can\n", + "predict the enthalpy, entropy, and heat capacity of mixing in solid\n", + "solution phases using the dilute solution approach with one solute atom\n", + "in a supercell and the CPA/CE/SQS approach for concentrated solutions as\n", + "discussed in Chapter . It demonstrates again that the interaction\n", + "parameters and the lattice stability jointly determine the Gibbs energy\n", + "of an individual phase. The change of lattice stability requires the\n", + "re-evaluation of interaction parameters.\n", + "\n", + "For individual phases with strong short-range ordering, quasichemical or\n", + "associated models can be used. As discussed in Chapter , with fixed\n", + "composition in the system, the amounts of various chemical bonds or\n", + "associates are related through the mass conservation in the system and\n", + "are calculated through the minimization of Gibbs energy of the phase\n", + "with given temperature, pressure, and the amount of each independent\n", + "components. The model parameters include the formation energy of bonds\n", + "or associates and interaction between various bonds or associates,\n", + "noting that pure elements can be considered as the simplest associates.\n", + "The interactions between pure elements can be predicted from\n", + "first-principles calculations as mentioned above, but currently there\n", + "are no efficient approaches to predict the interactions between\n", + "associates from first-principles calculations.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_solution_phases_with_longrange_ordering.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_solution_phases_with_longrange_ordering.ipynb new file mode 100644 index 0000000..2605ebb --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_solution_phases_with_longrange_ordering.ipynb @@ -0,0 +1,170 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "4737c640", + "cell_type": "markdown", + "source": [ + "## Modeling of solution phases with long-range ordering\n", + "\n", + "The commonly used Gibbs energy model is shown in Chapter with the\n", + "crystal lattice divided into sublattices, often referred to as the\n", + "compound energy formalism \\[55\\]. The Gibbs energy of end-members\n", + "represented by plays the same important role for solution phases with\n", + "sublattice as the lattice stability for random solution phases. The\n", + "end-members are modeled in the same way as the stoichiometric phases\n", + "discussed in Chapter . The enthalpy and entropy of mixing in each\n", + "sublattice can be predicted by first-principles calculations using the\n", + "dilute solution and SQS approaches discussed in Chapter and modeled in\n", + "the same way as the random solution discussed in Chapter .\n", + "\n", + "It is important to realize that with a simple two-sublattice model of\n", + "(A,B)a(C,D)b, the miscibility gap can easily form\n", + "even without any interaction parameters when the Gibbs energy of\n", + "end-members differ from each other significantly. The contribution of\n", + "end-members to the Gibbs energy of the phase, i.e. , is re-written as\n", + "follows and schematically shown in ,\n", + "\n", + "*Eq. 6\u20118*\n", + "\n", + "Figure \u2011: Schematic diagrams depicting (a) the concentration square with\n", + "the site fractions of B and D on the horizontal and vertical axes,\n", + "respectively, and (b) Gibbs energy reference plan for\n", + "(A,B)a(C,D)b, as represented by .\n", + "\n", + "From b, it is evident that there is a strong tendency to form a\n", + "miscibility gap between the composition sets of\n", + "(A)a(C)b and (B)a(D)b due to\n", + "their lower Gibbs energies than the other two end-members. Since it\n", + "would be rare for all four end-members to have their Gibbs energy values\n", + "equal, the miscibility gap in this type of phases is practically\n", + "inevitable at low temperatures. An example is shown in for the complex\n", + "titanium niobium carbonitride (Ti,Nb)(C,N). The solid lines parallel to\n", + "the direction from NbC to TiN are tie-lines. The Gibbs energy values of\n", + "TiC, TiN, NbC and NbN are -144495, -229236, -132324, and -179772\n", + "J/mole-of-atoms, respectively. The Gibbs energy value of TiN is\n", + "significantly lower than the other values, resulting in the tie-lines\n", + "originating from the TiN corner.\n", + "\n", + "Figure \u2011: Miscibility gap in (Ti,Nb)(C,N) at 1673K with the straight\n", + "lines in the middle of the plot being tie-lines.\n", + "\n", + "The order-disorder transitions can be similarly described with the\n", + "simplest case being a two-sublattice model of\n", + "(A,B)a(A,B)b. When the site fractions of A or B in\n", + "both sublattices are the same, it becomes a random solution model; when\n", + "they are different, the phase is partially ordered; and when there is\n", + "only one component in each sublattice, the phase is fully ordered as a\n", + "stoichiometric compound. The Gibbs energy of this phase is obtained from\n", + "as follows\n", + "\n", + "*Eq. 6\u20119*\n", + "\n", + "$G_{mf} = y_{A}^{I}y_{A}^{II}\\ _{\\ }^{0}G_{A:A} + y_{A}^{I}y_{B}^{II}\\ _{\\ }^{0}G_{A:B} + y_{B}^{I}y_{A}^{II}\\ _{\\ }^{0}G_{B:A} + y_{B}^{I}y_{B}^{II}\\ _{\\ }^{0}G_{B:B} + + aRT\\left( y_{A}^{I}\\ln y_{A}^{I} + y_{B}^{I}\\ln y_{B}^{I} \\right) + bRT\\left( y_{A}^{II}\\ln y_{A}^{II} + y_{B}^{II}\\ln y_{B}^{II} \\right) + y_{A}^{II}y_{A}^{I}y_{B}^{I}\\ L_{A,B:A} + y_{B}^{II}y_{A}^{I}y_{B}^{I}\\ L_{A,B:B} + y_{A}^{I}y_{A}^{II}y_{B}^{II}\\ L_{A:A,B} + y_{B}^{I}y_{A}^{II}y_{B}^{II}\\ L_{B:A,B} + y_{A}^{I}y_{B}^{I}\\ y_{A}^{II}y_{B}^{II}L_{A,B:A,B}$\n", + "\n", + "where the superscript denotes the sublattice, and column and comma\n", + "separate sublattices and interaction components, respectively. The\n", + "relationship between site fraction and over-all atomic fractions in such\n", + "a two-sublattice model can be represented by and schematically shown in\n", + ". The two red dashed lines represent the phase with\n", + "$x_{B} = \\frac{a}{a + b}$, but different a/b ratios. Along the red\n", + "dashed lines, the phase can adjust the site fraction to minimize its\n", + "Gibbs energy, i.e. it has one internal degree of freedom to be either\n", + "disordered on the blue diagonal line between A:A and B:B, or ordered at\n", + "anywhere else. The interplay of interaction parameters and site\n", + "fractions is depicted where $L_{A,B:A}$, $L_{A,B:B}$, $L_{A:A,B}$, and\n", + "$L_{B:A,B}$ affect the four sides, and $L_{A,B:A,B}$ influences the\n", + "center part.\n", + "\n", + "Figure \u2011: Schematic composition square of\n", + "(A,B)a(A,B)b.\n", + "\n", + "When fully disordered with $y_{A}^{I} = \\ y_{A}^{II} = x_{A}$ and\n", + "$y_{B}^{I} = y_{B}^{II} = x_{B}$, becomes\n", + "\n", + "*Eq. 6\u201110*\n", + "\n", + "$$G_{mf} = x_{A}\\left( 1 - x_{B} \\right)_{\\ }^{0}G_{A:A} + x_{A}x_{B}\\ _{\\ }^{0}G_{A:B} + x_{A}x_{B}\\ _{\\ }^{0}G_{B:A} + x_{B}\\left( 1 - x_{A} \\right)\\ _{\\ }^{0}G_{B:B} + + (a + b)RT\\left( x_{A}\\ln x_{A} + x_{B}\\ln x_{B} \\right) + \\ x_{A}x_{B}x_{A}L_{A,B:A} + x_{A}x_{B}x_{B}\\ L_{A,B:B} + x_{A}x_{B}x_{A}\\ L_{A:A,B} + x_{A}x_{B}x_{B}\\ L_{B:A,B} + x_{A}x_{A}x_{B}x_{B}L_{A,B:A,B} = x_{A}_{\\ }^{0}G_{A:A} + x_{B}\\ _{\\ }^{0}G_{B:B} + (a + b)RT\\left( x_{A}\\ln x_{A} + x_{B}\\ln x_{B} \\right) + x_{A}x_{B}\\left\\lbrack \\left(_{\\ }^{0}G_{A:B} +_{\\ }^{0}G_{B:A} -_{\\ }^{0}G_{A:A} -_{\\ }^{0}G_{B:B} \\right) + x_{A}\\left( L_{A,B:A} + L_{A:A,B} \\right) + x_{B}\\ \\left( L_{A,B:B} + L_{B:A,B} \\right) + x_{A}x_{B}L_{A,B:A,B} \\right\\rbrack = (a + b)\\left\\lbrack x_{A}_{\\ }^{0}G_{A} + x_{B}\\ _{\\ }^{0}G_{B} + RT\\left( x_{A}\\ln x_{A} + x_{B}\\ln x_{B} \\right) + x_{A}x_{B}L_{A,B} \\right\\rbrack$$\n", + "\n", + "with\n", + "\n", + "*Eq. 6\u201111* $_{\\ }^{0}G_{A:A} = (a + b)_{\\ }^{0}G_{A}$\n", + "\n", + "*Eq. 6\u201112* $_{\\ }^{0}G_{B:B} = (a + b)_{\\ }^{0}G_{B}$\n", + "\n", + "*Eq. 6\u201113*\n", + "\n", + "$$L_{A,B} = \\left\\lbrack \\left(_{\\ }^{0}G_{A:B} +_{\\ }^{0}G_{B:A} -_{\\ }^{0}G_{A:A} -_{\\ }^{0}G_{B:B} \\right) + x_{A}\\left( L_{A,B:A} + L_{A:A,B} \\right) + x_{B}\\ \\left( L_{A,B:B} + L_{B:A,B} \\right) + x_{A}x_{B}L_{A,B:A,B} \\right\\rbrack/(a + b)$$\n", + "\n", + "where $_{\\ }^{0}G_{A}$, $_{\\ }^{0}G_{B}$, and $L_{A,B}$ are the molar\n", + "Gibbs energy of pure A and B and the molar interaction parameter in the\n", + "disordered solid solution, respectively. It is evident that the\n", + "interatcation paramter $L_{A,B}$ is fully determined by the parameters\n", + "in the ordered phase, but the parameters in the ordered phase are not\n", + "uniquely determined by the interaction parameters in the disordered\n", + "phase.\n", + "\n", + "Due to crystal symmetry, some of the parameters in are related. For\n", + "example, in the BCC A2/B2 ordering with a=b=0.5, the BCC corner or\n", + "center lattice sites are favored by either one type of atoms, but the\n", + "two sublattices are equivalent crystallographically, resulting in\n", + "following relations\n", + "\n", + "*Eq. 6\u201114* $\\ _{\\ }^{0}G_{A:B} = \\ _{\\ }^{0}G_{B:A}$\n", + "\n", + "*Eq. 6\u201115* $L_{A,B:A} = L_{A:A,B}$\n", + "\n", + "*Eq. 6\u201116* $L_{A,B:B} = \\ L_{B:A,B}$\n", + "\n", + "For more complex ordering of BCC lattice such as B32, D03,\n", + "and L21 shown in with ideal compositions being AB,\n", + "A3B, and A2BC, respectively, more sublattices are\n", + "needed, noting that the L21 Heusler structure exists in\n", + "ternary systems only. To use one model to describe all ordering in the\n", + "BCC lattice, the minimum cluster is an irregular tetrahedron with four\n", + "sublattices as depicted in as discussed in the modeling of the Al-Fe\n", + "system \\[56\\]. In such a four sublattice model of\n", + "$(A,B)_{0.25}^{I}(A,B)_{0.25}^{II}(A,B)_{0.25}^{II}(A,B)_{0.25}^{IV}$,\n", + "the site fractions of A2, B2, B32, and D03, are represented\n", + "by $y_{i}^{I} = \\ y_{i}^{II} = y_{i}^{III} = \\ y_{i}^{IV}$,\n", + "$y_{i}^{I} = \\ y_{i}^{II} \\neq y_{i}^{III} = \\ y_{i}^{IV}$,\n", + "$y_{i}^{I} = \\ y_{i}^{III} \\neq y_{i}^{II} = \\ y_{i}^{IV}$, and\n", + "$y_{i}^{I} = \\ y_{i}^{II} \\neq y_{i}^{III} \\neq \\ y_{i}^{IV}$,\n", + "respectively. The site fractions of L21 are the same as those\n", + "of D03 except with at least three components.\n", + "\n", + "Figure \u2011: Atomic structures and four sublattice tetrahedrons of BCC\n", + "disordered and ordered phases.\n", + "\n", + "Another common ordering phenomenon is in the FCC lattice including the\n", + "disordered A1 structure and ordered L10 and L12\n", + "structures as shown in . In the L10 structure, the\n", + "neighboring (001) planes are favored by different atoms, respectively,\n", + "resulting in an ideal composition of AB. While in the L12\n", + "structure, the corners and faces are favored by different atoms,\n", + "respectively, resulting in an ideal composition of A3B. In a\n", + "four sublattice model of\n", + "$(A,B)_{0.25}^{I}(A,B)_{0.25}^{II}(A,B)_{0.25}^{II}(A,B)_{0.25}^{IV}$,\n", + "the site fractions of A1, L10 and L12 are\n", + "represented by $y_{i}^{I} = \\ y_{i}^{II} = y_{i}^{III} = \\ y_{i}^{IV}$,\n", + "$y_{i}^{I} = \\ y_{i}^{II} \\neq y_{i}^{III} = \\ y_{i}^{IV}$, and\n", + "$y_{i}^{I} = \\ y_{i}^{II} = y_{i}^{III} \\neq \\ y_{i}^{IV}$, respectively\n", + "\\[57\\].\n", + "\n", + "Figure \u2011: Atomic structures and four sublattice tetrahedrons of FCC\n", + "disordered and ordered phases.\n", + "\n", + "As mentioned above, the interaction parameters in each sublattice can be\n", + "predicted by first-principles calculations using the dilute solution and\n", + "SQS approaches when there is only one component in each of the remaining\n", + "sublattices. For the interaction involving two components in two or more\n", + "sublattices, i.e. $L_{A,B:A,B}$ in applicable to four sublattice models\n", + "\\[58\\], the energetics from cluster expansion (CE) approach discussed in\n", + "Chapter can be used to evaluate the interaction parameters.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_stoichiometric_phases.ipynb b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_stoichiometric_phases.ipynb new file mode 100644 index 0000000..bfc2de9 --- /dev/null +++ b/src/psu410/src/psu410/calpahd_modeling_of_thermodynamics/modeling_of_stoichiometric_phases.ipynb @@ -0,0 +1,42 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "51b3fec2", + "cell_type": "markdown", + "source": [ + "## Modeling of stoichiometric phases\n", + "\n", + "The Gibbs energy of a stoichiometric phase can be modeled in the same\n", + "way as that of pure elements discussed above using the data of heat\n", + "capacity, $S_{298.15}$, and enthalpy of formation at 298.15 K (). When\n", + "these data are not available from experiments, they can be predicted by\n", + "first-principles calculations as discussed Chapter . It should be\n", + "pointed out that constraints placed on heat capacity of stoichiometric\n", + "compounds above melting temperatures, i.e. and , have not been\n", + "rigorously implemented in the literature for such modeling, partially\n", + "because the heat capacity of the corresponding liquid solution is not\n", + "well established, and the heat capacity of a compound is often not\n", + "available.\n", + "\n", + "When the data of heat capacity is not available, a simple approach,\n", + "commonly referred to as Neumann\u2013Kopp Rule assuming that the heat\n", + "capacity of formation of is zero, can be used. The Gibbs energy of the\n", + "compound is written as\n", + "\n", + "*Eq. 6\u20116*\n", + "$G = \\sum_{}^{}N_{i}{_{\\ }^{0}G}_{i}^{ref} + \\mathrm{\\Delta}_{f}H - T\\mathrm{\\Delta}_{f}S$\n", + "\n", + "with $\\mathrm{\\Delta}_{f}H$ and $\\mathrm{\\Delta}_{f}S$ modeled as\n", + "constants. An additional draw back of is that the melting temperature of\n", + "the compound can be higher than those of pure elements, and the heat\n", + "capacity of the compound may thus be questionable at temperatures higher\n", + "than the melting temperatures of pure elements due to the non-physical\n", + "contributions from pure elements based on .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_cerium.ipynb b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_cerium.ipynb new file mode 100644 index 0000000..2259d94 --- /dev/null +++ b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_cerium.ipynb @@ -0,0 +1,209 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "2b36eca7", + "cell_type": "markdown", + "source": [ + "## Application to cerium\n", + "\n", + "Cerium (Ce) displays intriguing physical and chemical properties of\n", + "which the most fascinating is its first-order isostructural phase\n", + "transition. This involves a magnetic, high temperature/high volume\n", + "\u201c\u03b3-phase\u201d and a nonmagnetic, low temperature/low volume \u201c\u03b1-phase\u201d, both\n", + "in the same face-centered-cubic (fcc) lattice structure. At 298 K and\n", + "0.7 GPa, the \u03b3\u2192\u03b1 transition is accompanied by a 14-17% volume collapse.\n", + "The Ce phase transition has been studied extensively including our own\n", + "works with two or three microstates \\[55, 64\\].\n", + "\n", + "The simplest model for the system is to consider two microstates:\n", + "ferromagnetic and nonmagnetic. The first-principles calculations of the\n", + "free energy of two Ce microstates are problematic in the absence of\n", + "strong correlation of the *f*-electrons in the DFT Hamiltonian. The\n", + "relative stability of the nonmagnetic (\u201cdelocalized\u201d) Ce 4*f* state to\n", + "that of the magnetic (\u201clocalized\u201d) Ce 4*f* state is greatly\n", + "overestimated in the GGA \\[31-32\\] with spin polarization. The usual\n", + "approach to surmount this is the Dudarev DFT + U method \\[65\\] with the\n", + "on-site Coulomb and exchange interactions as described with a\n", + "Hartree-Fock approximation added to the DFT Hamiltonian. This method\n", + "offers the advantage that only the difference between the Hubbard U (due\n", + "to the energy increase from an electron addition to a specific site) and\n", + "the J (due to the screened exchange energy) need to be specified *a\n", + "priori*.\n", + "\n", + "Evaluation of numerous U \u2013 J values over a 1.0 \u2013 6.0 eV range revealed\n", + "that 1.6 eV gives the most consistent prediction of nonmagnetic Ce and\n", + "magnetic Ce energetics over the range of atomic volumes that includes\n", + "both microstates at 0 K. The energy-volume curves thus obtained is\n", + "plotted in , showing that the nonmagnetic microstate is the ground\n", + "state, and the equilibrium between the two microstates at 0 K is at the\n", + "negative pressure of -0.87GPa. Since and , NTE does not exist in the\n", + "system.\n", + "\n", + "Figure \u2011: Variation of cell energy (eV) with atomic volume\n", + "(\u00c53) for Ce computed with strong correlation based upon\n", + "Dudarev\u2019s method with U \u2013 J = 1.6 eV.\n", + "\n", + "To take into account the possible magnetic disordering in the\n", + "ferromagnetic microstate at finite temperatures, the following\n", + "contribution is added to the free energy of the ferromagnetic microstate\n", + "\n", + "Eq. 9\u20119\n", + "\n", + "where *MS* is the spin moment, and *l* = 3 the orbital\n", + "angular momentum of an *f*-electron. is a generalization of Hund\u2019s rule,\n", + "with total angular momentum . The Helmholtz energies thus obtained for\n", + "both microstates and the system are shown in at several temperatures\n", + "with the tie-lines included. In the figure, the blue, dot-dashed curves\n", + "are for the nonmagnetic microstate, red, solid curves for ferromagnetic\n", + "microstate, cyan shadows for entropy of mixing between two microstates,\n", + "and the circle in (e) is the critical point. The numbers below the black\n", + "dashed line, representing the common tangent curves, mark the transition\n", + "pressures. The 0-K static energies of the nonmagnetic microstate and the\n", + "magnetic microstate are also plotted in (a) using the solid circles and\n", + "dotted lines.\n", + "\n", + "Figure \u2011: Helmholtz energies at (a) 0 K; (b) 100 K; (c) 165 K; (d) 300\n", + "K; (e) 476 K; and (f) 600 K.\n", + "\n", + "The temperature vs volume phase diagram is plotted and compared with\n", + "available experimental data as shown in \\[66\\]. In this figure, the\n", + "volume (V) is normalized to its equilibrium volume (VN) at\n", + "atmospheric pressure and room temperature. In the pressure range of 2.25\n", + "\u2013 3.5 GPa, the system is within the single-phase region at all\n", + "temperatures considered as shown by the five continuous isobaric volumes\n", + "as a function of temperature. In this pressure range, normal thermal\n", + "expansion is observed at both low and high temperatures on each isobaric\n", + "curve where the probability of each microstate does not change\n", + "significantly with temperature. While in the middle temperature range on\n", + "each isobaric curve, the colossal positive thermal expansion (CPTE),\n", + "highlighted by the pink open diamond symbols, exists due to the fast\n", + "increase of probability of the metastable ferromagnetic microstate with\n", + "respect to temperature, i.e. , , and . This CPTE is much higher than the\n", + "individual positive thermal expansions of the stable and metastable\n", + "microstates, respectively.\n", + "\n", + "Figure \u2011: Calculated temperature-volume phase diagram of Ce.\n", + "\n", + "With decreasing pressure, the system reaches a critical point (green\n", + "circle) where the homogeneous single phase becomes unstable, represented\n", + "by and , and both entropy and volume change infinitely. At even lower\n", + "pressure, a miscibility gap forms, and the single phase separates into\n", + "two phases with the same fcc crystal structures, but different magnetic\n", + "spin structures. Inside the miscibility gap, the volume changes\n", + "discontinuously with respect to temperature by the so-called first-order\n", + "transition as shown by the isobaric curve at zero pressure, compared\n", + "well with experimental volume data (solid squares) under ambient\n", + "pressure.\n", + "\n", + "The fraction of the ferromagnetic microstate, *x*mag, in \u03b1-Ce\n", + "(blue) and \u03b3-Ce (red) calculated using is plotted in as a function of\n", + "pressure along the miscibility gap phase boundary. It can be seen that\n", + "the fraction of the ferromagnetic microstate in \u03b1-Ce increases with\n", + "increasing pressure while the fraction of the ferromagnetic microstate\n", + "in \u03b3-Ce decreases. At the critical point, the fraction of ferromagnetic\n", + "microstate is calculated to be 0.58. This is in qualitative agreement\n", + "with the 0.67 value (filled circle) estimated experimentally at the\n", + "critical point.\n", + "\n", + "Figure \u2011: Fraction of ferromagnetic microstate in \u03b1-Ce (blue) and \u03b3-Ce\n", + "(red) along the \u03b3-\u03b1 phase boundary.\n", + "\n", + "The relative volume, *V/VN*, as a function of pressure, is\n", + "plotted as the black solid lines in from 200 to 600 K at 50 K\n", + "increments. The blue and red solid lines correspond to \u03b1-Ce and \u03b3-Ce,\n", + "respectively. Symbols denote experimental data in the literature, except\n", + "the open green circle being the calculated critical point, in good\n", + "agreement with the computed isotherms. In the two-phase miscibility gap\n", + "region, the \u03b3\u2192\u03b1 volume collapse is again noted, with the magnitude of\n", + "the collapse increasing with decreasing *T*. This is shown explicitly by\n", + "the dashed vertical lines at *T* = 200, 250, 300, 350, 400, and 450 K.\n", + "For *T* \\> 476 K, the calculated isotherms show an anomalous slope\n", + "change which closely matches the behavior near *V/VN* = ~0.85\n", + "from experiment.\n", + "\n", + "Figure \u2011: Equation-of-states for Ce. The black solid lines represent the\n", + "calculated isotherms from 200 to 600 K at \u2206T = 50 K increments.\n", + "\n", + "A more complex model is to add the anti-ferromagnetic microstate. Thus\n", + "obtained E-V and Helmholtz energy curves at 0 K are shown in . The\n", + "equilibrium volume energies reveal that the energy of the\n", + "anti-ferromagnetic microstate at the equilibrium volume is close to that\n", + "of the nonmagnetic microstate but substantially lower than that of the\n", + "ferromagnetic microstate. It should be noted that the magnetic spin\n", + "disordering in the system is taken into account by the two magnetic\n", + "microstates, and the contribution denoted by the mean-field theory, i.e.\n", + ", should thus not be added to either magnetic microstate to avoid double\n", + "counting. The predicted critical point values are 546 K and 2.05 GPa,\n", + "closer to the experimental data than the previous predication with two\n", + "microstates as shown in the temperature-pressure phase diagram in in\n", + "comparison with experimental data.\n", + "\n", + "Figure \u2011: (a) dot-dashed line with **\u25cb** (red), dashed line **\u25d1**\n", + "(blue), and solid line with \u25cf (blue) represent the 0 K static total\n", + "energies for nonmagnetic (NM), anti-ferromagnetic (AFM), and\n", + "ferromagnetic (FM) microstates of Ce, respectively. (b) The solid lines\n", + "denote Helmholtz energy (per atom) from 0 to 600 K at \u2206T = 100 K; the\n", + "heavy dot-dashed (\u03b1-Ce, red) and solid (\u03b3-Ce, blue) looping curves\n", + "enclose the two-phase region with the light red dot-dashed lines\n", + "connecting the common tangents of each isotherm; the black dashed line\n", + "denotes zero pressure equilibrium state at given T; **\u25cb** (red) and \u25cf\n", + "(blue) emphasize the phase boundary at 300 K while **\u25d1** (green) is the\n", + "critical point.\n", + "\n", + "Figure \u2011: Calculated temperature-pressure phase diagram along with\n", + "experimental data.\n", + "\n", + "The calculated entropy changes are plotted in a in terms of lattice\n", + "vibration only (black dashed line), lattice vibration plus thermal\n", + "electron (black dot-dashed line), and lattice vibration plus thermal\n", + "electron and plus configuration coupling (solid blue). The black square\n", + "is the estimated vibrational entropy change at 0.7 GPa of \u03b3-Ce relative\n", + "to \u03b1-Ce, and other open (solid) symbols are from experimental\n", + "measurements of total entropy. Various contributions to the Helmholtz\n", + "energy along the \u03b3-\u03b1 phase boundary are plotted in b in terms of *T\u2206S*\n", + "(blue diamonds), *\u2206E* (green circles), and *P\u2206V* (red squares), shown\n", + "excellent agreement with experimental data.\n", + "\n", + "Figure \u2011: Calculated (a) entropy; (b) various contributions to Helmholtz\n", + "energy of Ce along with experimental data.\n", + "\n", + "The predicted fractions of three microstates as a function of\n", + "temperature and heat capacity at the critical pressure of 2.05 Pa are\n", + "shown in a and b, respectively. Near the critical point, the theory\n", + "predicts that the system is a mixture of the various microstates. a\n", + "depicts that for T \\< 300 K, the system consists mainly of the\n", + "nonmagnetic Ce state which results in \u03b1-Ce. For *T* \\> 300 K, the\n", + "thermal populations of the magnetic states increase with increasing\n", + "temperature. Finally, for *T* \\> 546 K (the critical point), 70% of the\n", + "system is composed of the antiferromagnetic Ce state with the remaining\n", + "30% consisting of the nonmagnetic and ferromagnetic Ce states. This is\n", + "in agreement with the common belief that \u03b3-Ce is magnetic with a\n", + "partially disordered local moment (paramagnetic) and that \u03b1-Ce is\n", + "nonmagnetic.\n", + "\n", + "b shows the predicted temperature evolution of contributions to heat\n", + "capacity: vibrational and magnetic (*Cf/T*), electronic\n", + "(*Cel*/*T*), and their sum (*Cf+el/T*) at 2.05\n", + "GPa. The theory suggests the following: (a) below ~500 K,\n", + "*Cf+el/T* shows an exponential temperature dependence due to\n", + "the statistic fluctuation among the non-magnetic, ferromagnetic, and\n", + "antiferromagnetic states; (b) a peak appears at ~500 K in the\n", + "*Cf+el/T* curve, which typically suggests the Schottky\n", + "anomaly; (c) the electronic specific heat coefficient\n", + "(*Cel*/*T*) is linear against *T*; (d) above *~*500 K the sum\n", + "of *Cf/T* and *Cel*/*T* renders\n", + "*Cf+el/T* temperature-independent.\n", + "\n", + "Figure \u2011: (a) Thermal populations of the nonmagnetic (red dot-dashed),\n", + "anti-ferromagnetic (green dashed), and ferromagnetic (blue solid) as a\n", + "function of temperature at the critical pressure of 2.05 GPa. (b)\n", + "Cel/T (black dashed line), Cf/T (black dot-dashed\n", + "line), and their sum Cf+el/T (blue solid line) at 2.05 GPa.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_fept.ipynb b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_fept.ipynb new file mode 100644 index 0000000..dc7dbe1 --- /dev/null +++ b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/application_to_fept.ipynb @@ -0,0 +1,131 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "a65d7622", + "cell_type": "markdown", + "source": [ + "## Application to Fe3Pt\n", + "\n", + "Invar was first discovered in the intermetallic\n", + "Fe65Ni35 alloy and is characterized by \u201canomalies\u201d\n", + "including thermal expansion, equation-of-state, elastic modulus, heat\n", + "capacity, magnetization, and Curie temperature. There are a number of\n", + "theoretical models for Invar such as the Weiss 2-\u03b3 model, the\n", + "non-collinear spin model, and the disordered local moment approach as\n", + "reviewed in Ref. \\[67\\]. In this section, the application of the MMS\n", + "model to the ordered L12 Fe3Pt is presented to\n", + "study the Invar anomaly at finite temperatures.\n", + "\n", + "For a supercell of 12 atoms with nine magnetic Fe atoms in\n", + "Fe3Pt, if only the up and down spins are considered, the\n", + "system contains 29 = 512 spin configurations, which are, by\n", + "symmetry, reduced to 37 non-equivalent ones. They are the microstates in\n", + "the MMS model, and FMC and SFC are used to represent the ferromagnetic\n", + "and spin flipping microstates, respectively. For the first-principles\n", + "calculations of each microstate, VASP package \\[14\\] within the\n", + "projector-augmented wave (PAW) method and the exchange-correlation part\n", + "of the density functional treated within the GGA of\n", + "Perdew-Burke-Ernzerhof (PBE) \\[32\\] are employed with details in Ref.\n", + "\\[67\\]. For the lattice vibration, the Debye-Gr\u00fcneisen approach\n", + "described in Chapter 5.2.4 is used.\n", + "\n", + "presents the first-principles 0 K total energies of 36 non-equivalent\n", + "SFCs as well as the FMC as a function of atomic volume. It can be seen\n", + "that there are a number of SFCs, whose energies are in the range of ~1\n", + "mRy/atom to that of the FMC. It is noted that all the SFCs studied\n", + "herein have the equilibrium averaged atomic volumes at least 1.8 %\n", + "smaller than that of the FMC, the 0 GPa ground state. In , the two\n", + "lowest energy SFCs have been labeled as SFC55 and SFC41 with their spin\n", + "arrangements very similar to the double layer antiferromagnetic state.\n", + "The nonmagnetic configuration has a very small atomic volume of 11.66\n", + "\u00c53/atom and much higher energy than both FMC and all SFCs,\n", + "and is thus not shown here.\n", + "\n", + "Figure \u2011: 0 K total energies. The heavy black line represents the FMC.\n", + "The symbols **\u25cb**, \u25d4, \u25d1, and \u25d5 with dashed lines indicate the minima of\n", + "the energy-volume curves of the SFCs with spin polarization rates of\n", + "1/9, 3/9, 5/9, and 7/9, respectively. The red **\u25cb** and \u25d4 with\n", + "dot-dashed lines mark the two lowest SFCs in energy.\n", + "\n", + "The normalized Helmholtz energies of all SFCs are plotted in with the\n", + "Helmholtz energy of FMC as the reference state, shown that the FMC has\n", + "the lowest Helmholtz energy at all temperatures considered. If only the\n", + "relative Helmholtz energies of microstates are considered, FMC should be\n", + "stable at all temperatures. However, the configurational entropy due to\n", + "the mixing among multiple microstates, i.e. , lowers the system free\n", + "energy by introducing the statistic probability of metastable SFCs.\n", + "\n", + "Figure \u2011: Normalized Helmholtz energy of all SFCs with respect to that\n", + "of FMC.\n", + "\n", + "Through the minimization of Helmholtz energy of , the\n", + "temperature-pressure and temperature-volume phase diagrams are obtained\n", + "and shown in \\[66\\]. A critical point at 141 K and 5.81 GPa is predicted\n", + "with *V* = 12.61 \u00c53. Below the critical point, it is a\n", + "two-phase miscibility gap (the shadow area) with the dominant\n", + "microstates being FMC and SFCs, respectively, and the transition between\n", + "them is first-order. Above the critical point, the macroscopically\n", + "homogeneous single phase is stable, and the phase transitions between\n", + "the ferromagnetic-dominant phase with large volumes and the SFC-dominant\n", + "paramagnetic phase with small volumes are of second-order. The\n", + "second-order transition pressures and volumes are determined by the\n", + "condition that the weighted Helmholtz energy counting all SFCs equals to\n", + "the Helmholtz energy counting only FMC.\n", + "\n", + "Figure \u2011: Calculated (a) temperature-pressure and (b) temperature-volume\n", + "phase diagrams of Fe3Pt.\n", + "\n", + "In a, the data points are the measured pressure dependence of the Curie\n", + "temperature, and the agreement between the measurements and predictions\n", + "is remarkable. It should be pointed out that the classical Weiss 2-\u03b3\n", + "model predicts only first-order phase transitions while the\n", + "non-collinear spin model yields only second-order phase transitions at\n", + "all temperatures. In b, four isobaric volume curves are also plotted\n", + "with the predicted NTE regions marked by the pink open diamonds and the\n", + "experimental volume data under ambient pressure superimposed, showing\n", + "excellent agreement. It also depicts the gigantic NTE around the\n", + "critical point on the isobaric curve at 7 GPa.\n", + "\n", + "indicates that the entropies of SFCs are larger than that of FMC so\n", + "their Helmholtz energy differences decrease with temperature. This is in\n", + "line with the origin of NTE in a single phase due to the statistic\n", + "existence of metastable microstates with lower volumes and higher\n", + "entropies than the stable state in a temperature range where their\n", + "probabilities change dramatically. plots the calculated thermal\n", + "populations of the FMC (black solid line) and that of the sum over all\n", + "SFCs (black dot-dashed line) under ambient pressure. The two major\n", + "contributions to the paramagnetic (PM) phase are from SFC55 and SFC41,\n", + "which are also plotted using red dashed and long dashed lines,\n", + "respectively. The system is dominated by the FMC at temperatures below\n", + "half of the transition temperature, and the populations of SFCs increase\n", + "monotonously at temperatures higher than half of the transition\n", + "temperature. As mentioned above, the transition temperature is defined\n", + "when the population of all SFCs is the same as that of FMC due to their\n", + "equal Helmholtz energy.\n", + "\n", + "Figure \u2011: Calculated thermal populations of FMC, SFC55, SFC41, and sum\n", + "of all SFCS, respectively.\n", + "\n", + "The predicted thermal volume expansion and the derived linear thermal\n", + "expansion coefficient (LTEC) under ambient pressure are plotted in . A\n", + "positive thermal expansion is predicted from 100 K to 288 K, followed by\n", + "a negative thermal expansion in the range of 289 ~ 449 K, and then a\n", + "positive thermal expansion again at \\>450 K, in excellent agreement with\n", + "experiments. The only disagreement between the predictions and\n", + "experiments occur at T \\< 100 K where the calculations did not reproduce\n", + "the negative thermal expansion for Fe3Pt. Large supercell or\n", + "more spin configurations may be needed.\n", + "\n", + "Figure \u2011: (a) Relative volume increase (V-\n", + "V300)/V300 with V300 being the\n", + "equilibrium volume at 300K and 0 GPa for the ordered Fe3Pt.\n", + "(b) Linear thermal expansion coefficient (LTEC) along with experimental\n", + "data (symbols) with details in Ref. \\[67\\].\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/concept_of_materials_genome.ipynb b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/concept_of_materials_genome.ipynb new file mode 100644 index 0000000..4d85473 --- /dev/null +++ b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/concept_of_materials_genome.ipynb @@ -0,0 +1,66 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "51d02db3", + "cell_type": "markdown", + "source": [ + "## Concept of Materials Genome\u00ae\n", + "\n", + "\u201cA genome is a set of information encoded in the language of DNA that\n", + "serves as a blueprint for an organism\u2019s growth and development. The word\n", + "genome, when applied in nonbiological contexts, connotes a fundamental\n", + "building block toward a larger purpose\u201d \\[68\\]. Materials Genome\u00ae (a\n", + "trademark of Materials Genome, Inc., Pennsylvania, USA) thus concerns\n", + "the building blocks of materials. Most part of this book focuses on the\n", + "Gibbs/Helmholtz energies of individual phases as a function of its\n", + "natural variables, and the same in the CALPHAD modeling of\n", + "thermodynamics and other properties of individual phases.\n", + "Multi-component materials systems and their properties are built on the\n", + "individual phases and their properties. Individual phases are thus\n", + "naturally considered as building blocks of materials. Consequently, the\n", + "language of CALPHAD thermodynamics and kinetics contains the genomics of\n", + "materials by representing experimental and theoretical results in\n", + "databases to make them applicable to a much wider context than the\n", + "original experiments or calculations \\[69\\]. The change of individual\n", + "phases in terms of their properties, amounts, and interactions with\n", + "other phases with respect to external conditions thus determines the\n", + "performance of the materials.\n", + "\n", + "On the other hand, at critical points and beyond, phases lose their\n", + "individuality and form one macroscopically homogeneous system, and the\n", + "properties of the system change dramatically with respect to external\n", + "conditions. As shown in this chapter, these dramatically responses can\n", + "be predicted through the statistic competition of stable and metastable\n", + "microstates. From the thermodynamic point of view, under any given\n", + "conditions, one of the individual microstate has the lowest\n", + "Gibbs/Helmholtz energy and is stable, while all other microstates have\n", + "higher free energy and are metastable or unstable. These metastable or\n", + "even unstable microstates are brought into statistic existence in the\n", + "matrix of the stable microstate due to the entropy of mixing of the\n", + "stable and metastable configurations. Those microstates may thus be\n", + "considered as the building blocks of individual phases \\[70\\].\n", + "\n", + "It has demonstrated in this chapter that the properties of a\n", + "macroscopically homogeneous system with multiple microstates are not a\n", + "linear combination of properties of constituent microstates and depends\n", + "significantly on the change rate of statistic probability of microstates\n", + "with respect to external fields. This change rate is determined by the\n", + "free energy difference between the stable and metastable microstates and\n", + "its change with respect to external fields. As shown in and , this\n", + "change rate can be correlated to the distance of the system with respect\n", + "to the critical point in the system. At the critical point, there is a\n", + "mathematical singularity when the single phase becomes unstable. When\n", + "the macroscopically homogeneous single-phase system moves away from the\n", + "critical point, its properties become less and less dramatic, but always\n", + "remain a certain degree of anomaly. The properties of a system can thus\n", + "be dramatically altered and designed by changing the position of the\n", + "critical point through adjustments of chemical compositions and strain\n", + "energy in thin films.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/index.ipynb b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/index.ipynb new file mode 100644 index 0000000..b9574b4 --- /dev/null +++ b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/index.ipynb @@ -0,0 +1,32 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "12bb1dc5", + "cell_type": "markdown", + "source": [ + "# Critical phenomena, thermal expansion, and Materials Genome\u00ae\n", + "\n", + "In Chapter , it was shown that all molar quantities of a homogeneous\n", + "system diverge at the critical point, i.e. the limit of stability,\n", + "including the additional ones shown in . As illustrated by , even though\n", + "each molar quantity changes in the same direction as its conjugate\n", + "potential, i.e. with the same sign, its dependence with respect to a\n", + "nonconjugate potentials can either be in the same sign or opposite\n", + "signs. It is often considered to be normal when they change in the same\n", + "direction, while abnormal when in different directions.\n", + "\n", + "In this chapter, the thermal expansion defined by , is used as an\n", + "example for detailed discussion of those extraordinary phenomena in the\n", + "context of a critical point based on the MMS model presented in Chapter\n", + ". The MMS model is first discussed in terms of thermal expansion and\n", + "then applied to elemental cerium (Ce) with the colossal positive thermal\n", + "expansion (CPTE) and Fe3Pt with negative thermal expansion\n", + "(NTE).\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/mms_model_applied_to_thermal_expansion.ipynb b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/mms_model_applied_to_thermal_expansion.ipynb new file mode 100644 index 0000000..849809b --- /dev/null +++ b/src/psu410/src/psu410/critical_phenomena_thermal_expansion_and_materials_genome/mms_model_applied_to_thermal_expansion.ipynb @@ -0,0 +1,127 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "5554609d", + "cell_type": "markdown", + "source": [ + "## MMS model applied to thermal expansion\n", + "\n", + "As shown in , the thermal expansion of a system can be positive, zero\n", + "and negative depending on the pressure dependence of entropy of the\n", + "system. Let us carry out a virtual experiment by analyzing a system\n", + "starting with one microstate only, *\u03b1*, when the metastable *\u03b2*\n", + "microstate has a higher entropy than the *\u03b1* microstate, i.e. and the\n", + "relative stability of the *\u03b2* microstate thus increases with\n", + "temperature. The cases with will be discussed after this starting with a\n", + "mixture of the *\u03b1* and *\u03b2* microstates.\n", + "\n", + "When a metastable microstate, *\u03b2*, is introduced by changing pressure\n", + "under constant temperature, based on and , the entropy change of the\n", + "system can be written as\n", + "\n", + "Eq. 9\u20111\n", + "\n", + "where represents the statistic probability of the microstate in the\n", + "system. With , this would results in a positive entropy change of , i.\n", + "e. , since . If this entropy increase is due to the decrease of\n", + "pressure, i.e. because volume and its conjugate potential (negative\n", + "pressure) change in the same direction, the volume thermal expansion of\n", + "the system is positive due to the increase of the population of the *\u03b2*\n", + "microstate with a larger volume. In this case,\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}} > 0$, and the\n", + "volume and entropy of the two microstates change in the same direction.\n", + "\n", + "On the other hand, if this entropy increase is realized by increasing\n", + "pressure, i.e. , the volume thermal expansion of the system is negative\n", + "due to the increase of the population of the *\u03b2* microstate with a\n", + "smaller volume. In this case,\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}} < 0$, and the\n", + "volume and entropy of the two microstates change in the opposite\n", + "directions.\n", + "\n", + "Therefore, the sign of\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}}$ of two\n", + "microstates can be used as a criterion to determine whether a system\n", + "possesses NTE, i.e. positive\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}}$ for positive\n", + "thermal expansion, and negative\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}}$ for NTE. At a\n", + "critical point, the entropy change with respect to temperature is\n", + "infinite, resulting in either infinite positive or infinite negative\n", + "thermal expansion correspondingly. When the system moves away from the\n", + "critical point into the macroscopically homogeneous single-phase region,\n", + "the thermal expansion becomes less positive or negative. A number of\n", + "systems with\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}} < 0$, thus\n", + "potentially NTE, are listed in the supplementary information of Ref.\n", + "\\[63\\].\n", + "\n", + "Now let us consider the case that the metastable *\u03b2* microstate has\n", + "lower entropy than the *\u03b1* microstate, i.e. , and the *\u03b2* microstate is\n", + "thus more stable at low temperatures. The system at higher temperatures\n", + "contains thus only the *\u03b1* microstate and has positive thermal\n", + "expansion. When the metastable *\u03b2* microstate is introduced, the sign of\n", + "the entropy change in can be either positive or negative because the\n", + "first term is negative and the second term is positive, and its sign\n", + "thus depends on the value of the entropy difference between two\n", + "microstates and the probability of the metastable *\u03b2* microstate. The\n", + "virtual experiment should thus be carried out in a system with the\n", + "highest MCE in , i.e. when the two microstates have the same free energy\n", + "and are in equilibrium with each other. From and , the system entropy\n", + "can be written as\n", + "\n", + "Eq. 9\u20112\n", + "\n", + "With the change of pressure, will either increase or decrease, and the\n", + "entropy of the system becomes\n", + "\n", + "Eq. 9\u20113\n", + "\n", + "The difference of and is obtained as\n", + "\n", + "Eq. 9\u20114\n", + "\n", + "The second term in is always negative, and the first term is also\n", + "negative if because . It is thus evident that if is increased by\n", + "decreasing pressure, the entropy of the system decreases, and the system\n", + "would possess negative thermal expansion because is negative, and the\n", + "entropy is reduced by the decrease of pressure. At the same time, and\n", + "$\\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}} < 0$, the latter\n", + "being the same condition for a negative thermal expansion as in the\n", + "first virtual experiment with . One can thus conclude that for a\n", + "two-phase equilibrium line with\n", + "$\\frac{dT}{dP} = \\frac{\\Delta V^{\\alpha\\beta}}{\\Delta S^{\\alpha\\beta}} < 0$,\n", + "both phases can display negative thermal expansion. On the other hand,\n", + "if is increased by increasing pressure, the system would possess\n", + "positive thermal expansion because the entropy is reduced by the\n", + "increase of pressure.\n", + "\n", + "Furthermore, the thermal expansion of a system can be approximated as\n", + "follows using the rule of mixture of volumes\n", + "\n", + "Eq. 9\u20115\n", + "\n", + "Eq. 9\u20116\n", + "\n", + "where , , , , , and are the thermal expansion coefficients and volumes\n", + "of the system and the \u03b1 and \u03b2 microstates, respectively. For\n", + "simplification, let us assume both microstates have similar positive\n", + "thermal expansion, i.e. , and becomes\n", + "\n", + "Eq. 9\u20117\n", + "\n", + "shows that it is the combination of volume difference and that\n", + "determines the macroscopic thermal expansion. By setting , one obtains\n", + "\n", + "Eq. 9\u20118\n", + "\n", + "For , for $p^{\\beta} \\geq 0$, and for , at $p^{\\beta} \\rightarrow 0$ .\n", + "The readers are reminded that the sign of is the same as the sign of .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/index.ipynb b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/index.ipynb new file mode 100644 index 0000000..1c57a2f --- /dev/null +++ b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/index.ipynb @@ -0,0 +1,34 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "f5d00303", + "cell_type": "markdown", + "source": [ + "# Experimental data for thermodynamic modeling\n", + "\n", + "The most widely used thermodynamic modeling technique is the CALPHAD\n", + "(CALculation of PHAse Diagram) method to be discussed in detail in\n", + "Chapter 6. The input data in the evaluations of thermodynamic model\n", + "parameters have been primarily from experiments and estimations until\n", + "first-principles calculations based on the density functional theory\n", + "\\[8\\] became a user tool in the later 1990\u2019s. Experimental data include\n", + "both thermodynamic and phase equilibrium data, while the\n", + "first-principles calculations, which only provide thermodynamic data of\n", + "individual phases, are discussed more extensively in Chapter .\n", + "\n", + "The three recently published books summarize the commonly used methods\n", + "on experimental measurements of thermodynamic properties of single \\[9\\]\n", + "and multiple phases \\[10\\] and phase diagrams \\[11\\]. They are briefly\n", + "discussed here, and readers are referred to these books for details. The\n", + "main techniques for crystal structure analysis include X-ray\n", + "diffraction, electron backscatter diffraction (EBSD), electron\n", + "diffraction in transmission electron microscopy, neutral scattering, and\n", + "synchrotron scattering, which are not discussed in this book.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/phase_equilibrium_data_from_experiments.ipynb b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/phase_equilibrium_data_from_experiments.ipynb new file mode 100644 index 0000000..c6acb65 --- /dev/null +++ b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/phase_equilibrium_data_from_experiments.ipynb @@ -0,0 +1,241 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "23a7020d", + "cell_type": "markdown", + "source": [ + "## Phase equilibrium data from experiments\n" + ], + "metadata": {} + }, + { + "id": "7334a053", + "cell_type": "markdown", + "source": [ + "### Equilibrated materials\n", + "\n", + "The most common method to determine phase equilibria is to use\n", + "equilibrated materials. This method typically involves material\n", + "preparation through high temperature melting or powder metallurgy,\n", + "homogenization heat treatment, isothermal or cooling/heating procedure,\n", + "and identifications of crystal structures and phase compositions. It is\n", + "important to avoid macro-inhomogeneity as it can be difficult remove the\n", + "inhomogeneity in subsequent treatments. It is also important to use\n", + "starting materials of highest purity and minimize the loss and\n", + "contamination of materials during the whole experiments using a\n", + "protective atmosphere of inert gas or vacuum. The typical melting\n", + "techniques include high temperature furnaces with crucibles, arc\n", + "melting, and induction melting. Attentions need to be paid for possible\n", + "reactions between materials and crucibles/containers, which can be\n", + "avoided by levitating the materials through electromagnetic fields or\n", + "other means. In addition to use pure elements as raw materials, master\n", + "alloys with well-controlled compositions are often utilized because the\n", + "compositions and melting properties of master alloys are usually much\n", + "closer to those of final materials than the pure elements. For materials\n", + "with very high melting temperature or volatile components, the powder\n", + "metallurgy method can be used where compacts are made, capsulated, and\n", + "sintered.\n", + "\n", + "Homogenization during subsequent heat treatment is achieved through\n", + "diffusion, in which time and temperature are two important parameters.\n", + "To accelerate the homogenization process, the heat treatment temperature\n", + "should be as close to the solidus temperature as possible taking into\n", + "account the composition inhomogeneity with variable solidus\n", + "temperatures. When there are phase transformations taking place during\n", + "the heat treatment, extra time is needed for the heat treatment.\n", + "\n", + "The phase boundaries are then determined through measurements of either\n", + "compositions of individual phases that are in equilibrium under constant\n", + "temperature, pressure/stress/strain, and electric/magnetic fields or\n", + "discontinuity in some physical properties of materials due to a phase\n", + "transition from the continuous change of temperature or\n", + "pressure/stress/strain or electric/magnetic fields. The measurement of\n", + "compositions is usually carried out at ambient conditions so it is\n", + "necessary that the phases are fully equilibrated at experimental\n", + "conditions, which requires rigorous verifications, and can be \u201cquenched\u201d\n", + "to ambient conditions to remain unaltered during \u201cquenching\u201d, at least\n", + "in terms of compositions. The compositions are typically measured by\n", + "scanning electron microscopy (SEM) equipped with energy dispersive\n", + "spectrometer (EDS) or wavelength dispersive spectroscopy (WDS), with a\n", + "micro-level spatial resolution and a better compositional resolution of\n", + "WDS than EDS. A dedicated SEM with WDS gives another important, widely\n", + "used composition measurement technique called electron probe\n", + "microanalysis (EMPA). For submicron-sized phases, analytical\n", + "transmission electron microscopy equipped with EDS can be used though\n", + "care must be taken to avoid interference from neighboring phases.\n", + "\n", + "To accurately identify phases in equilibrium under experimental\n", + "conditions, in-situ characterizations are necessary, which complicates\n", + "the experimentation. An alternative indirect method is to measure a\n", + "physical property that changes discontinuously or dramatically for a\n", + "first- or second-order phase transition, such as heat, volume, electric\n", + "conductivity, and magnetization. There are two widely used techniques in\n", + "measuring heat: differential thermal analysis (DTA) and differential\n", + "scanning calorimetry (DSC). Both attempt to measure the difference in\n", + "temperature with the same amount of power supplied between a sample and\n", + "an inert standard during heating or cooling. A DSC may also measure the\n", + "difference in the amount of power supplied to keep their temperatures\n", + "identical. The deviation of this difference from a baseline indicates a\n", + "phase transition in the sample and is plotted as a function of time or\n", + "temperature of either the sample or the inert standard. It is evident\n", + "that the major challenges in both DTA and DSC techniques are to reach\n", + "thermal equilibrium between the sample/standard and the instrument and\n", + "the thermodynamic equilibrium within the sample due to the continuous\n", + "heating or cooling. The thermal equilibrium can be improved or mitigated\n", + "through various methods such as sample shape and size, crucible\n", + "selection, mixture with the material used for the inert standard, and\n", + "with thermocouples in direct contact with the sample and the inert\n", + "standard. However, the thermodynamic equilibrium within the sample can\n", + "only be reached when the heating/cooling rate is comparable with the\n", + "rate of the phase transition in the sample, which is almost impossible\n", + "if the phase transition typically involves diffusion in solid phases.\n", + "Therefore, extreme care is needed in interpreting the temperature\n", + "determination and the amount of heat associated with the DTA/DSC curves\n", + "as discussed in detail in the reference \\[11\\].\n" + ], + "metadata": {} + }, + { + "id": "a64fc988", + "cell_type": "markdown", + "source": [ + "### Diffusion couples/multiples\n", + "\n", + "The major challenge in the equilibrated material approach is to ensure\n", + "that the whole sample reaches equilibrium. On the other hand the\n", + "diffusion couple/multiple technique does not require the whole sample to\n", + "be in equilibrium and is based on the assumption that any two phases in\n", + "contact are in equilibrium with each other at the phase interface, and\n", + "the phase compositions can be obtained by extrapolation of concentration\n", + "profiles in the two phases to the phase interface. Since the total\n", + "system of a diffusion couple is not at equilibrium, many kinetic\n", + "phenomena related to diffusion can be studied in a diffusion couple,\n", + "such as interdiffusion coefficients, parabolic growth kinetics of\n", + "product layer thickness, diffusion path (represented by the local\n", + "overall compositions) in ternary and multi-component systems for\n", + "visualizing the microstructure of reaction zones, and other properties,\n", + "all as a function of composition, which are beyond the scope of the\n", + "present book.\n", + "\n", + "Typical diffusion couples are in solid-state with two materials brought\n", + "into intimate contact to allow diffusion of elements between the two\n", + "materials though solid-liquid diffusion couples are also used. The\n", + "contacting faces are commonly ground and polished flat, clamped together\n", + "using mechanical mechanisms, and annealed at high temperatures where\n", + "diffusion can take place to a significant degree in a matter of days,\n", + "weeks or months. The samples are then quenched to retain the\n", + "high-temperature equilibrium features. For metallic systems, diffusion\n", + "couples can also be prepared by eletrolytical and electroless plating\n", + "techniques. It is important to avoid the formation of liquid during\n", + "annealing as it ruins the sample geometry. Furthermore, good adherence\n", + "at the interfaces is critical for reliable data.\n", + "\n", + "Since diffusion couples are not in a fully equilibrium state, the\n", + "tie-lines between two phases at the phase interfaces need to be obtained\n", + "by extrapolations of concentration profiles in neighbouring phases. The\n", + "electron propagation in quantitative EPMA is typically in the range of\n", + "1-2\u03bcm, yielding an excitation volume of approximately 2-4\u03bcm diameter and\n", + "a requirement of reasonable layer widths of phases on both sides of the\n", + "interface for accurate extrapolation. Therefore, the reliable\n", + "composition of a single phase must be taken several micrometers away\n", + "from the interface. When steep concentration gradients exist near the\n", + "interfaces, the extrapolation may lead to large errors, and analytical\n", + "electron microscopy is then needed. Furthermore, the fluorescence\n", + "effects, where the primary excitation can be powerful enough to excite\n", + "other elements in the sample, resulting in enhanced X-ray production and\n", + "the need of proper corrections. For a new phase to become observable\n", + "experimentally, it must nucleate and grow to reach the resolution limit\n", + "of analytical tools. It is thus not uncommon that some known equilibrium\n", + "phases are not found, and some non-equilibrium phases form. One way to\n", + "circumvent this issue is to use incremental diffusion couples with\n", + "narrow concentrations next to the phase of interest so that only this\n", + "phase may be formed.\n", + "\n", + "For ternary and higher-order systems, a more efficient approach can be\n", + "used by placing a thin layer of the third alloy between two alloys. The\n", + "thin central layer is eventually consumed, and the diffusion path is not\n", + "fixed as in the semi-infinite diffusion couples. The phase compositions\n", + "change continuously with time as a result of the overlapping of two\n", + "quasi-equilibrated diffusion zones.\n", + "\n", + "A diffusion multiple contains three or more pure elements or alloys of\n", + "different compositions and is a sample with multiple diffusion couples\n", + "and diffusion triples in it. It is more efficient in terms of both\n", + "materials and time in comparison with equilibrated alloys and diffusion\n", + "couples. All alloy blocks are prepared individually and sealed in vacuum\n", + "in a cylinder which is also used as one alloy for the diffusion\n", + "multiple. The sealed cylinder with vacuum inside also serves as the can\n", + "for subsequent hot isostatic pressing to achieve intimate interfacial\n", + "contacts. The cylinder can then be cut into disks for further annealing\n", + "treatments. A broad range of design strategies is needed for complex\n", + "diffusion multiples along with automated plotting procedures due to the\n", + "large amounts of EMPA data. The major source of error lies in the\n", + "extraction of tie-lines from EPMA results due to very condensed\n", + "information in a small area and the deviation of scanned lines from\n", + "those perpendicular to the interface.\n", + "\n", + "In terms of local equilibrium characteristics of diffusion\n", + "couples/multiples, it is evident that in the equilibrated materials\n", + "approach, it may not be necessary to reach the full equilibrium for the\n", + "whole sample if one is only interested in the local equilibrium\n", + "compositions between two neighboring phases, which can even provide\n", + "information on metastable extensions of two phases if the two phases are\n", + "in a metastable equilibrium at the annealing temperature.\n" + ], + "metadata": {} + }, + { + "id": "e4019523", + "cell_type": "markdown", + "source": [ + "### Additional methods\n", + "\n", + "Electrical resistivities of different phases are usually different. A\n", + "change of slope of electric resistivity as a function of composition or\n", + "temperature or pressure reflects a phase transformation. This technique\n", + "is simple and reliable.\n", + "\n", + "Magnetic transitions can be measured using a vibrating sample or\n", + "superconducting quantum interference device (SQUID) magnetometer by\n", + "determining the magnetic moment of a sample in presence of an applied\n", + "magnetic field. Magnetic field lines form closed loops, resulting in an\n", + "external dipolar and demagnetizing field in a finite-sized sample. The\n", + "effective field sensed by the sample is thus the difference between the\n", + "applied field and the demagnetizing field. The magnetic transition\n", + "temperature is evaluated from the Arrott plots where the ratio of\n", + "magnetic field over magnetization with a proper exponent is plotted with\n", + "respect to the magnetization with another proper exponent for a series\n", + "of temperatures. Those proper exponents result in parallel isotherm\n", + "lines, and the isotherm line intersecting the origin corresponds to the\n", + "magnetic transition temperature.\n", + "\n", + "Thin films with composition gradients, commonly referred to as\n", + "combinatorial libraries, can be used to study the phase relations\n", + "similar to diffusion couples/multiples though the results may differ due\n", + "to the effects of surface and potential interactions with the substrate.\n", + "\n", + "Phase relations at high pressures are measured in equipment using\n", + "diamond anvil cells (DAC) or multi-anvil devices. The high pressure is\n", + "realized by decreasing the area, i.e. the anvil culet size. Pressures up\n", + "to 100 GPa can be created in DAC with a culet size of 0.3mm for small\n", + "samples in the order of 0.2 to 0.4mm. For large samples, the\n", + "large-volume presses (LVP) technique is developed, typically using WC\n", + "with the pressure mostly limited to 30 GPa and the sample size ranging\n", + "from 1mm3 to 1cm3. The pressure can be measured by\n", + "either the ruby (Cr3+ doped Al2O3)\n", + "fluorescence line shift or the molar volume of a pressure marker by\n", + "X-ray diffraction. The samples in DAC apparatus are heated by laser or\n", + "resistive wire or a small heater around the samples, while high\n", + "temperatures in LVPs are achieved by resistive heaters. Crystal\n", + "structures are detected by in-situ X-ray or synchrotron diffraction.\n", + "Attentions need to be paid to temperature and pressure homogeneity and\n", + "the non-hydrostatic stresses, which are both better controlled in LVP\n", + "equipment.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/thermodynamic_data_from_experiments.ipynb b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/thermodynamic_data_from_experiments.ipynb new file mode 100644 index 0000000..c5245a9 --- /dev/null +++ b/src/psu410/src/psu410/experimental_data_for_thermodynamic_modeling/thermodynamic_data_from_experiments.ipynb @@ -0,0 +1,149 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "50fa3767", + "cell_type": "markdown", + "source": [ + "## Thermodynamic data from experiments\n", + "\n", + "Broadly speaking, thermodynamic data represents the values of Gibbs free\n", + "energy and all its first and second derivatives. For thermochemical\n", + "properties as the main topic of the book, calorimetric, electrochemical,\n", + "and vapor pressure methods are the primary techniques used with the\n", + "first for accurate measurement of enthalpy and entropy, and the latter\n", + "two for direct determination of Gibbs energy and activity. The\n", + "electrochemical method is discussed in Chapter . The calorimetric method\n", + "is divided into solution, combustion, direct reaction, and heat capacity\n", + "calorimetry, respectively, which all involve chemical reactions to be\n", + "discussed in detail in Chapter . The vapor pressure method involves the\n", + "equilibrium of volatile species between gas and samples and is divided\n", + "into Knudsen effusion and equilibration methods, respectively.\n" + ], + "metadata": {} + }, + { + "id": "28799218", + "cell_type": "markdown", + "source": [ + "### Solution calorimetry\n", + "\n", + "The book edited by Marsh and O\u2019Hare \\[12\\] documented the detailed\n", + "experimental techniques used for solution calorimetry. In one\n", + "experiment, the enthalpy of solution of a single phase is measured in a\n", + "particular solvent. To convert this enthalpy of solution into enthalpy\n", + "of formation of the phase, a thermodynamic cycle is setup for a chemical\n", + "reaction to form this phase from either constitutive pure elements or\n", + "compounds. Therefore in another experiment, the enthalpy of solution of\n", + "constitutive pure elements or compounds is measured in the solvent as\n", + "identical as possible to that used in the first experiment. The\n", + "difference of the two enthalpies of solution thus gives the enthalpy of\n", + "formation of the single phase from its constitutive elements or\n", + "compounds at the temperature of the samples before they are dropped into\n", + "the solvent, usually at room temperature.\n", + "\n", + "The solvent can be aqueous solutions at ambient temperatures and\n", + "pressures or metallic/salt/oxide melts at high temperatures under either\n", + "adiabatic or isoperibol conditions. The adiabatic calorimetry measures\n", + "the temperature change of the solvent and is usually more accurate than\n", + "the isoperibol calorimetry that measures the heat generated during the\n", + "dissolution, though the adiabatic ones are with more complex\n", + "instruments. It is important that the choices of solvent and temperature\n", + "ensure the complete dissolution of all substances into the solvent to\n", + "form a homogeneous solution. Furthermore, the effect of dilution and of\n", + "changes in solvent composition needs to be considered in the calculation\n", + "of enthalpy of solution.\n", + "\n", + "A large number of solvents are used. For aqueous solvent, hydrofluoric\n", + "acid or mixtures of HF and HCl are often used. For oxides, buffer-type\n", + "systems are typical such as lead and alkali borates and alkali\n", + "tungstates/molybdates. For metallic phases, low melting metals such as\n", + "Sn, Bi, In, Pb, and Cd, sometimes Al and Cu, are used. Factors such as\n", + "solubility, dissolution kinetics, thermal history, stirring, heat flow,\n", + "particle size, and system size are to be optimized for accurate\n", + "measurements. To enhance solution kinetics, the compound to be studied\n", + "can be mixed with another element or compound so that the mixture can\n", + "form liquid in the solvent at higher reaction rate. In any case, it is\n", + "important to calibrate the system with pure elements and compounds of\n", + "known enthalpy of formation.\n" + ], + "metadata": {} + }, + { + "id": "a3827671", + "cell_type": "markdown", + "source": [ + "### Combustion, direct reaction, and heat capacity calorimetry\n", + "\n", + "In combustion calorimetry, the sample is ignited and reacts with\n", + "reactive gases like oxygen or fluorine. To accurately calculate the\n", + "enthalpy of formation from the enthalpy of combustion, the reliable\n", + "characterization of reactants and reaction products is critical, such as\n", + "incomplete combustion, impurities in the reactants which are often\n", + "ill-defined, and more than one reaction gaseous species and condensed\n", + "phases. Combustion calorimeters are usually of isoperibol type around\n", + "room temperature in a water bath.\n", + "\n", + "The direct reaction calorimetry is similar to the combustion calorimetry\n", + "though at high temperatures in heat-flux or adiabatic environments. The\n", + "partial enthalpy of reaction can also be measured if the partial\n", + "pressure of volatile species can be controlled and measured. The key\n", + "factor for accurate results is that both the reactants and reaction\n", + "products are well characterized and the reaction goes to completion\n", + "quickly like in the combustion calorimetry. For reactive reactants,\n", + "special procedure is needed to avoid their loss before the reaction\n", + "takes place.\n", + "\n", + "Heat capacity is defined as the amount of heat needed to increase the\n", + "temperature by 1K as shown by , and its integration with respect to\n", + "temperature from 0K gives entropy as shown by . At low temperatures,\n", + "adiabatic calorimetry gives more accurate data of heat capacity though\n", + "it is time consuming and requires complex instruments. At high\n", + "temperatures, the efficient and less accurate DSC method is more widely\n", + "used.\n" + ], + "metadata": {} + }, + { + "id": "f2cb6d03", + "cell_type": "markdown", + "source": [ + "### Vapor pressure method\n", + "\n", + "In the Knudsen effusion method, a small amount of volatile species in\n", + "the gas phase effuses through a small orifice of 0.1 to 1 mm with\n", + "negligible influence of the equilibrium in the Knudsen cell. The vapor\n", + "is ionized and analyzed with a mass spectrometer. The partial pressure\n", + "of a species can be calculated from its ionization area and intensity\n", + "through a calibration factor determined by a reference material with\n", + "known partial pressure. For high temperature measurements, care must be\n", + "taken to avoid the reactions between cell and sample and fragmentation\n", + "of gas species on ionization. The typical vapor pressure range is\n", + "between 10-7 and 10 Pa.\n", + "\n", + "In various equilibration methods, the total vapor pressure is usually\n", + "measured directly using pressure gauges in the range of 10-7\n", + "and 100 kPa. Other direct or indirect methods include\n", + "\n", + "thermogravimetric method for measuring the vapor mass\n", + "\n", + "atomic absorption spectroscopy for gas composition\n", + "\n", + "measurement of sample composition equilibrated with a gas of\n", + "well-defined activity of the volatile species\n", + "\n", + "the dew point method in which the condensation temperature of the\n", + "volatile component is measured from the vapor equilibrated with the\n", + "sample at a higher temperature,\n", + "\n", + "the chemical transport method to be discussed in Chapter .\n", + "\n", + "The main error in all these methods is often due to inadequate\n", + "equilibration between vapor and sample.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_approaches_to_disordered_alloys.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_approaches_to_disordered_alloys.ipynb new file mode 100644 index 0000000..87467a4 --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_approaches_to_disordered_alloys.ipynb @@ -0,0 +1,254 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "f6f98fcb", + "cell_type": "markdown", + "source": [ + "## First-principles approaches to disordered alloys\n", + "\n", + "First-principles calcuations discussed so far strictly rely on the exact\n", + "atomic positions in the unit cells. A brutal-force approach for random\n", + "solution phase would be to directly construct a large supercell and\n", + "randomly decorate the host lattice with different types of atoms. Such\n", + "an approach would necessarily require very large supercells to\n", + "adequately mimic the statistics of the random solutions. Since\n", + "first-principles methods are computationally constrained by the number\n", + "of atoms that one can treat, this brute-force approach is\n", + "computationally prohibitive. Take a binary\n", + "A1-*x*B*x* substitutional alloy as illustrated in\n", + "as an example, for a system containing *N* atoms, there can be\n", + "2*N* possible number of configurations, which is an\n", + "astronomically large number when *N* is large. It is an impossible task\n", + "to explore such a huge configuration space with available computing\n", + "resources.\n", + "\n", + "Figure \u2011. Mapping of a substitutional A1-xBx alloy\n", + "into an Ising-like lattice model \\[39-40\\].\n", + "\n", + "As a result, approximations must be made to the first-principles\n", + "calculations. At present, there are mainly three approaches to\n", + "calculating the disordered solution phases: the coherent potential\n", + "approximation (CPA) \\[41\\], the cluster expansion (CE) \\[42\\], and the\n", + "special quasirandom structures (SQS\u2019s) \\[43\\] approach.\n", + "\n", + "CPA \\[41\\] treats random alloys by considering the *average* occupations\n", + "of lattice sites in solving the Kohn-Sham equation. Since a mean-field\n", + "approach is employed, dependence of properties on the local environments\n", + "surrounding an atom is not treated explicitly in CPA. In a random\n", + "solution, there exists a distribution of local environments (e.g., in\n", + "bcc alloys, A or B surrounded by the various\n", + "A*X*B8-*X* coordination shells with *X* between 0\n", + "and 8), resulting in local environmentally-dependent quantities such as\n", + "charge transfer and local displacements of atoms from their ideal\n", + "lattice positions. Even in random A1-*x*B*x* solid\n", + "solutions, the average A-A, A-B and B-B bond lengths are generally\n", + "different. These effects can be considered by the CE and SQS approaches,\n", + "which are the focus of the next two subsections. In following\n", + "subsections, unless specifically noted, the formulism for the binary\n", + "system is discussed for the sake of simplicity.\n" + ], + "metadata": {} + }, + { + "id": "e63b45c0", + "cell_type": "markdown", + "source": [ + "### Cluster Expansions\n", + "\n", + "Many properties of a solution phase such as energy are dependent on the\n", + "*configurations* - the arrangements of atoms on the lattice sites. In\n", + "cluster expansion \\[35, 42\\], the configuration dependence of properties\n", + "is formulated efficiently by a \u201clattice algebra\u201d which maps a\n", + "substitutional configuration into an Ising-like lattice model. Taking a\n", + "binary A1-*x*B*x* solution phase for instance, A\n", + "atoms are represented by the \u201cdown\u201d spins (*Si* = -1) and B\n", + "atoms are represented by the \u201cup\u201d spins (*Si* = +1) as\n", + "illustrated in . Using the cluster expansion technique, for a system\n", + "containing *N* atoms, the total energy of any alloy configuration *\u03c3* =\n", + "(*S*1, *S*2, \u2026, *SN*) can be\n", + "conveniently evaluated using the following Ising-like Hamiltonian:\n", + "\n", + "*Eq. 5\u2011147*\n", + "\n", + "where *J*\u2019s are the effective cluster interactions (ECI\u2019s); is a number\n", + "representing the atomic occupation at the lattice *i* under the\n", + "configuration *\u03c3*, which takes the values -1 and 1 for binary and -1, 0,\n", + "and 1 for ternary etc. In , the 2-site, 3-site, and 4-site correlations\n", + "are written as follows,\n", + "\n", + "Eq. 5\u2011148\n", + "\n", + "Eq. 5\u2011149\n", + "\n", + "Eq. 5\u2011150 .\n", + "\n", + "The expansion in would be exact as long as *all* the *n*-site\n", + "interactions are included. For a binary system, this can be observed by\n", + "the combination law that where is the number of *n*-site interactions.\n", + "However, in actual calculations, one never does an expansion to the\n", + "order *N* (containing 2*N* terms for binary) since it is too\n", + "long to be practical. In fact, since the interactions between widely\n", + "separated atoms are expected to be weaker than the interactions between\n", + "nearer atoms for most of the important properties, the expansion in is\n", + "usually truncated at certain distance to include only a few short-ranged\n", + "pair (2-site), triple (3-site), and up to the most, the quadruple\n", + "(4-site) interactions.\n", + "\n", + "Once a configuration is assigned, the *S*\u2019s are just the geometrical\n", + "factors. The common practice in the cluster expansion is that i) perform\n", + "first-principles calculations of a selected set of configurations\n", + "(around 20-100); ii) evaluate the values of *J*\u2019s using with the\n", + "energies from i); iii) use the fitted *J*\u2019s to predict the energy for a\n", + "desired set of configurations; and iv) make the ensemble average at a\n", + "given temperature for the energetics of the random alloys through Monte\n", + "Carlo simulations.\n" + ], + "metadata": {} + }, + { + "id": "a3f07054", + "cell_type": "markdown", + "source": [ + "### Special Quasirandom Structures\n", + "\n", + "SQS\u2019s \\[43-44\\] are specially designed *small-unit-cell* periodic\n", + "structures with minimal number of atoms per unit cell, which closely\n", + "mimic the most relevant, near-neighbor pair and multisite correlation\n", + "functions of random substitutional alloys. The correlation functions are\n", + "classified by their *n*-site component \u201cfigures\u201d *f* = (*n,m*), where\n", + "the index *n* is called vortex for pair, triple, and quadruple\n", + "correlations (*n* = 2, 3, and 4); *m* measures the correlation distance.\n", + "\n", + "In the SQS approach, a distribution of distinct local environments is\n", + "maintained and their average corresponds to the random alloy. Thus, a\n", + "single DFT calculation of an SQS can give many important alloy\n", + "properties (e.g. equilibrium bond lengths, charge transfer, formation\n", + "enthalpies, etc.) that depend on the existence of those distinct local\n", + "environments. The SQS approach has been used extensively to study the\n", + "formation enthalpies, bond length distributions, density of states, band\n", + "gaps and optical properties in semiconductor alloys. It is noted that\n", + "the CE approach can treat short-range ordering efficiently, while it is\n", + "not clear how the SQS approach can be used to represent short-range\n", + "ordering.\n", + "\n", + "The key quantities in the SQS approach are the *n*-site correlation\n", + "functions. Specifically, the 2-site correlation function corresponding\n", + "to the 2-site component \u201cfigures\u201d (2,*m*) is\n", + "\n", + "Eq. 5\u2011151\n", + "\n", + "where represents the total number of possible pairs with correlation\n", + "distance (neighboring distance) *Rij* being equal to *m*. The\n", + "3-site correlation function corresponding to the 3-site component\n", + "\u201cfigures\u201d (3,*m*) is\n", + "\n", + "Eq. 5\u2011152\n", + "\n", + "where represents the total number of all possible 3-site \u201cfigures\u201d with\n", + "the correlation distance (size and shape) *Rijk* being equal\n", + "to *m*. The 4-site correlation function corresponding to the 4-site\n", + "component \u201cfigures\u201d (4,*m*) is\n", + "\n", + "Eq. 5\u2011153 ,\n", + "\n", + "where represents the total number of all possible 4-site \u201cfigures\u201d with\n", + "correlation distance (size and shape) *Rijkl* being equal to\n", + "*m*.\n", + "\n", + "With a given supercell size *N*, the essential task of the SQS approach\n", + "is to search through all configurations that approach as close as\n", + "possible to the correlation functions of the perfectly random (*R*)\n", + "structure and for the binary system it is\n", + "\n", + "Eq. 5\u2011154 .\n", + "\n", + "Describing random alloys by small unit-cell periodical structures surely\n", + "introduces erroneous correlations beyond a certain distance. However,\n", + "since interactions between nearest neighbors are generally more\n", + "important than interactions between more distant neighbors, SQS\u2019s can be\n", + "constructed in such a way that they exactly reproduce the correlation\n", + "functions of a random alloy between the first few nearest neighbors,\n", + "deferring errors due to periodicity to more distant neighbors. The\n", + "practical procedure could be that to find the structures that match the\n", + "2-site correlation functions up to a given neighboring distance, and\n", + "then add the conditions matching the high order correlation functions up\n", + "to certain correlation distance.\n", + "\n", + "Appendix B is a collection of the SQS\u2019s with a variety of compositions\n", + "for binary fcc, bcc, hcp, and L12 structures, for ternary\n", + "fcc, bcc, and B2 structures, and Perovskite in the cubic ABO3\n", + "structure. The used format is that of VASP.\n" + ], + "metadata": {} + }, + { + "id": "fe975054", + "cell_type": "markdown", + "source": [ + "### Phonon calculations for SQS\n", + "\n", + "A somewhat more theoretically demanding application of the SQS approach\n", + "is the calculation of the phonon dispersions of a random alloy.\n", + "Considering the fact that the size of an SQS cell in general is around\n", + "8-32, phonon calculations based on SQS is doable, either using the SQS\n", + "cell or its supercell, e.g., of it. However, one notes that while the\n", + "phonon density of states can be calculated straightforwardly, the\n", + "calculations of the phonon dispersions run into a problem. That is,\n", + "since phonon calculation treats the SQS as primitive unit cell made of\n", + "more atoms than the primitive unit cell of the ideal lattice, the number\n", + "of phonon dispersions derived from a regular phonon calculations is a\n", + "lot greater than that measured for the random alloy. Say, one uses an\n", + "SQS containing 16 atoms for an fcc solid solution, the regular phonon\n", + "calculations would produce phonon dispersions in comparison to that just\n", + "three phonon dispersions from measurement. By averaging over the force\n", + "constants of a SQS, the dynamical matrix can be calculated with respect\n", + "to the wave vector space of the ideal lattice of the random alloys.\n", + "\n", + "One consideration that must be taken into account is that the phonon\n", + "dispersions measured from the inelastic neutron scattering experiments\n", + "only represent the averaged vibrations of the ideal lattice. For random\n", + "alloys or phases with minor geometry distortion, it is suggested to\n", + "calculate the dynamical matrix by instead of *Eq. 5\u2011125* as (see \\[45\\])\n", + "\n", + "*Eq. 5\u2011155* ,\n", + "\n", + "where in the case of random alloy, represents the averaged atomic mass\n", + "at the *j*th lattice site. The purpose of the summation over *Q* is to\n", + "average the effects of local distortions, making it possible of\n", + "comparing the calculated dispersions to the measured dispersions\n", + "representing the averaged vibrations of the ideal lattice. As a result,\n", + "the dimension of the SQS supercell dynamical matrix is thus reduced to\n", + "match that of the primitive unit cell of the ideal lattice for the\n", + "calculation of the phonon frequencies. The calculational procedure is as\n", + "follows:\n", + "\n", + "1. Make an SQS supercell based on the primitive unit cell of ideal\n", + " lattice to mimic the correlation functions of the random solution;\n", + "\n", + "2. Relax the SQS supercell with respect to the internal atomic\n", + " positions while keeping the cell shape and volume fixed;\n", + "\n", + "3. Make the phonon supercell by further enlarging the SQS supercell and\n", + " calculate the force constants; and\n", + "\n", + "4. Calculate the dynamical matrix , with the wave vector, **q**, being\n", + " defined from the primitive unit cell of the ideal lattice, through\n", + " the following Fourier transformation.\n", + "\n", + "The calculated phonon dispersions, along the directions (00\u03be), (0\u03be\u03be),\n", + "and (\u03be\u03be\u03be), are compared with the inelastic neutron scattering data in\n", + "for Cu3Au.\n", + "\n", + "Figure 5\u201113. Phonon dispersions for random Cu3Au. The solid\n", + "(black) lines represent the present calculation and the open circles\n", + "represent the inelastic neutron scattering data with details in Ref.\n", + "\\[45\\]. The dashed (blue) lines represent the calculated results using\n", + "the ab initio transferable force-constant model by Dutta et al. \\[46\\].\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_formulation_of_thermodynamics.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_formulation_of_thermodynamics.ipynb new file mode 100644 index 0000000..90be934 --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/firstprinciples_formulation_of_thermodynamics.ipynb @@ -0,0 +1,315 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "577c34be", + "cell_type": "markdown", + "source": [ + "## First-principles formulation of thermodynamics\n" + ], + "metadata": {} + }, + { + "id": "1ba93fb4", + "cell_type": "markdown", + "source": [ + "### Helmholtz energy\n", + "\n", + "In this chapter so far, all our discussions are limited to the case of a\n", + "system which is made from a single microstate (microscopic state). Here,\n", + "the terminology microstate refers to the microscopic structure that is\n", + "distinguished by crystal structure, atom distributions in the lattice\n", + "sites, and the arrangements of the local atomic spin and electronic\n", + "angular momentum distributions among the lattice sites. From this\n", + "section on, the index \u03c3 is employed to label the microstate. For a solid\n", + "material at finite temperatures, a phase can be formed by a single\n", + "microstate or a mixture of multiple microstates.\n", + "\n", + "Let us consider a canonical system made of *N* atoms with an average\n", + "atomic volume *V*. The study is limited to the motions of atomic nuclei\n", + "and electrons. For such a system, one can use to index the energy\n", + "eigenvalues of the corresponding microscopic Hamiltonian associated with\n", + "microstate *\u03c3*. The subscript **g** symbolically labels the different\n", + "vibrational states for the motions of atomic nuclei and the subscript\n", + "**n** symbolically labels the electronic states distinguished by the\n", + "different distributions of the electrons between the electronic valence\n", + "and conduction bands. Neglecting electron-phonon coupling, one can\n", + "assume that the contributions to between the vibrational and electronic\n", + "states are additive, so that\n", + "\n", + "*Eq. 5\u201116* ,\n", + "\n", + "where *Ec* is the static total energy of the microstate *\u03c3*.\n", + "Note that in and represent the energetics of the vibrational state and\n", + "the electronic state respectively.\n", + "\n", + "One then can formulate the canonical partition function of the\n", + "microstate *\u03c3* at the given temperature *T* and volume *V* as\n", + "\n", + "*Eq. 5\u201117* ,\n", + "\n", + "where *\u03b2* = 1/*kBT* with *kB* being the\n", + "Boltzmann\u2019s constant. As a result, with, the Helmholtz energy *F* per\n", + "atom for the microstate *\u03c3* is derived as follows:\n", + "\n", + "*Eq. 5\u201118* ,\n", + "\n", + "where the variable *N* has been abbreviated using\n", + "\n", + "*Eq. 5\u201119* ,\n", + "\n", + "*Eq. 5\u201120* ,\n", + "\n", + "*Eq. 5\u201121* .\n", + "\n", + "The calculation of *Ec* is straightforward in most of the\n", + "existing first-principles codes as discussed earlier.\n" + ], + "metadata": {} + }, + { + "id": "96ad1634", + "cell_type": "markdown", + "source": [ + "### Mermin statistics to the thermal electronic contribution \n", + "\n", + "For the calculation of *Fel* in , the most computationally\n", + "flexible approach is to use the Mermin statistics \\[28\\] by which\n", + "\n", + "*Eq. 5\u201122*\n", + "\n", + "where the bare electronic entropy *Sel* takes the form, after\n", + "replacing the summation in over the electronic states with integration\n", + "\n", + "*Eq. 5\u201123* ,\n", + "\n", + "by means of utilizing , the electronic density of states *n*. *f* in is\n", + "the Fermi distribution that takes the form\n", + "\n", + "*Eq. 5\u201124* .\n", + "\n", + "Note that in is the electronic chemical potential that is strongly\n", + "temperature dependent. At each given *T*, should be carefully calculated\n", + "keeping the number of electrons unchanged in solving the following\n", + "equation:\n", + "\n", + "*Eq. 5\u201125* ,\n", + "\n", + "noting that is the Fermi energy calculated at 0 K. With respect to , the\n", + "thermal electronic energy *Eel*, due to the thermal electron\n", + "excitations, can be calculated through\n", + "\n", + "*Eq. 5\u201126* .\n", + "\n", + "At low temperature, , , and are reduced to\n", + "\n", + "*Eq. 5\u201127*\n", + "\n", + "where *\u03bb* is the so-called electronic specific heat coefficient\n", + "calculated as\n", + "\n", + "*Eq. 5\u201128* ,\n", + "\n", + "where is the electronic density of states at the Fermi level, and\n", + "\n", + "*Eq. 5\u201129*\n", + "\n", + "*Eq. 5\u201130*\n", + "\n", + "From , one can easily derive the electronic contribution to the specific\n", + "heat at low temperature as\n", + "\n", + "*Eq. 5\u201131* .\n", + "\n", + "Usually, the dependence of on *V* is weak. Therefore for a normal\n", + "conductor (except for the heavy Fermion metal or superconductor related\n", + "materials), at low temperatures, the electronic contribution to the heat\n", + "capacity is linear against *T*. also indicates that for insulators, by\n", + "means of , the electronic contribution to the heat capacity is zero\n", + "since for insulators .\n" + ], + "metadata": {} + }, + { + "id": "b0eff4bb", + "cell_type": "markdown", + "source": [ + "### Vibrational contribution by phonon theory\n", + "\n", + "Under the harmonic/quasiharmonic approximation, the lattice dynamics or\n", + "phonon theory is currently the most established method. It truncates the\n", + "interaction potential up to the second order. In such a case, in can be\n", + "expressed in terms of phonon frequency as follows\n", + "\n", + "*Eq. 5\u201132* ,\n", + "\n", + "where the label **g** has the meanings of (*g1*,\n", + "*g2*, \u2026, *g3N*) that *gj* can take any\n", + "integer values from zero to infinite.\n", + "\n", + "As a result, is reduced to\n", + "\n", + "*Eq. 5\u201133* ,\n", + "\n", + "or equivalently,\n", + "\n", + "*Eq. 5\u201134* ,\n", + "\n", + "where an integration has been used to replace the summation in by means\n", + "of introducing a function, , named the phonon density of states (PDOS)\n", + "whose integration over *\u03c9* equals to three per atom.\n", + "\n", + "Accordingly, the formulation to calculate the entropy becomes\n", + "\n", + "*Eq. 5\u201135* ,\n", + "\n", + "the formulation to calculate the internal energy becomes\n", + "\n", + "*Eq. 5\u201136* ,\n", + "\n", + "and the formulation to calculate the heat capacity at constant volume\n", + "becomes\n", + "\n", + "*Eq. 5\u201137* .\n" + ], + "metadata": {} + }, + { + "id": "0349caf1", + "cell_type": "markdown", + "source": [ + "### Debye-Gr\u00fcneisen approximation to the vibrational contribution \n", + "\n", + "Strictly speaking, the Debye theory is only accurate at very low\n", + "temperatures. It assumes a parabolic type of dependence of PDOS\u00a0on the\n", + "phonon frequency. This assumption is only correct at the scale of 10\u2019s K\n", + "because at low temperatures,\u00a0only the low frequency acoustic phonons are\n", + "activated which play the major role for the parabolic type of PDOS for\n", + "the low frequency range as shown in . That is why\u00a0there are two kinds of\n", + "Debye temperature: low-temperature Debye temperature and\n", + "high-temperature\u00a0Debye temperature. The low-temperature Debye\n", + "temperature can be strictly derived by fitting low temperature heat\n", + "capacity data. The high-temperature\u00a0Debye temperature is mostly a\n", + "phenomenological fitting parameter.\n", + "\n", + "The Debye model approximates the PDOS in by\n", + "\n", + "*Eq. 5\u201138* ,\n", + "\n", + "where is the so-called Debye cutoff frequency related to the Debye\n", + "temperature as\n", + "\n", + "*Eq. 5\u201139* .\n", + "\n", + "As the result, the vibrational contribution to Helmholtz energy under\n", + "the Debye approximation becomes,\n", + "\n", + "*Eq. 5\u201140*\n", + "\n", + "where *D*(*\u0398D/T*) is the Debye function given by .\n", + "\n", + "Under the Debye approximation, the formulation to calculate the entropy\n", + "becomes\n", + "\n", + "*Eq. 5\u201141* ,\n", + "\n", + "the formulation to calculate the internal energy becomes\n", + "\n", + "*Eq. 5\u201142* ,\n", + "\n", + "where\n", + "\n", + "*Eq. 5\u201143* ,\n", + "\n", + "and the formulation to calculate the heat capacity at constant volume\n", + "becomes\n", + "\n", + "*Eq. 5\u201144* .\n", + "\n", + "Here it is noted that is volume dependent which is often written in\n", + "terms of Gr\u00fcneisen constant:\n", + "\n", + "*Eq. 5\u201145* .\n", + "\n", + "It has been found that the dependence of on *V* usually is weak and\n", + "hence is often approximated as a constant. With , the formulation to\n", + "calculate the pressure becomes\n", + "\n", + "*Eq. 5\u201146* .\n", + "\n", + "An important result of the Debye approximation is that when , together\n", + "with , the heat capacity in is reduced to\n", + "\n", + "*Eq. 5\u201147* .\n", + "\n", + "This gives the Debye T3 law when the thermal electron\n", + "contribution is neglected. In the analysis of superconductor and heavy\n", + "Fermion materials, is often rewritten as\n", + "\n", + "*Eq. 5\u201148* ,\n", + "\n", + "which is more convenient for examining the heat capacity measured at\n", + "extremely low temperatures.\n" + ], + "metadata": {} + }, + { + "id": "48b64474", + "cell_type": "markdown", + "source": [ + "### System with multiple microstates (MMS model)\n", + "\n", + "For a system made of multiple microstates, the total partition function\n", + "is the summation over the partition functions of all microstates, in ,\n", + "as\n", + "\n", + "*Eq. 5\u201149* ,\n", + "\n", + "where is the multiplicity of the microstate *\u03c3.* It is immediately\n", + "apparent that is the thermal population of the microstate *\u03c3*.\n", + "Furthermore, with , one obtains\n", + "\n", + "*Eq. 5\u201150* .\n", + "\n", + "relates the total Helmholtz energy, *F(N,V,T)*, of a system with mixing\n", + "among multiple microstates and the Helmholtz energy, , of individual\n", + "microstates. An important result of is the configurational entropy due\n", + "to the mixing among multiple microstates, named as microstate\n", + "configurational entropy (MCE) in this book,\n", + "\n", + "*Eq. 5\u201151* ,\n", + "\n", + "which makes the entropy of a system with mixing among multiple\n", + "microstates as\n", + "\n", + "*Eq. 5\u201152* .\n", + "\n", + "Similarly, one can get the heat capacity at constant volume of a system\n", + "with mixing among multiple microstates as\n", + "\n", + "*Eq. 5\u201153* ,\n", + "\n", + "where the configurational contributions to the heat capacity due to the\n", + "mixing among multiple microstates is\n", + "\n", + "*Eq. 5\u201154* .\n", + "\n", + "Moreover, the isothermal bulk modulus of a system with mixing among\n", + "multiple microstates can be also computed similarly\n", + "\n", + "*Eq. 5\u201155* ,\n", + "\n", + "With\n", + "\n", + "*Eq. 5\u201156*\n", + "\n", + "with being the partial pressure of the microstate *\u03c3*. This multiple\n", + "microstate model (MMS model) is used in Chapter to quantitatively\n", + "predict thermal expansion anomalies.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/index.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/index.ipynb new file mode 100644 index 0000000..248f881 --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/index.ipynb @@ -0,0 +1,60 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "097789bc", + "cell_type": "markdown", + "source": [ + "# First-principles calculations and theory\n", + "\n", + "In the previous chapter, the experimental techniques in obtaining the\n", + "thermochemical and phase equilibrium data that are the inputs for the\n", + "thermodynamic modeling of a system were summarized. However,\n", + "experimental data are not always available. This is due to the fact that\n", + "i) the experiments are expensive, especially true in developing new\n", + "materials; and ii) the experiments cannot reliably access the non-stable\n", + "phases in most cases. The alternative approach is to predict the\n", + "thermochemical data by first-principles calculations. The prediction of\n", + "the material properties, without using phenomenological parameters, is\n", + "the basic spirit of first-principles calculations. In particular, the\n", + "steady increase of both computer power and the efficiency of\n", + "computational methods have made the first-principles predictions of most\n", + "thermodynamic properties possible, including both enthalpy and entropy\n", + "as a function of temperature, volume, and/or pressure.\n", + "\n", + "By its definition, the term of \u201cfirst-principles\u201d represents a\n", + "philosophy that the prediction is to be based on a basic, fundamental\n", + "proposition or assumption that cannot be deduced from any other\n", + "proposition or assumption. This implies that the computational\n", + "formulations are based on the most fundamental theory of quantum\n", + "mechanics - Schr\u00f6dinger equation or density functional theory and the\n", + "inputs to the calculations must be based on well-defined physical\n", + "constants \u2013 the nuclear and electronic charges. In another word, once\n", + "the atomic species of an assigned material are known, the theory should\n", + "predict the energy of all possible crystalline structures, without\n", + "invoking any phenomenological fitting parameters.\n", + "\n", + "This chapter organized in the sequence from thermodynamic calculations\n", + "to fundamental theory to help those readers who are more interested in\n", + "realistic calculations using existing computer codes. The detailed\n", + "theoretical sections are presented to follow the section of\n", + "thermodynamic calculations for those readers who are also interested in\n", + "the derivation of the formulations used in the thermodynamic\n", + "calculations. The following subsections are arranged accordingly in the\n", + "order: (i) examples the commonly adopted calculation procedures for\n", + "thermodynamic properties using the elemental metal nickel as the main\n", + "prototype; (ii) derivation of the Helmholtz energy expression under the\n", + "first-principles framework; (iii) introduction of the solution to the\n", + "electronic Schr\u00f6dinger equation within the two well developed frameworks\n", + "\u2013 the quantum chemistry approach and the density functional theory; (iv)\n", + "detailed description of the procedure on how to solve the Schr\u00f6dinger\n", + "equation for the motions of the atomic nuclei by means of lattice\n", + "dynamics. The relation between the Helmholtz energy and Gibbs energy is\n", + "shown by .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/lattice_dynamics.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/lattice_dynamics.ipynb new file mode 100644 index 0000000..de9b4bd --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/lattice_dynamics.ipynb @@ -0,0 +1,390 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "bcb06510", + "cell_type": "markdown", + "source": [ + "## Lattice Dynamics\n" + ], + "metadata": {} + }, + { + "id": "48a67c32", + "cell_type": "markdown", + "source": [ + "### Quantum theory for motion of atomic nuclei\n", + "\n", + "For the convenience of discussion, the following convention of notations\n", + "are used: *\u03b1* and *\u03b2* to label the Cartesian axes which is either *x*,\n", + "*y*, or *z*, *j* and *k* to label atoms in the primitive unit cell,\n", + "*mj* the atomic mass of the *j*th atom in the\n", + "primitive unit cell, **r**(*j*) the position of the *j*th\n", + "atom in the primitive unit cell, *P* and *Q* the index of the primitive\n", + "unit cell in the system, **R**(*P*) the position of the *P*th\n", + "primitive unit cell in the system, and *V* the averaged volume of the\n", + "primitive unit cell.\n", + "\n", + "The quantum theory for motion of atomic nuclei replicates closely the\n", + "quantum theory for motion of electrons. That is to solve the wave\n", + "function for the motions of the atomic nuclei for a Schr\u00f6dinger\u2019s\n", + "equation with the potential being the total electronic energy derived\n", + "from . The symbol is replaced by to represent the static total\n", + "electronic energy with **R** representing the static equilibrium\n", + "positions of the atomic nuclei, **u** the displacements of atomic nuclei\n", + "away from their static equilibrium positions, and *\u03c3* the additional\n", + "degree of freedom such as electronic states. The Schr\u00f6dinger\u2019s equation\n", + "for the motion of atomic nuclei is then\n", + "\n", + "*Eq. 5\u2011103* ,\n", + "\n", + "where\n", + "\n", + "*Eq. 5\u2011104* ,\n", + "\n", + "with representing the kinetic energy operator\n", + "\n", + "*Eq. 5\u2011105* ,\n", + "\n", + "where *Nc* is the numbers of primitive unit cells in the\n", + "system, *Na* is the numbers of atoms in the primitive unit\n", + "cell, is the Plack constant, represents the *\u03b1*th Cartesian\n", + "component of **u** for the atom at *j*th lattice site in the\n", + "primitive unit cell and the *P*th primitive unit cell in the\n", + "system.\n", + "\n", + "The harmonic approximation \\[23, 33\\] truncates the into the second\n", + "order in its Taylor\u2019s series\n", + "\n", + "*Eq. 5\u2011106* ,\n", + "\n", + "where is the real-space interatomic force constant. With the\n", + "approximation of , it can be demonstrated that finding the solution of\n", + "is equivalent to finding the vibrational frequencies of a classical\n", + "system with *NcNa* particles for small mechanical\n", + "oscillations.\n", + "\n", + "Let us rewrite as\n", + "\n", + "*Eq. 5\u2011107* ,\n", + "\n", + "where\n", + "\n", + "*Eq. 5\u2011108* , and\n", + "\n", + "*Eq. 5\u2011109* .\n", + "\n", + "Accordingly, the kinetic energy operator in becomes\n", + "\n", + "*Eq. 5\u2011110* .\n" + ], + "metadata": {} + }, + { + "id": "f78bd8f1", + "cell_type": "markdown", + "source": [ + "### Normal coordinates, eigenenergetics, and phonons\n", + "\n", + "One way to simplify the solution to the Schr\u00f6dinger\u2019s equation for\n", + "motion of atomic nuclei is to follow the study of the vibrations of the\n", + "atoms in a crystal \u2013 lattice dynamics. The essential step in lattice\n", + "dynamics is to transform the problem of the correlated motions of 3*N*\n", + "particle into the problem of 3*N* independent harmonics. For this\n", + "purpose, one can introduce a set of new coordinates ( *i*=1, 2, \u2026,\n", + "3*N*), known as normal coordinates, by the transformation\n", + "\n", + "*Eq. 5\u2011111* ,\n", + "\n", + "where is the transformation coefficient that can be determined by\n", + "solving 3*N* simultaneous equations\n", + "\n", + "*Eq. 5\u2011112* ,\n", + "\n", + "where is to be determined so that one can find 3*N* , which are, not all\n", + "zero. The equations are linear and homogeneous. Follow the basic theorem\n", + "in linear algebra that, to find the nonzero solutions of the equations,\n", + "the determinant formed by must equal zero\n", + "\n", + "*Eq. 5\u2011113* ,\n", + "\n", + "where is the Kronecker delta symbol. Since is an equation with 3*N*\n", + "degrees, one can always find 3*N* values of (*i* = 1, \u2026, 3*N*). Each of\n", + "yields a set of which can be chosen such that\n", + "\n", + "*Eq. 5\u2011114* ,\n", + "\n", + "where represents the Kronecker delta symbol and\n", + "\n", + "*Eq. 5\u2011115*\n", + "\n", + "Then with the normal coordinates defined in and utilizing , defined in\n", + "is obtained as\n", + "\n", + "*Eq. 5\u2011116* .\n", + "\n", + "With this equation, is simplified by the following process\n", + "\n", + "*Eq. 5\u2011117* ,\n", + "\n", + "noting that in the above process and have been utilized.\n", + "\n", + "Furthermore, using , the kinetic energy operator in can be transformed\n", + "as follows\n", + "\n", + "*Eq. 5\u2011118* ,\n", + "\n", + "noting that in the above process and are utilized again.\n", + "\n", + "As a result, under the harmonic approximation, the Hamiltonian in is\n", + "simplified as\n", + "\n", + "*Eq. 5\u2011119*\n", + "\n", + "which represents a quantum system containing 3*N* independent harmonics.\n", + "Corresponding to the each of the *\u03c9i*, the quantum theory\n", + "tells that the eigenenergy of a harmonics has the form\n", + "\n", + "*Eq. 5\u2011120* ,\n", + "\n", + "with *gi* = 0, 1, \u2026, \u221e. Such a type of energetics behaves\n", + "like a Boson particle with energy and forms the concept of phonon.\n", + "\n", + "Furthermore, a state of the whole system is to be specified by the set\n", + "of 3*N* independent quantum numbers **g** = (*g1*,\n", + "*g1*, \u2026, *g3N*,). Finally, the energetics of a\n", + "state of the system formed by 3*N* independent harmonics, introduced by\n", + ", is obtained with the summation of the energies of 3*N* independent\n", + "harmonics as\n", + "\n", + "*Eq. 5\u2011121* .\n", + "\n", + "This concludes the rationale by which how is derived.\n" + ], + "metadata": {} + }, + { + "id": "0a0a3f25", + "cell_type": "markdown", + "source": [ + "### Dynamical matrix and phonon mode\n", + "\n", + "Because of the periodicity of a crystal, one can make an initial guess\n", + "that the solutions of are elastic plane waves made of a collective\n", + "atomic vibrations \\[23, 33\\], from the harmonic approximation of ,\n", + "\n", + "*Eq. 5\u2011122* ,\n", + "\n", + "where *\u03c9* represents the frequency of the plane wave, and is a wave\n", + "vector designating the wave number and direction along which the plane\n", + "wave propagates. It should be pointed out that in is now independent of\n", + "the index *P.* That is, except for a phase factor, the atoms that are\n", + "equivalent by the translational symmetry among different primitive unit\n", + "cells will experience the same type of atomic motion, independent of the\n", + "positions of the primitive unit cell in the system. This is equivalent\n", + "to applying the periodic condition so that in obeys\n", + "\n", + "*Eq. 5\u2011123* .\n", + "\n", + "Note that is now independent of the index *P*.\n", + "\n", + "Furthermore, one wants to limit **q***t* in and to those\n", + "known as the exact wave vectors which represent a special set of points\n", + "in the reciprocal space that satisfy the condition\n", + "\n", + "*Eq. 5\u2011124* ,\n", + "\n", + "where is the Kronecker delta function. In fact, the number of equals to\n", + "the number of primitive unit cells contained in the system.\n", + "\n", + "Utilizing the translational invariance by which in \\[or in \\] depends on\n", + "*P* and *Q* only through the difference , the following Fourier\n", + "transformation can be employed to simplify\n", + "\n", + "*Eq. 5\u2011125* ,\n", + "\n", + "and one obtains\n", + "\n", + "*Eq. 5\u2011126* .\n", + "\n", + "The counterpart of with respect to is\n", + "\n", + "*Eq. 5\u2011127*\n", + "\n", + "is now an equation with 3*Na* degrees of freedom. At each ,\n", + "one can always find 3*Na* eigenvalues of (*i* = 1, \u2026,\n", + "3*Na*). The 3*Na* vibrations are often known as\n", + "phonon modes, noting again that *Na* is the number of atoms\n", + "in the primitive unit cell. Each of yields a set of which can be chosen\n", + "such that\n", + "\n", + "*Eq. 5\u2011128* ,\n", + "\n", + "where represents the complex conjugate of , and\n", + "\n", + "*Eq. 5\u2011129*\n", + "\n", + "Finally, for a solid, the summation over *Q* in can be abbreviated out,\n", + "resulting in, after transforming back to together with using\n", + "\n", + "*Eq. 5\u2011130* ,\n", + "\n", + "because of translational invariance by which depends on *P* and *Q* only\n", + "through the difference .\n", + "\n", + "In the case that a system is built by a parallelepiped multiplication of\n", + "the primitive unit cell with lattice vectors of **a***\u03b1*\n", + "(\u03b1=*x*, *y*, and *z*) in the form , in and takes the form\n", + "\n", + "*Eq. 5\u2011131* ,\n", + "\n", + "where = 0, 1, \u2026, , and is the primitive lattice vector in the reciprocal\n", + "space as\n", + "\n", + "*Eq. 5\u2011132* ,\n", + "\n", + "with *Va* representing the volume of the primitive unit cell\n", + "given as\n", + "\n", + "*Eq. 5\u2011133* .\n", + "\n", + "Combine and , it is easy to demonstrate\n", + "\n", + "*Eq. 5\u2011134* ,\n", + "\n", + "where is the Kronecker delta symbol.\n", + "\n", + "It can be shown that the **q** points defined in represent the exact\n", + "wave points. First, can be written as\n", + "\n", + "*Eq. 5\u2011135* ,\n", + "\n", + "where = 0, 1, \u2026, . Then, the left hand side of for the definition of\n", + "exact wave vector becomes\n", + "\n", + "*Eq. 5\u2011136* .\n", + "\n", + "Knowing the fact that\n", + "\n", + "*Eq. 5\u2011137* .\n", + "\n", + "Hence, it is proved the **q** points defined in are the exact wave\n", + "points.\n" + ], + "metadata": {} + }, + { + "id": "a7d6dd73", + "cell_type": "markdown", + "source": [ + "### Linear-response method vs supercell method\n", + "\n", + "The problem of lattice vibration for a solid is now transformed into\n", + "computing the dynamical matrix in . The first-principles solution of the\n", + "problem is currently divided into two categories: the linear-response\n", + "method \\[34\\] and the supercell method \\[35\\]. In the linear-response\n", + "method, utilizing the electronic linear response upon the undistorted\n", + "crystals \\[36\\], the evaluations of the dynamical matrix can be\n", + "performed through the density-functional perturbation theory \\[34\\]\n", + "without the approximation of the cutoff in neighboring interaction.\n", + "\n", + "Compared with the linear-response method, the supercell method is\n", + "conceptually simple and is easy to implement computationally. The\n", + "supercell method adopts the frozen phonon approximation through which\n", + "the changes in total energy or forces are calculated in the direct space\n", + "by displacing the atoms from their equilibrium positions. The advantage\n", + "of the supercell method is that the phonon frequencies at the exact wave\n", + "vectors, which are commensurable with the supercell, are calculated\n", + "exactly with no further approximation \\[37\\]. The shortcoming of the\n", + "supercell method is that it is often limited by the size of the\n", + "supercell that can be handled with current computing resources.\n", + "\n", + "In supercell approach, inaccuracies are thought to arise from the\n", + "truncation of the force constants \\[34-35\\]. This is only partially\n", + "true. In the supercell method, the calculated represents the cumulative\n", + "contributions of the atom indexed by *k* and *P* in the supercell and\n", + "all its images by translational transformation of the supercell in the\n", + "whole space. Let **L**\u03b1 represent the lattice vectors of the\n", + "supercell, then\n", + "\n", + "*Eq. 5\u2011138* .\n", + "\n", + "For the exact wave vectors in , one has\n", + "\n", + "*Eq. 5\u2011139* **,**\n", + "\n", + "where is an integer. Replacing in with in , one obtains\n", + "\n", + "Eq. 5\u2011140 .\n", + "\n", + "Therefore, the phonon frequencies calculated at the exact wave vectors\n", + "by the cumulative force constants approach are exact, and the supercell\n", + "size will not lead to errors in the calculated phonon frequencies\n", + "\\[37\\].\n", + "\n", + "Generally speaking, if a supercell contains *Nc* primitive\n", + "unit cells, one can always find *Nc* corresponding exact wave\n", + "vectors in the **q** space. In most linear response calculations, the\n", + "common choice of a 4\u00d74\u00d74 **q**-mesh is exactly equivalent to the 4\u00d74\u00d74\n", + "supercell in the real-space. Furthermore, since the supercell approach\n", + "does not impose any approximation on the electronic response to the\n", + "distortion of the lattice geometry, the effects of electron-phonon\n", + "interactions can be accounted for by the supercell method.\n", + "\n", + "In the supercell method, due to the impose of periodic condition, the\n", + "calculated force constant in the real-space cannot account for the\n", + "effects of the vibration-induced electric field for the polar materials.\n", + "It has been demonstrated that such an effect adds an additional term to\n", + "dynamical matrix in the reciprocal-space in the form,\n", + "\n", + "*Eq. 5\u2011141* ,\n", + "\n", + "where ***Z**\\* (j)* represents the Born effective charge\n", + "tensor of the *j*th atom in the primitive unit cell and\n", + "**\u03b5\u221e** the high frequency static dielectric tensor, i.e., the\n", + "contribution to the dielectric permittivity tensor from the electronic\n", + "polarization. As a result for the polar materials, the matrix element at\n", + "wave vector **q**\u21920 of the dynamical matrix in , by means of , should\n", + "have the form\n", + "\n", + "*Eq. 5\u2011142* .\n", + "\n", + "It can be demonstrated \\[38\\] that this is equivalent to replacing the\n", + "real space force constant in by\n", + "\n", + "*Eq. 5\u2011143* .\n", + "\n", + "The present implementation of the first-principles method in calculating\n", + "the phonon frequencies are mostly limited by the supercell size when\n", + "using or the number of exact wave vector points when using . A supercell\n", + "cell built on the primitive unit cell or exact wave vector mesh is\n", + "usually the common limit. If only the phonon frequencies derived from or\n", + "are used, can be rather unsmooth which will result in inaccurate\n", + "thermodynamic properties when it is used with . The mixed-space approach\n", + "\\[38\\] can circumvent this bottleneck by using the Fourier interpolation\n", + "to calculate the dynamical matrix for an arbitrary wave vector **q** as\n", + "\n", + "*Eq. 5\u2011144* ,\n", + "\n", + "with the help of , , and for a polar materials. Note that the term is\n", + "for polar materials only.\n", + "\n", + "The can be calculated as\n", + "\n", + "*Eq. 5\u2011145* ,\n", + "\n", + "where the function is usually taken as the Gaussian type\n", + "\n", + "*Eq. 5\u2011146* ,\n", + "\n", + "where is an adjustable damping (broadening) parameter whose role is to\n", + "smear the curve. in is the number of used **q** points. Empirically, a\n", + "**q** mesh of is accurate enough for most purposes and doable with the\n", + "YPHON code \\[15\\] efficiently, which is discussed in the Appendix A.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/nickel_as_the_prototype.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/nickel_as_the_prototype.ipynb new file mode 100644 index 0000000..416ecd4 --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/nickel_as_the_prototype.ipynb @@ -0,0 +1,340 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "907eac6b", + "cell_type": "markdown", + "source": [ + "## Nickel as the prototype\n", + "\n", + "This section exemplifies the step-by-step procedure in calculating the\n", + "thermal properties within the framework of first-principles phonon\n", + "approach, using the elemental metal Ni as the prototype. The calculation\n", + "of the formation enthalpy of Ni3Al is given at the end. The\n", + "calculation in this section is limited to the case for the ferromagnetic\n", + "phase, i.e. single microstate, implying that no configurational mixtures\n", + "or magnetic phase transitions is considered which is discussed in\n", + "Chapter 5.2.5 and Chapter 6.\n", + "\n", + "The Vienna Ab-initio Simulation Package (VASP) \\[13-14\\] has been\n", + "employed for electronic calculations, and the YPHON code \\[15\\] has been\n", + "employed for phonon calculations. VASP is a code based on the\n", + "pseudopotential approach to the density functional theory using plane\n", + "wave function as the basis set, by which only the valence electrons are\n", + "handled explicitly and the core electrons are approximated by an\n", + "effective pseudopotential. The same energy cutoff values, which\n", + "determine the number of plane waves in the expansion of electronic wave\n", + "function, have been used for Ni, Al, and Ni3Al. The rationale\n", + "for the derivations of the formulations used in this section is to be\n", + "given in Chapter for readers who want to have an in-depth understanding\n", + "of the physics behind the used formulations.\n" + ], + "metadata": {} + }, + { + "id": "548a5194", + "cell_type": "markdown", + "source": [ + "### Helmholtz energy and quasiharmonic approximation\n", + "\n", + "At present, the most rigorous method to predict the thermodynamic\n", + "properties of a material at finite temperatures is the phonon approach.\n", + "In such an approach, the microscopic Hamiltonian is expanded up to the\n", + "second order. All the thermodynamic quantities are calculated using\n", + "formulations derived from the statistical physics without further\n", + "approximation. The great importance of the phonon theory is that all the\n", + "input parameters can be obtained by means of first-principles\n", + "calculations without using any phenomenological parameters.\n", + "\n", + "Let us consider a system with an averaged atomic volume *V*. Neglecting\n", + "the electron phonon coupling, it is a well demonstrated procedure \\[16\\]\n", + "to decompose the Helmholtz energy *F*(*V*,*T*) of the system at\n", + "temperature *T* into three additive contributions as follows\n", + "\n", + "*Eq. 5\u20111* ,\n", + "\n", + "where *Ec* is the static total energy which is the total\n", + "energy of the system at 0 K without any atomic vibrations,\n", + "*Fvib* is the vibrational contribution due to the lattice\n", + "ions, and *Fel* is the electronic contribution due to the\n", + "thermal electronic excitation at finite temperature which can become\n", + "important for metals at high temperature.\n", + "\n", + "The terminology of \u201cquasiharmonic approximation\u201d arises from the fact\n", + "that for a given volume, *Fvib*(*V*,*T*) is calculated under\n", + "the harmonic approximation and the anharmonic effects are carried out\n", + "solely through volume dependence of the phonon frequency. The easiest\n", + "computational implementation of is to first independently calculate the\n", + "Helmholtz energy at several selected volumes near the equilibrium volume\n", + "and then use the numerical interpolation to find the Helmholtz energy at\n", + "an arbitrary volume. The volume interval is usually at the scale of 3~5%\n", + "of the equilibrium volume. Too small volume interval can result in\n", + "numerical instability due to the numerical uncertainties in the static\n", + "total energy calculation, in particular, when one numerically computes\n", + "the first- and especially the second-order derivatives of the Helmholtz\n", + "energy in deriving the thermodynamic quantities. It should be noted that\n", + "whenever available, analytic formulas should be used instead of the\n", + "numerical second-order derivative to avoid numerical errors. For\n", + "instance, when the phonon approach is employed, the constant volume heat\n", + "capacity has the analytic expression in terms of phonon density of\n", + "states.\n", + "\n", + "Nickel metal adopts the fcc structure at ambient conditions and the\n", + "primitive unit cell contains one atom. Almost all the existing\n", + "first-principles codes have the function to calculate the static total\n", + "energy. The static total energy *Ec* in should be calculated\n", + "using the primitive unit cell. As the Helmholtz energy is to be\n", + "calculated at several volumes, a good practice is to plot the calculated\n", + "static total energy points together with the interpolated energy curve\n", + "to examine the convergence of the static total energy calculation. Since\n", + "the first-principles method often employs the self-consistent technique,\n", + "it could occur that calculations at certain volumes may not convergent,\n", + "which should be fixed by trying the various algebraic schemes provided\n", + "in most of the existing codes. Furthermore, since certain calculations\n", + "involve the second order derivative of the Helmholtz energy, a minor\n", + "uncertainty along the static total energy curve can result in large\n", + "deviation for the calculated properties such as thermal expansion\n", + "coefficient and bulk modulus. In that case, a reasonable solution is to\n", + "smoothen the static total energy using the modified Birch-Murnaghan\n", + "equation of states (EOS) \\[17-18\\]\n", + "\n", + "*Eq. 5\u20112* .\n", + "\n", + "Plotted in is the calculated static total energy of the elemental metal\n", + "Ni with the circles representing the calculated values and the curve\n", + "representing that by EOS fitting.\n", + "\n", + "Figure \u2011. Static total energy of nickel.\n", + "\n", + "The vibrational contribution to the Helmholtz energy by phonon theory\n", + "can be computed by \\[19\\]\n", + "\n", + "*Eq. 5\u20113* ,\n", + "\n", + "where is the Boltzmann\u2019s constant, *\u03c9* represents the phonon frequency,\n", + "and is the phonon density of states. It is recommended that is\n", + "calculated at the same volume set at which the static total static\n", + "energies are calculated.\n", + "\n", + "For the present prototype of Ni, the supercell method for the\n", + "calculation of has been employed. The procedure is follows:\n", + "\n", + "1. Make supercell by enlarging the primitive unit cell according to the\n", + " > defined neighbor interaction distance; Employ the first-principles\n", + " > code (VASP, \\[13-14\\] in this work) to calculate the interatomic\n", + " > force constants.\n", + "\n", + "2. Assign the mesh in the wave vector (**q**) space; Make the dynamical\n", + " > matrix at each **q** point; Diagonalize the dynamical matrix to\n", + " > find out the phonon frequencies at each **q** point; And finally\n", + " > collect all the phonon frequencies for all **q** points. The\n", + " > detailed formulation for phonon calculations is given in Chapter .\n", + "\n", + "For the phonon calculations, one can use the open source code YPHON\n", + "\\[15\\] by the present authors. Other choices can be the free ATAT code\n", + "\\[20\\] or the free PHON code \\[21\\]. For the calculation of the phonon\n", + "density of states, we have made a supercell containing 64 atoms which is\n", + "a 4\u00d74\u00d74 supercell of the primitive unit cell. Plotted in is the\n", + "calculated phonon density of states using YPHON code at the calculated\n", + "static equilibrium volume compared with the measured data at 10 K \\[22\\]\n", + "(symbols).\n", + "\n", + "Figure \u2011. Phonon density of states of nickel.\n", + "\n", + "For a first-principles thermodynamic calculation, an important step to\n", + "avoid possible calculation errors is to examine the phonon dispersions\n", + "first. Phonon dispersion \\[23\\] depicts the evolution of phonon\n", + "frequencies along the designated direction for a crystal. Phonon\n", + "dispersion can be measured rather accurately by inelastic neutron\n", + "scattering \\[24-26\\] or inelastic x-ray scattering \\[27\\] experiment.\n", + "Plotted in are the calculated phonon dispersions (curves) along the\n", + "\\[00\u03b6\\], \\[0\u03b61\\], \\[0\u03b6\u03b6\\], and \\[\u03b6\u03b6\u03b6\\] directions of Ni using YPHON code\n", + "compared with the neutron scattering data at 296 K (symbols) with\n", + "details in Ref. \\[16\\].\n", + "\n", + "Figure \u2011. Phonon dispersions of nickel. The solid lines represent\n", + "results calculated using a supercell containing 256 atoms which is 4\u00d74\u00d74\n", + "supercell of the conventional cubic unit cell. The dot-dashed lines\n", + "represent results calculated using a supercell containing 64 atoms which\n", + "is 4\u00d74\u00d74 supercell of the primitive unit cell.\n", + "\n", + "For the calculation of *Fel* in , the most computationally\n", + "convenient approach is to use the Mermin statistics as follows\n", + "\n", + "*Eq. 5\u20114* ,\n", + "\n", + "where is the thermal electronic energy, and *Sel* is the bare\n", + "electronic entropy. Both the calculations of and *Sel* need\n", + "the electronic density of states (EDOS) as input. The electronic density\n", + "of states can be obtained during the step of the static total energy\n", + "calculation. The detailed formulations for and *Sel* are\n", + "given in Chapter . Since Ni is magnetic, the EDOS of Ni can be\n", + "partitioned into those of spin up and spin down due to the spin freedom\n", + "of electron. The calculated EDOS for Ni is shown in where the solid,\n", + "dot-dashed, and dashed lines represent the total, spin up, and spin down\n", + "EDOS with the Fermi energy set to zero.\n", + "\n", + "Figure \u2011. Electronic density of states of nickel. That due to spin up is\n", + "plotted as positive value and that due to spin down is plotted as\n", + "negative value purely for the clarity of the figure. The \u201ctotal\u201d is the\n", + "sum of the absolute values of those of spin up and spin down.\n", + "\n", + "The calculated temperature evolution of Helmholtz energy as a function\n", + "of volume for Ni are illustrated in . The circles represent the\n", + "calculated static total energies. The solid curves represent the\n", + "Helmholtz energy curves from 0 to 1600 K at a temperature increment of\n", + "100 K as displayed from top to bottom in . The dashed line marks the\n", + "evolution of the equilibrium volume at *P*=0 with increasing\n", + "temperature. It is noted that Helmholtz energy always decreases with\n", + "increasing temperature due to the entropy term of \u2013*TS*. Note that the\n", + "at 0 K the Helmholtz energy is higher than the static total energy due\n", + "to the zero point vibrational energy as can be seen when *T* \u21920 which\n", + "reduces to\n", + "\n", + "*Eq. 5\u20115* ,\n", + "\n", + "which is positive.\n", + "\n", + "Figure \u2011. Temperature evolution of the Helmholtz energy for nickel.\n" + ], + "metadata": {} + }, + { + "id": "102628bc", + "cell_type": "markdown", + "source": [ + "### Volume, entropy, enthalpy, thermal expansion, bulk modulus, and heat capacity \n", + "\n", + "The equilibrium volume *Veq* (*P*,*T*) at given *T* and *P*\n", + "can be obtained by finding the root of the following equation\n", + "\n", + "*Eq. 5\u20116* .\n", + "\n", + "The dashed line in illustrates *Veq* (*P*,*T*) as a function\n", + "of *T* from 0 to 1600 K at *P* = 0 for Ni.\n", + "\n", + "The entropy can be calculated through *F* by\n", + "\n", + "*Eq. 5\u20117* .\n", + "\n", + "Plotted in is the calculated entropy (curve) of Ni as a function of\n", + "temperature from 0 to 1600 K at *P* = 0 compared with the recommended\n", + "data (symbols) with details in Ref. \\[16\\].\n", + "\n", + "Figure \u2011. Entropy of nickel as a function of temperature.\n", + "\n", + "Based on *F* and *S*, the enthalpy at given *P* and *T* can be computed\n", + "as\n", + "\n", + "*Eq. 5\u20118* .\n", + "\n", + "Plotted in is the calculated enthalpy (curve) of Ni as function of\n", + "temperature from 0 to 1600 K at *P* = 0 comparing with the recommended\n", + "data (open circles) with details in Ref. \\[16\\]\n", + "\n", + "Figure \u2011. Enthalpy of nickel as a function of temperature.\n", + "\n", + "With the equilibrium volume *Veq* (*P*,*T*) calculated by ,\n", + "the volume thermal expansion coefficient defined by can be calculated by\n", + "\n", + "*Eq. 5\u20119* .\n", + "\n", + "Plotted in is the calculated thermal expansion coefficient (curve) of\n", + "nickel as function of temperature from 0 to 1600 K at *P* = 0 comparing\n", + "with experimental data (symbols) with details in Ref. \\[16\\]\n", + "\n", + "Figure \u2011. Volume thermal expansion coefficient of nickel as a function\n", + "of temperature.\n", + "\n", + "The bulk modulus of a material represents the substance's resistance to\n", + "uniform compression. Depending on how the temperature varies during\n", + "compression, a distinction should be made between the isothermal bulk\n", + "modulus (constant temperature) and adiabatic bulk modulus (constant\n", + "entropy or no heat transfer). As a matter of fact, most of the\n", + "experimental data are adiabatic whereas most of the published\n", + "theoretical data are isothermal.\n", + "\n", + "The isothermal bulk modulus, as defined in terms of Gibbs energy shown\n", + "by , can be calculated by\n", + "\n", + "*Eq. 5\u201110*\n", + "\n", + "Based on the isothermal bulk modulus, the adiabatic bulk modulus can be\n", + "calculated by\n", + "\n", + "*Eq. 5\u201111* ,\n", + "\n", + "where *CP* and *CV* represent the constant\n", + "pressure heat capacity and constant volume heat capacity respectively.\n", + "Plotted in is the calculated bulk moduli (curves) of Ni as function of\n", + "temperature from 0 to 1600 K at *P* = 0. The experimental data are from\n", + "ultrasonic measurements (symbols, see Ref. \\[28\\] for more details) that\n", + "are therefore adiabatic bulk moduli calculated based on the measured\n", + "adiabatic elastic constants using the relation\n", + "\n", + "*Eq. 5\u201112* .\n", + "\n", + "Figure \u2011. Bulk moduli of nickel as a function of temperature. Solid\n", + "line: adiabatic; Dashed line: isothermal.\n", + "\n", + "The heat capacity at constant volume, as defined in terms of Gibbs\n", + "energy shown by Eq. 2\u201128, can be calculated by\n", + "\n", + "*Eq. 5\u201113* ,\n", + "\n", + "where represents the internal energy. The heat capacity at constant\n", + "pressure (see ) can then be calculated as\n", + "\n", + "*Eq. 5\u201114* ,\n", + "\n", + "utilizing the calculated thermal expansion coefficient in and bulk\n", + "modulus in .\n", + "\n", + "It can be advocated that thermal expansion makes the difference between\n", + "the heat capacity at constant volume and the heat capacity at constant\n", + "pressure. The calculated contributions to the heat capacity of Ni as\n", + "function of temperature from 0 to 1600 K at *P* = 0 are illustrated in\n", + "where the lattice vibration and the thermal electron contributions have\n", + "been separated out. From , it is observed a large difference between the\n", + "calcualted *CP* (solid line) and the experimental data\n", + "(symbols, see Ref. \\[18\\] for more details) at 600 K due to the magnetic\n", + "phase transition which has not been considered in the calculation. It\n", + "should be pointed out that for Ni the thermal electronic contribution to\n", + "the heat capacity (dashed line in ) is substantial at high temperatures.\n", + "\n", + "Figure \u2011. Heat capacity of nickel as a function of temperature.\n", + "represents the calculated lattice vibration contribution; represents the\n", + "calculated thermal electronic contribution.\n" + ], + "metadata": {} + }, + { + "id": "20203042", + "cell_type": "markdown", + "source": [ + "### Formation enthalpy of Ni3Al\n", + "\n", + "One can do the similar calculations for the elemental metal Al and the\n", + "compound Ni3Al which has the L12 structure,\n", + "following the same steps in the calculations of Ni. The formation\n", + "enthalpy in the unit of per mole atom can be calculated as\n", + "\n", + "*Eq. 5\u201115* ,\n", + "\n", + "where , , and represent the enthalpies of Ni3Al, Ni, and Al\n", + "in the energy unit of per mole atom, respectively. Plotted in is the\n", + "calculated formation enthalpy of Ni3Al (curve) as a function\n", + "of temperature from 0 to 1600 K at *P* = 0 compared with experimental\n", + "data (symbols) with details in Ref. \\[16\\].\n", + "\n", + ".\n", + "\n", + "Figure \u2011. Formation enthalpy of L12-Ni3Al with\n", + "respect to pure fcc Ni and Al.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/firstprinciples_calculations_and_theory/quantum_theory_for_the_motion_of_electrons.ipynb b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/quantum_theory_for_the_motion_of_electrons.ipynb new file mode 100644 index 0000000..3dd25aa --- /dev/null +++ b/src/psu410/src/psu410/firstprinciples_calculations_and_theory/quantum_theory_for_the_motion_of_electrons.ipynb @@ -0,0 +1,345 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "4098f321", + "cell_type": "markdown", + "source": [ + "## Quantum theory for the motion of electrons\n" + ], + "metadata": {} + }, + { + "id": "f7876e4d", + "cell_type": "markdown", + "source": [ + "### Schr\u00f6dinger equation\n", + "\n", + "The Schr\u00f6dinger equation is typically written as follows\n", + "\n", + "*Eq. 5\u201157* ,\n", + "\n", + "where is the reduced Planck constant, **X** an abbreviation of the space\n", + "coordinates and spin states of the multiple particle system, the energy\n", + "operator called Hamiltonian. When is independent of time *t*, one can\n", + "separate the coordinate **X** from the time *t* in finding the solution\n", + "of by writing\n", + "\n", + "*Eq. 5\u201158* ,\n", + "\n", + "by which the stationary solutions of can be expressed through letting\n", + "\n", + "*Eq. 5\u201159* ,\n", + "\n", + "resulting in\n", + "\n", + "*Eq. 5\u201160*\n", + "\n", + "*Eq. 5\u201161*\n", + "\n", + "Note that is the frequency of de Broglie matter wave.\n", + "\n", + "For any trial function \u039b(**X**) (in the Hilbert space) for \u03a8(**X**), the\n", + "variational principle tells us that the energy of the system always has\n", + "a lower bound through a ground state with energy *E0*, as\n", + "\n", + "*Eq. 5\u201162* ,\n", + "\n", + "where represents the complex conjugate of \u039b(**X**), resulting in\n", + "\n", + "*Eq. 5\u201163*\n", + "\n", + "which is known as the Rayleigh-Ritz variational principle,\n" + ], + "metadata": {} + }, + { + "id": "4ded1d86", + "cell_type": "markdown", + "source": [ + "### Born-Oppenheimer Approximation\n", + "\n", + "For a time independent atomic system, it is often accurate enough to\n", + "write in or in terms of the electron coordinate **r** and nuclei\n", + "coordinate **R**,\n", + "\n", + "*Eq. 5\u201164* ,\n", + "\n", + "where *e* represents the electron charge and *i* and *j* label the\n", + "electrons, *I* and *J* the atomic nuclei, *ZI* the atomic\n", + "nuclear charge number of atom *I*, *e* the electron charge,\n", + "*me* the electron mass, *MI* the mass of atomic\n", + "nuclei *I*, the Laplace operator for electron *i*, and the Laplace\n", + "operator for atomic nuclei *I,* noting\n", + "\n", + "*Eq. 5\u201165* ,\n", + "\n", + "with respect to the Cartesian axis *x*, *y*, and *z*.\n", + "\n", + "Consider the fact that the electron mass is thousand times smaller than\n", + "the mass of the atomic nuclei, implying that the motions of the\n", + "electrons are much faster than the atomic nuclei, Born and Oppenheimer\n", + "proposed that the wave function of the whole system can be simply\n", + "approximated as the product of the electron wave function and the atomic\n", + "nuclei wave function as\n", + "\n", + "*Eq. 5\u201166* .\n", + "\n", + "With the auxiliary approximation of neglecting the dynamic coupling\n", + "between the motions of electrons and atomic nuclei, the Schr\u00f6dinger\n", + "equation for the motion of electrons becomes\n", + "\n", + "*Eq. 5\u201167* ,\n", + "\n", + "where\n", + "\n", + "*Eq. 5\u201168* ,\n", + "\n", + "and the Schr\u00f6dinger equation for the motion of atomic nuclei becomes\n", + "\n", + "*Eq. 5\u201169* ,\n", + "\n", + "where\n", + "\n", + "*Eq. 5\u201170* ,\n", + "\n", + "with\n", + "\n", + "*Eq. 5\u201171* ,\n", + "\n", + "where represents the complex conjugate of .\n" + ], + "metadata": {} + }, + { + "id": "cdad6ca5", + "cell_type": "markdown", + "source": [ + "### Hartree-Fock approximation to solve Schr\u00f6dinger equation\n", + "\n", + "It was Hartree who first assumed that the electron wave function in can\n", + "be expressed as a product of a collection of *N* independent\n", + "one-electron wave functions, where *i* = 1, 2, \u2026, *N* with *N* being the\n", + "number of electrons in a system, in terms of the its space coordinate\n", + "**r** and spin state **s**. After that, Fock modified the Hartree\n", + "approximation by considering the fact that the wave function of a\n", + "multi-fermionic system should satisfy anti-symmetry requirements and\n", + "subsequently the Pauli exclusion principle that the total wave function\n", + "changes sign upon the exchange of fermions. Accordingly, the wave\n", + "function of *N* electrons system under the Hartree-Fock approximation is\n", + "expressed as the Slater determinant \\[29\\]\n", + "\n", + "*Eq. 5\u201172*\n", + "\n", + "For brevity, one can use the atomic unit that treats in , so that\n", + "\n", + "*Eq. 5\u201173*\n", + "\n", + "where , and\n", + "\n", + "*Eq. 5\u201174*\n", + "\n", + "Accordingly, the total energy of the system is expressed as\n", + "\n", + "*Eq. 5\u201175*\n", + "\n", + "where *Jij* is called as Coulomb/Hartree term\n", + "\n", + "*Eq. 5\u201176*\n", + "\n", + "where *Kij* is called as exchange term\n", + "\n", + "*Eq. 5\u201177* ,\n", + "\n", + "where = 1 if spin **s***i* and **s***j* points to\n", + "the same direction and = 0 if spin **s***i* and\n", + "**s***j* points to the opposite direction.\n", + "\n", + "By utilizing the variational condition of , one gets\n", + "\n", + "*Eq. 5\u201178* ,\n", + "\n", + "where is called one-electron energy, and\n", + "\n", + "*Eq. 5\u201179* ,\n", + "\n", + "with being the electronic charge density whose expression is\n", + "\n", + "*Eq. 5\u201180* ,\n", + "\n", + "*Eq. 5\u201181* .\n", + "\n", + "It should be especially noted here that to solve the Hartree-Fock\n", + "equation , the most time consuming part is due to the nonlocal exchange\n", + "term, knowing the fact that the being evaluated one-electron wave\n", + "function is also contained in the expression in the left hand side of by\n", + "means of .\n", + "\n", + "The configurational interaction method is the generalization of the\n", + "Hartree-Fock approximation. In such a case, *Y*, the number of\n", + "one-electron wave functions can be larger than the number of electrons,\n", + "*N*, in the system. Accordingly, from the number of one-electron wave\n", + "functions, , *y* = 1, 2, \u2026, *Y*, one can build the number of Stater\n", + "determinants, *M*, by the combinatorial mathematics that the maximum of\n", + "*M* can be\n", + "\n", + "*Eq. 5\u201182* .\n", + "\n", + "As a result, the wave function of a collection of *N* electron system\n", + "becomes the recombination of the *M* Stater determinants as\n", + "\n", + "*Eq. 5\u201183* ,\n", + "\n", + "where the coefficients is to be found from the multiple linear equation\n", + "\n", + "*Eq. 5\u201184* .\n", + "\n", + "The matrix element in *Eq. 5\u201184* is determined by the integral\n", + "\n", + "*Eq. 5\u201185* .\n" + ], + "metadata": {} + }, + { + "id": "ed57d05a", + "cell_type": "markdown", + "source": [ + "### Density functional theory (DFT) and 0 K Kohn-Sham equations\n", + "\n", + "The density functional theory advocates that the properties of a matter\n", + "are solely dictated by its electronic density distribution (or equally\n", + "say charge density), , in the real space. This is to say, that for an\n", + "arbitrary the total energy of the system, *E*, is always larger or equal\n", + "to a value, *E0*, called as the ground state energy:\n", + "\n", + "*Eq. 5\u201186* .\n", + "\n", + "In terms of variational principle, is equivalent to\n", + "\n", + "*Eq. 5\u201187* .\n", + "\n", + "Kohn and Sham \\[8\\] proposed to write the total energy as\n", + "\n", + "*Eq. 5\u201188* ,\n", + "\n", + "where represents the kinetic energy of the system, is the external\n", + "potential acting on the system, is the Hartree energy, and is the\n", + "so-called exchange-correlation energy with where and represent the\n", + "charge density of electrons with spin down and spin up, respectively .\n", + "Using\n", + "\n", + "*Eq. 5\u201189* ,\n", + "\n", + "together with the variational principle of , one can get the\n", + "one-electron Schr\u00f6dinger equation\n", + "\n", + "*Eq. 5\u201190*\n", + "\n", + "where *me* represents the mass of an electron and\n", + "\n", + "*Eq. 5\u201191*\n", + "\n", + "so that the total energy is obtained as\n", + "\n", + "*Eq. 5\u201192*\n", + "\n", + "The major challenge within DFT is that the accurate formulation of the\n", + "exchange-correlation energy is unknown. Except for the uniform electron\n", + "gas, no exact analytical form for the exchange-correlation energy has\n", + "yet been obtained. Therefore approximations must be made for the\n", + "exchange-correlation energy in calculating a realistic system. Until\n", + "now, the two most popular approximations are the local density\n", + "approximation (LDA) \\[30\\] and the generalized gradient approximation\n", + "(GGA) \\[31-32\\].\n", + "\n", + "The local density approximation (LDA) states that the\n", + "exchange-correlation energy is the same as that for a locally uniform\n", + "electron gas. In this case one can write *Vxc* as\n", + "\n", + "*Eq. 5\u201193* .\n", + "\n", + "Although this approximation is extremely simple, it works reasonably\n", + "well for many systems. The only remaining problem is to find an\n", + "approximate solution to . One of most employed parameterized expression\n", + "for is that by Perdew and Zunger \\[30\\].\n", + "\n", + "Many modern DFT codes use the more advanced generalized gradient\n", + "approximation (GGA) \\[31-32\\] to the exchange-correlation energy to\n", + "improve accuracy for certain physical properties. As the LDA\n", + "approximates the energy of the true density by the energy of a local\n", + "constant density, it fails in situations where the density undergoes\n", + "rapid changes such as in molecules. An improvement to this can be made\n", + "by considering the gradient of the electron density. Symbolically, this\n", + "can be written as\n", + "\n", + "*Eq. 5\u201194*\n", + "\n", + "The commonly used GGA is those due to Perdew et al. \\[31-32\\].\n" + ], + "metadata": {} + }, + { + "id": "3fc99f7b", + "cell_type": "markdown", + "source": [ + "#### Solving the Kohn-Sham Equations for a Solid\n", + "\n", + "For a solid, is still a mathematical challenge with infinite number of\n", + "one-electron wave functions to be solved and therefore cannot be solved\n", + "directly in the real space. To reduce the dimension of the problem, one\n", + "can choose to solve the equation at a specific point in the reciprocal\n", + "space. According to Bloch\u2019s theorem, the wave function for a solid can\n", + "be written as the product of a wavelike part, , and a cell periodic\n", + "part,\n", + "\n", + "*Eq. 5\u201195*\n", + "\n", + "where can be expressed as a sum of a finite number of plane waves whose\n", + "wave vectors are reciprocal lattice vectors of the crystal\n", + "\n", + "*Eq. 5\u201196* .\n", + "\n", + "so that\n", + "\n", + "*Eq. 5\u201197*\n", + "\n", + "where the band index *j* is used to number the eigenenergy and the\n", + "eigenvector at a given . The number of plane waves is determined by the\n", + "following equation\n", + "\n", + "*Eq. 5\u201198*\n", + "\n", + "where is called energy cutoff.\n", + "\n", + "Utilize the obtained wave functions, the charge density can be\n", + "calculated with the Brillouin zone integration\n", + "\n", + "*Eq. 5\u201199*\n", + "\n", + "Where\n", + "\n", + "*Eq. 5\u2011100*\n", + "\n", + "where the parameter is to make the integration over the charge density\n", + "within the primitive unit cell equal to the number of electrons, *N,* in\n", + "the primitive unit cell. Numerically, the integration can be\n", + "approximated by summation over a set of discrete *k*-mesh as\n", + "\n", + "*Eq. 5\u2011101*\n", + "\n", + "where *N*BZ represents the number of points in the first\n", + "Brillouin zone in the *k*-mesh. When a solid possesses symmetry, the\n", + "summation in the above equation can be further reduced to the summation\n", + "over the irreducible Brillouin zone (IBZ).\n", + "\n", + "*Eq. 5\u2011102*\n", + "\n", + "where is a weight factor that represents the number of points that are\n", + "equivalent to by space group symmetry.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/elastic_magnetic_and_electric_contributions_to_free_energy.ipynb b/src/psu410/src/psu410/gibbs_energy_function/elastic_magnetic_and_electric_contributions_to_free_energy.ipynb new file mode 100644 index 0000000..c7aa78c --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/elastic_magnetic_and_electric_contributions_to_free_energy.ipynb @@ -0,0 +1,131 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "87365766", + "cell_type": "markdown", + "source": [ + "## Elastic, magnetic, and electric contributions to free energy\n", + "\n", + "Chapters and focus on the thermal and hydrostatical pressure\n", + "contributions to Gibbs energy, which are the two prime variables\n", + "affecting phase stability in typical experimental environments. However,\n", + "there are other internal and external contributions, which are\n", + "particularly important for crystalline phases. Two important internal\n", + "contributions are from magnetic and electric polarizations of materials\n", + "with the corresponding external contributions due to the magnetic and\n", + "electric fields. Furthermore, for non-hydrostatic pressing of solid\n", + "phases, the $PV$ term in the combined law is to be replaced by elastic\n", + "energy calculated from elastic stress and elastic strain. The\n", + "corresponding works done to a system are as follows \\[3\\]\n", + "\n", + "Eq. \u2011\n", + "$dW_{elastic} = - V\\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}}$\n", + "\n", + "Eq. \u2011 $dW_{magnetic} = - V\\sum_{i}^{}{H_{i}{dB}_{i}}$\n", + "\n", + "Eq. \u2011 $dW_{electric} = - V\\sum_{i}^{}{E_{i}{dD}_{i}}$\n", + "\n", + "where $i,j,\\ k,\\ l = 1,2,3$, $\\sigma_{ij}$ and $\\varepsilon_{kl}$ are\n", + "the components of stress and strain; $H_{i}$ and $B_{i}$ are the\n", + "components of magnetic field and magnetic induction; $E_{i}$ and $D_{i}$\n", + "are the components of electric field and electric displacement; and $V$\n", + "is the volume of the crystal. The negative sign in front of the equation\n", + "is due to the fact that the system does work to the surroundings when it\n", + "expands its volume due to the strain, magnetic induction, and electric\n", + "displacement.\n", + "\n", + "Using the combined law of thermodynamics, can thus be re-written as\n", + "follows\n", + "\n", + "Eq. \u2011\n", + "$dU = TdS - V\\left( \\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}} + \\sum_{i}^{}{H_{i}{dB}_{i}} + \\sum_{i}^{}{E_{i}{dD}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", + "\n", + "The Legendre transformation similar to Helmholtz energy and Gibbs\n", + "energy, and , can be made to obtain the following characteristic free\n", + "energy functions\n", + "\n", + "Eq. \u2011 $dF = d(U - TS)$\n", + "\n", + "$$= - SdT - V\\left( \\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}} + \\sum_{i}^{}{H_{i}{dB}_{i}} + \\sum_{i}^{}{E_{i}{dD}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$$\n", + "\n", + "Eq. \u2011 $dF_{H} = d\\left( U - TS + \\sum_{i}^{}{H_{i}B_{i}} \\right)$\n", + "\n", + "$$= - SdT - V\\left( \\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}} - \\sum_{i}^{}{B_{i}dH_{i}} + \\sum_{i}^{}{E_{i}{dD}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$$\n", + "\n", + "Eq. \u2011 $dF_{E} = d\\left( U - TS + \\sum_{i}^{}{E_{i}D_{i}} \\right)$\n", + "\n", + "$$= - SdT - V\\left( \\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}} + \\sum_{i}^{}{H_{i}{dB}_{i}} - \\sum_{i}^{}{D_{i}{dE}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$$\n", + "\n", + "Eq. \u2011\n", + "$dF_{EH} = d\\left( U - TS + \\sum_{i}^{}{H_{i}B_{i}} + \\sum_{i}^{}{E_{i}D_{i}} \\right)$\n", + "\n", + "$$= - SdT - V\\left( \\sum_{i,j,k,l}^{}{\\sigma_{ij}{d\\varepsilon}_{kl}} - \\sum_{i}^{}{B_{i}{dH}_{i}} - \\sum_{i}^{}{D_{i}{dE}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$$\n", + "\n", + "Eq. \u2011\n", + "$dG = d\\left( U - TS + \\sum_{i,j,k,l}^{}{\\sigma_{ij}\\varepsilon_{kl}} + \\sum_{i}^{}{H_{i}B_{i}} + \\sum_{i}^{}{E_{i}D_{i}} \\right)$\n", + "\n", + "$$= - SdT + V\\left( \\sum_{i,j,k,l}^{}{\\varepsilon_{ij}d\\sigma}_{kl} + \\sum_{i}^{}{B_{i}dH_{i}} + \\sum_{i}^{}{D_{i}{dE}_{i}} \\right) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$$\n", + "\n", + "From above equations, it can be seen that the natural variables of\n", + "various free energies are\n", + "$F\\left( T,\\ \\varepsilon_{ij},\\ B_{i},\\ D_{i},\\ N_{i},\\ \\xi \\right)$,\n", + "$F_{H}\\left( T,\\ \\varepsilon_{ij},\\ H_{i},\\ D_{i},\\ N_{i},\\ \\xi \\right)$,\n", + "$F_{E}\\left( T,\\ \\varepsilon_{ij},\\ B_{i},\\ E_{i},\\ N_{i},\\ \\xi \\right)$,\n", + "$F_{EH}\\left( T,\\ \\varepsilon_{ij},\\ H_{i},\\ E_{i},\\ N_{i},\\ \\xi \\right)$,\n", + "and $G\\left( T,\\ \\sigma_{ij},\\ H_{i},\\ E_{i},\\ N_{i},\\ \\xi \\right)$.\n", + "Clearly, there can be more combinations when the components of\n", + "$\\varepsilon_{ij}$, $D_{i}$, and $B_{i}$ are partially replaced by their\n", + "conjugate potentials. The free energies listed above are useful\n", + "depending on how the system is constrained by the surroundings. For\n", + "practical applications, the elastic, magnetic, and electric properties\n", + "are usually considered for phases with fixed compositions, and at\n", + "equilibrium can then be written as\n", + "\n", + "Eq. \u2011\n", + "$dG = - SdT + V\\left( \\sum_{i,j,k.l}^{}{\\varepsilon_{ij}d\\sigma}_{kl} + \\sum_{i}^{}{B_{i}dH_{i}} + \\sum_{i}^{}{D_{i}{dE}_{i}} \\right) + \\mu dN$\n", + "\n", + "The corresponding Gibbs-Duhem equation follows as below\n", + "\n", + "Eq. \u2011\n", + "$0 = - SdT + V\\left( \\sum_{i,j,k,l}^{}{\\varepsilon_{ij}d\\sigma}_{kl} + \\sum_{i}^{}{B_{i}dH_{i}} + \\sum_{i}^{}{D_{i}{dE}_{i}} \\right) - Nd\\mu$\n", + "\n", + "The general differential form of a molar quantity can be extended from\n", + "as follows as a one-component system\n", + "\n", + "Eq. \u2011\n", + "\n", + "Eq. \u2011\n", + "\n", + "Eq. \u2011\n", + "\n", + "Eq. \u2011\n", + "\n", + "The first derivatives in to are the second directives of Gibbs energy\n", + "with respect to its natural variables, i.e. potentials, and have their\n", + "respective nomenclatures as shown in . The limit of stability follows\n", + "and can be re-written as\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)_{N,Y_{j}} = \\infty$\n", + "\n", + "This means that the derivatives in to , i.e. the quantities in , diverge\n", + "at the limit of stability.\n", + "\n", + "Table \u2011: Physical quantities related to the first derivatives in to .\n", + "The table is symmetric due to the Maxwell relations related to the\n", + "second directives of Gibbs energy with respect to its natural variables.\n", + "\n", + "| | T | $$\\sigma_{kl}$$ | $$E_{k}$$ | $$H_{k}$$ |\n", + "|----------------------|------------------------------------|------------------------------------|---------------------------------------|---------------------------------------|\n", + "| S | C/T, heat capacity | $\\alpha_{kl}$, piezocaloric effect | $p_{k}$, electrocaloric effect | $m_{k}$, magnetocaloric effect |\n", + "| $$\\varepsilon_{ij}$$ | $\\alpha_{ij}$, thermal expansion | $s_{ijkl}$, elastic compliance | $d_{ijk}$, converse piezoelectricity | $q_{ijk}$, piezomagnetic moduli |\n", + "| $$D_{i}$$ | $p_{i}$, pyroelectric coefficients | $d_{ikl}$, piezoelectric moduli | $k_{ik}$, permittivities | $a_{ik}$, magnetoelectric coefficient |\n", + "| $$B_{i}$$ | $m_{i}$, pyromagnetic coefficient | $q_{ikl}$, piezomagnetic moduli | $a_{ik}$, magnetoelectric coefficient | $\\mu_{ik}$, permeability |\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/index.ipynb b/src/psu410/src/psu410/gibbs_energy_function/index.ipynb new file mode 100644 index 0000000..dca2b89 --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/index.ipynb @@ -0,0 +1,177 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "efe43b42", + "cell_type": "markdown", + "source": [ + "# Gibbs energy function\n", + "\n", + "As shown in through , all functions have $N_{i}$ and $\\xi$ as natural\n", + "variables while they differ in other two natural variables. In typical\n", + "materials-related experiments, temperature and pressure are the two\n", + "variables controlled. They are also the natural variables of Gibbs\n", + "energy. Consequently, Gibbs energy is the most widely used function in\n", + "thermodynamics of materials science. The rest of this book focuses on\n", + "Gibbs energy for this reason. In this chapter, the mathematical formulas\n", + "for Gibbs energy of phases with fixed and variable compositions are\n", + "discussed which are needed for quantitative calculations of Gibbs energy\n", + "under given values of its natural variables.\n", + "\n", + "From , the molar Gibbs energy can be defined as\n", + "\n", + "Eq. \u2011\n", + "$G_{m}\\left( T,P,x_{i},\\xi \\right) = \\frac{G}{N} = \\sum_{}^{}\\mu_{i}x_{i}$\n", + "\n", + "The molar entropy, molar volume, chemical potential, and the driving\n", + "force can be obtained from as\n", + "\n", + "Eq. \u2011\n", + "$S_{m} = \\frac{S}{N} = - \\frac{1}{N}\\left( \\frac{\\partial G}{\\partial T} \\right)_{P,\\ N_{i},\\ \\xi} = {- \\left( \\frac{\\partial G_{m}}{\\partial T} \\right)}_{P,\\ x_{i},\\ \\xi}$\n", + "\n", + "Eq. \u2011\n", + "$V_{m} = \\frac{V}{N} = \\frac{1}{N}\\left( \\frac{\\partial G}{\\partial P} \\right)_{T,\\ N_{i},\\ \\xi} = \\left( \\frac{\\partial G_{m}}{\\partial P} \\right)_{T,\\ x_{i},\\ \\xi}$\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} = \\left( \\frac{\\partial G}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},\\ \\xi}$\n", + "\n", + "Eq. \u2011\n", + "$- D = \\left( \\frac{\\partial G}{\\partial\\xi} \\right)_{T,P,N_{i}\\ }$\n", + "\n", + "Based on , the molar enthalpy is written as\n", + "\n", + "Eq. \u2011 $H_{m} = G_{m} + TS_{m}$\n", + "\n", + "Other physical properties of the system can also be represented by the\n", + "partial derivatives of Gibbs energy such as heat capacity, $C_{P}$,\n", + "volume thermal expansivity, $\\alpha_{V}$, isothermal compressibility,\n", + "$\\kappa_{T}$, as follows under constant pressure or temperature\n", + "\n", + "Eq. \u2011\n", + "$C_{P} = \\left( \\frac{\\partial Q}{\\partial T} \\right)_{P} = \\left( \\frac{\\partial H}{\\partial T} \\right)_{P} = T\\left( \\frac{\\partial(G + TS)}{\\partial T} \\right)_{P} = T\\left( \\frac{\\partial S}{\\partial T} \\right)_{P} = - T\\left( \\frac{\\partial^{2}G}{\\partial T^{2}} \\right)_{P}$\n", + "\n", + "Eq. \u2011\n", + "$\\alpha_{V} = \\frac{\\left( \\frac{\\partial V}{\\partial T} \\right)_{P}}{V} = \\frac{\\left( \\frac{\\left( \\partial G/\\partial( - P) \\right)_{T}}{\\partial T} \\right)_{P}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{\\frac{\\partial^{2}G}{\\partial T\\partial( - P)}}{\\left( \\partial G/\\partial( - P) \\right)_{T}}$\n", + "\n", + "Eq. \u2011\n", + "$\\kappa_{T} = \\frac{\\left( \\frac{\\partial V}{\\partial( - P)} \\right)_{T}}{V} = \\frac{\\left( \\frac{\\left( \\partial G/\\partial( - P) \\right)_{T}}{\\partial( - P)} \\right)_{T}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}{\\left( \\partial G/\\partial( - P) \\right)_{T}} = \\frac{1}{B}$\n", + "\n", + "where the $N_{i}$ and $\\xi$ are kept constant for all partial\n", + "derivatives, and $B$ is the bulk modulus.\n", + "\n", + "In , $G$ cannot be directly replaced by $G_{m}$ because *N* also depends\n", + "on *Ni*. The thermodynamic quantities under such conditions,\n", + "i.e. varying the amount of a component at constant temperature and\n", + "pressure, are called partial quantities which are introduced in Eq. 1\u20118\n", + "for partial entropy and for partial enthalpy. This definition can be\n", + "extended to all molar quantities such as partial volume and partial\n", + "Gibbs energy. Partial quantities of a molar quantity, $A$, can thus be\n", + "defined in general as\n", + "\n", + "Eq. \u2011\n", + "$A_{i} = \\left( \\frac{\\partial A}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},\\ \\xi}$\n", + "\n", + "The general differential form of a molar quantity for a system at\n", + "equilibrium can be represented by its partial quantities as\n", + "\n", + "Eq. \u2011\n", + "$dA = \\left( \\frac{\\partial A}{\\partial T} \\right)dT + \\left( \\frac{\\partial A}{\\partial P} \\right)dP + \\sum_{}^{}\\left( \\frac{\\partial A}{\\partial N_{i}} \\right){dN}_{i}$\n", + "\n", + "where the subscripts representing variables kept constant, i.e. the\n", + "remaining natural variables of Gibbs energy not in the denominator, are\n", + "omitted for simplicity. This will be done throughout the book unless\n", + "specified otherwise.\n", + "\n", + "Using the following relations: $A = NA_{m}$, $N = \\sum_{}^{}N_{j}$,\n", + "$x_{i} = N_{i}/N$,\n", + "$\\frac{{\\partial x}_{i}}{{\\partial N}_{i}} = \\left( 1 - x_{i} \\right)/N$,\n", + "and $\\frac{{\\partial x}_{k}}{{\\partial N}_{i}} = {- x}_{k}/N$, can be\n", + "derived as, under constant T and P,\n", + "\n", + "Eq. \u2011\n", + "$A_{i} = A_{m} + N\\sum_{j = 1}^{c}{\\frac{\\partial A_{m}}{\\partial x_{j}}\\frac{\\partial x_{j}}{\\partial N_{i}}} = A_{m} + \\frac{\\partial A_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial A_{m}}{\\partial x_{j}}$\n", + "\n", + "where the summation is for all *c* components and the partial\n", + "derivatives are taken with other mole fractions kept constant. However,\n", + "mole fractions are not independent, but follow the relation\n", + "$\\sum_{}^{}x_{i} = 1$. Taking $x_{1} = 1 - \\sum_{j = 2}^{c}x_{j}$ as the\n", + "dependent mole fraction, can be rewritten as\n", + "\n", + "Eq. \u2011\n", + "$A_{i} = A_{m} + \\left( \\frac{\\partial A_{m}}{\\partial x_{i}} - \\frac{\\partial A_{m}}{\\partial x_{1}} \\right) - \\sum_{j = 2}^{c}x_{j}\\left( \\frac{\\partial A_{m}}{\\partial x_{j}} - \\frac{\\partial A_{m}}{\\partial x_{1}} \\right)$\n", + "\n", + "The difference of the partial derivatives in the parenthesis in\n", + "represents the partial derivative of $A_{m}$ with respect to the mole\n", + "fraction of one component when the first component is selected as the\n", + "dependent component. Applying and to Gibbs energy, the partial Gibbs\n", + "energy or chemical potential of component $i$ is obtained as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} = G_{i} = G_{m} + \\frac{\\partial G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial G_{m}}{\\partial x_{j}} = G_{m} + \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} - \\frac{\\partial G_{m}}{\\partial x_{1}} \\right) - \\sum_{j = 2}^{c}x_{j}\\left( \\frac{\\partial G_{m}}{\\partial x_{j}} - \\frac{\\partial G_{m}}{\\partial x_{1}} \\right)$\n", + "\n", + "The derivatives in the stability equation, , are defined with the molar\n", + "quantities kept constant. On the other hand, Gibbs energy has two\n", + "potentials, temperature and pressure, as natural variables instead. One\n", + "would thus need to compare the stability conditions when a variable kept\n", + "fixed is changed from a molar quantity to its conjugate potential. This\n", + "can be carried out through the use of Jacobians to change the\n", + "independent variables\n", + "\n", + "Eq. \u2011\n", + "$\\frac{\\partial\\left( Y_{i},Y_{j} \\right)}{\\partial\\left( X_{i},X_{j} \\right)} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}} - \\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{i}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{j}}$\n", + "\n", + "For a stable system, both\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}$ and\n", + "$\\left( \\frac{\\partial Y_{j}}{\\partial X_{j}} \\right)_{X_{i}}$ are\n", + "positive based on . Using the Maxwell relation shown by , one thus\n", + "obtains\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} - \\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}} = \\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{i}}\\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{j}}/\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} \\geq 0$\n", + "\n", + "This means that\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{Y_{j}}$ will go\n", + "to zero before\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}}$ does. It\n", + "indicates that the stability condition becomes more restrictive when\n", + "potentials are kept constant in place of their conjugate molar\n", + "quantities. Based on the Gibbs-Duhem equation of , the maximum number of\n", + "independent potentials is *c+1*, and the last potential is dependent,\n", + "i.e.\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial Y_{c + 2}}{\\partial X_{c + 2}} \\right)_{Y_{j \\leq c + 1}} = 0$\n", + "\n", + "Therefore, the limit of stability is determined when the derivative\n", + "becomes zero with one molar quantity kept constant, e.g.\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial Y_{c + 1}}{\\partial X_{c + 1}} \\right)_{Y_{j < c + 1},X_{c + 2}} = 0$\n", + "\n", + "This is because this derivative reaches zero faster than any other\n", + "derivatives with more molar quantities kept constant. shows that all\n", + "molar quantities diverge at the limit of stability. The consolute point\n", + "is obtained with $c$ additional conditions as follows based on\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial^{2}Y_{i}}{\\partial\\left( X_{i} \\right)^{2}} \\right)_{Y_{j \\leq c + 1, \\neq i},X_{c + 2}} = 0$\n", + "\n", + "Together with , all $c + 1$ independent potentials at the consolute\n", + "point can be determined. It is evident that the consolute point is a\n", + "zero-dimensional point in a two-dimensional space of independent\n", + "potentials in a one-component system. With the addition of a second\n", + "component to form a binary system, this consolute point in the\n", + "one-component system extends into a one-dimensional line. This line\n", + "represents the limit of stability of the binary system, and a consolute\n", + "point is located at the end of this line. It is thus evident that in a\n", + "system with $c$ independent components, the limit of stability is a\n", + "*c-1*-dimensional hypersurface in a space of $c + 1$ independent\n", + "potentials, while the consolute point is a zero-dimensional point in all\n", + "systems, which may be called the invariant critical point.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/phases_with_fixed_compositions.ipynb b/src/psu410/src/psu410/gibbs_energy_function/phases_with_fixed_compositions.ipynb new file mode 100644 index 0000000..3ad796d --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/phases_with_fixed_compositions.ipynb @@ -0,0 +1,279 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "40c1c423", + "cell_type": "markdown", + "source": [ + "## Phases with fixed compositions\n", + "\n", + "The homogeneous system discussed so far means that there is only one\n", + "phase in the system, i.e. a single-phase system. A phase with a fixed\n", + "composition can be a pure element or a stoichiometric compound. There is\n", + "thus only one independent component in the system. A stoichiometric\n", + "compound contains more than one element, but the relative amounts of\n", + "each element are fixed by the stoichiometry and cannot vary\n", + "independently, i.e., $dN_{i} = x_{i}dN$. The combined law of\n", + "thermodynamics becomes\n", + "\n", + "Eq. \u2011\n", + "$dG = - SdT - Vd( - P) + \\left( \\sum_{}^{}{x_{i}\\mu_{i}} \\right)dN - Dd\\xi = - SdT - Vd( - P) + G_{m}dN - Dd\\xi$\n", + "\n", + "$G_{m}$ is the molar Gibbs energy of the stoichiometric compound and can\n", + "be regarded as the chemical potential of the stoichiometric\n", + "phase,$\\ \\alpha$,\n", + "\n", + "Eq. \u2011 $G_{m} = \\mu^{\\alpha} = \\sum_{}^{}{x_{i}\\mu_{i}}$\n", + "\n", + "The chemical potential of individual components in the phase cannot be\n", + "defined because the amount of each component cannot be varied\n", + "independently. For a stoichiometric phase of $N$ moles of atoms at\n", + "equilibrium with $dG$=$Nd\\mu^{\\alpha} + \\mu^{\\alpha}dN$, reduces to\n", + "\n", + "Eq. \u2011 $\\ 0 = - SdT - Vd( - P) - Nd\\mu^{\\alpha}$\n", + "\n", + "which is the Gibbs-Duhem equation, , applied to a stoichiometric phase.\n", + "It can be represented graphically by a surface in a three-dimensional\n", + "space composed of $\\ \\mu^{\\alpha}$, *T* and *\u2013P*. The direction of the\n", + "surface is represented by the three partial directives between any two\n", + "of $\\ \\mu^{\\alpha}$, *T* and *\u2013P* with the third one kept constant, i.e.\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial\\mu^{\\alpha}}{\\partial T} \\right)_{P} = - \\frac{S}{N} = - S_{m}$\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial\\mu^{\\alpha}}{\\partial( - P)} \\right)_{T} = - \\frac{V}{N} = - V_{m}$\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial( - P)}{\\partial T} \\right)_{\\mu^{\\alpha}} = - \\frac{S}{V} = - \\frac{S_{m}}{V_{m}}$\n", + "\n", + "Based on Nernst\u2019s heat theorem, the entropy difference between two\n", + "crystals approaches zero when the temperature approaches absolute zero.\n", + "It is thus a common practice to put $S = 0$ for a crystal at 0 K. This\n", + "is usually referred as the third law of thermodynamics. From the\n", + "definition of entropy change by , $S$ or $S_{m}$ is always positive at\n", + "finite temperatures as the system or the crystal absorbs heat from the\n", + "surroundings to increase its temperature. $V$ or $V_{m}$ of a phase is a\n", + "well-defined physical quantity, and its absolute value can be given and\n", + "is always positive. The above three equations can be written in a\n", + "general form as\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial Y_{i}}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{X_{j}}{X_{i}} < 0$\n", + "\n", + "The surface thus has negative slopes in all its directions. The\n", + "curvature of the surface can be derived from\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial^{2}Y_{i}}{\\partial\\left( Y_{j} \\right)^{2}} \\right)_{Y_{k}} = - \\left( \\frac{\\partial\\left( \\frac{X_{j}}{X_{i}} \\right)}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{1}{X_{i}}\\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} + \\frac{X_{j}}{\\left( X_{i} \\right)^{2}}\\left( \\frac{\\partial X_{i}}{\\partial Y_{j}} \\right)_{Y_{k}} = - \\frac{1}{X_{i}}\\left\\lbrack \\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} - \\frac{X_{j}}{X_{i}}{\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)\\left( \\frac{\\partial Y_{i}}{\\partial Y_{j}} \\right)}_{Y_{k}} \\right\\rbrack = - \\frac{1}{X_{i}}\\left\\lbrack \\left( \\frac{\\partial X_{j}}{\\partial Y_{j}} \\right)_{Y_{k}} + \\left( \\frac{X_{j}}{X_{i}} \\right)^{2}\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)_{Y_{k}} \\right\\rbrack < 0$\n", + "\n", + "Both terms inside the last bracket are positive for a system in a state\n", + "of stable internal equilibrium, and the surface thus has a negative\n", + "curvature and is convex everywhere as shown in .\n", + "\n", + "Figure \u2011: Gibbs energy of a one-component phase as a function of\n", + "temperature and negative pressure, showing the convex shape\n", + "\n", + "From experimental observations, it is known that\n", + "$S_{m}^{vapor} \\gg S_{m}^{liquid} > S_{m}^{solid}$. The curves of\n", + "$G_{m}$ or $\\mu^{\\alpha}$ plotted with respect to $T$ at constant $P$\n", + "would thus have the most negative slope for a vapour phase followed by\n", + "its liquid and solid phases. As an example, shows Gibbs energy of Zn in\n", + "its solid, liquid, and vapour forms as a function of $T$ at constant\n", + "$P = 1$ atmospheric pressure.\n", + "\n", + "Figure \u2011: Molar Gibbs energy of Zn as a function of T at constant P\n", + "\n", + "Similarly it is common that\n", + "$V_{m}^{vapor} \\gg V_{m}^{liquid} > V_{m}^{solid}$, and the curves of\n", + "$G_{m}$ or $\\mu^{\\alpha}$ plotted with respect to $P$ at constant $T$\n", + "would thus have the most positive slope for a vapour phase followed by\n", + "its liquid and solid phases, though there are cases that\n", + "$V_{m}^{liquid} < V_{m}^{solid}$ such as those of water and ice. As an\n", + "example, shows Gibbs energy of Fe in its two solid (fcc and bcc),\n", + "liquid, and vapour forms as a function of $P$ at constant $T = 1273K$.\n", + "\n", + "Figure \u2011: Molar Gibbs energy of Zn as a function of P at constant T\n", + "\n", + "The quantities measurable by experiments typically include temperature,\n", + "pressure, volume, composition, and amount of heat flow in the combined\n", + "law of thermodynamics discussed so far. By measuring the heat needed to\n", + "increase the temperature of a phase, the heat capacity of the phase is\n", + "obtained as shown by Eq. 2\u20117. A typical heat capacity curve as a\n", + "function of temperature is shown in for fcc-Al, hcp-Mg, and an\n", + "intermetallic phase Al12Mg17.\n", + "\n", + "Figure \u2011: Heat capacity of fcc-Al, hcp-Mg, and\n", + "Al12Mg17 as a function of temperature\n", + "\n", + "There are various theoretical models for the heat capacity under\n", + "constant volume to be discussed in Chapter 5 of this book, which is\n", + "defined as\n", + "\n", + "Eq. \u2011\n", + "$C_{V} = \\left( \\frac{\\partial U}{\\partial T} \\right)_{V} = T\\left( \\frac{\\partial(F + TS)}{\\partial T} \\right)_{V} = T\\left( \\frac{\\partial S}{\\partial T} \\right)_{V} = - T\\left( \\frac{\\partial^{2}F}{\\partial T^{2}} \\right)_{V}$\n", + "\n", + "To establish the relationship between $C_{P}$ defined by and $C_{V}$,\n", + "$U$ needs to be represented as a function of $T$ and $V$ in terms of $G$\n", + "and its derivatives with respect to Gibbs energy\u2019s natural variables of\n", + "$T$ and $P$. It can be done as follows\n", + "\n", + "Eq. \u2011\n", + "$dV = \\frac{\\partial V}{\\partial T}dT + \\frac{\\partial V}{\\partial( - P)}d( - P) = - \\frac{\\partial^{2}G}{\\partial T( - P)}dT - \\frac{\\partial^{2}G}{\\partial( - P)^{2}}d( - P)$\n", + "\n", + "Eq. \u2011\n", + "$dU = \\frac{\\partial(G + TS - PV)}{\\partial T}dT + \\frac{\\partial(G + TS - PV)}{\\partial( - P)}d( - P) = - \\left( T\\frac{\\partial^{2}G}{\\partial T^{2}} - P\\frac{\\partial^{2}G}{\\partial T( - P)} \\right)dT\u2014\\left( T\\frac{\\partial^{2}G}{\\partial T( - P)} + P\\frac{\\partial^{2}G}{\\partial( - P)^{2}} \\right)\\left( - \\frac{1}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}dV + \\frac{\\frac{\\partial^{2}G}{\\partial T( - P)}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}}dT \\right) = - \\left\\lbrack T\\frac{\\partial^{2}G}{\\partial T^{2}} - T\\frac{\\left( \\frac{\\partial^{2}G}{\\partial T( - P)} \\right)^{2}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} \\right\\rbrack dT + \\left( - T\\frac{\\frac{\\partial^{2}G}{\\partial T( - P)}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} + P \\right)dV$\n", + "\n", + "Eq. \u2011\n", + "$C_{V} = C_{P} + T\\frac{\\left( \\frac{\\partial^{2}G}{\\partial T( - P)} \\right)^{2}}{\\frac{\\partial^{2}G}{\\partial( - P)^{2}}} = C_{P} - \\frac{\\alpha_{V}^{2}VT}{\\kappa_{T}} = C_{P} - \\alpha_{V}^{2}BVT$\n", + "\n", + "where the thermal expansion, $\\alpha_{V}$, and the compressibility or\n", + "bulk modulus, $\\kappa_{T}$ or $B$, are defined by and , respectively.\n", + "From the heat capacity, the enthalpy and entropy can be obtained by\n", + "integration of at a constant pressure\n", + "\n", + "Eq. \u2011\n", + "$S = S_{0} + \\int_{0}^{T}\\frac{C_{P}}{T}dT = S_{0} + \\int_{0}^{298.15}\\frac{C_{P}}{T}dT + \\int_{298.15}^{T}\\frac{C_{P}}{T}dT = S_{298.15} + \\int_{298.15}^{T}\\frac{C_{P}}{T}dT$\n", + "\n", + "Eq. \u2011\n", + "$H = H_{0} + \\int_{0}^{T}C_{P}dT = H_{0} + \\int_{0}^{298.15}C_{P}dT + \\int_{298.15}^{T}C_{P}dT = H_{298.15} + \\int_{298.15}^{T}C_{P}dT$\n", + "\n", + "In the above equations, two temperature ranges of integration are chosen\n", + "for practical applications as most processing procedures in the field of\n", + "materials science and engineering take place at temperatures above the\n", + "room temperature. Based on the third-law of thermodynamics, $S_{0} = 0$,\n", + "$S_{298.15}$ can be obtained by integration. On the other hand for\n", + "$H_{0} = U_{0} + PV$, one does not know the absolute value of the\n", + "internal energy and thus have to select a reference state for $H$. In\n", + "principle, the reference state can be arbitrarily chosen. A widely used\n", + "reference state in the thermodynamic modeling practice is to set\n", + "$H_{298.15}^{SER} = 0$ at ambient pressure for pure elements at their\n", + "respective stable structures at room temperature, called stable element\n", + "reference (SER) state with\n", + "\n", + "Eq. \u2011\n", + "$G_{298.15}^{SER} = H_{298.15}^{SER} - TS_{298.15}^{SER} = - TS_{298.15}^{SER}$\n", + "\n", + "It is further noted that after defining $S_{298.15}$ and $H_{298.15}$,\n", + "one only needs the heat capacity at higher temperatures. This makes the\n", + "mathematical representation of heat capacity simpler due to a relatively\n", + "simple temperature dependence of heat capacity at higher temperatures in\n", + "comparison with the variation at lower temperatures. One common\n", + "expression for heat capacity at high temperatures and ambient pressure\n", + "is as follows\n", + "\n", + "Eq. \u2011 $C_{P} = c + dT + \\frac{e}{T^{2}} + fT^{2}$\n", + "\n", + "where c, d, e, and f are parameters fitted to experimental or theoretic\n", + "data and compiled in various handbooks.\n", + "\n", + "The corresponding $S$, $H$, and $G$ are obtained as\n", + "\n", + "Eq. \u2011 $S = b^{'} + clnT + dT - \\frac{e}{{2T}^{2}} + \\frac{f}{2}T^{2}$\n", + "\n", + "Eq. \u2011 $H = a + cT + \\frac{d}{2}T^{2} - \\frac{e}{T} + \\frac{f}{3}T^{3}$\n", + "\n", + "Eq. \u2011\n", + "$G = H - TS = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3}$\n", + "\n", + "with $b = b^{'} - c$. The integration constants $b^{'}$ and $a$ are\n", + "evaluated from $S_{298.15}$ and $H_{298.15}$. As an example, the\n", + "enthalpy and entropy of Zn in solid (hcp), liquid, and gas forms are\n", + "plotted in and , respectively. The distances between any two curves in\n", + "and represent the enthalpy or entropy differences between the two\n", + "phases. It can be seen that the gas has much higher enthalpy and entropy\n", + "than the solid and liquid.\n", + "\n", + "Figure \u2011: Enthalpy of Zn as a function of temperature at one atmospheric\n", + "pressure\n", + "\n", + "Figure \u2011: Entropy of Zn as a function of temperature at one atmospheric\n", + "pressure\n", + "\n", + "Similarly, one can add the pressure dependence into the Gibbs energy\n", + "function such as\n", + "\n", + "Eq. \u2011\n", + "$G = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3} + gP + hTP + mP^{2}$\n", + "\n", + "where g, h, and m are parameters fitted to experimental or theoretic\n", + "data and compiled in various handbooks.\n", + "\n", + "The expression for $V$ can be derived as\n", + "\n", + "Eq. \u2011 $V = g + hT + 2mP$\n", + "\n", + "The Helmholtz energy can be expressed as a function of its natural\n", + "variables by solving $P\\ $ from\n", + "\n", + "Eq. \u2011\n", + "$F = G - PV = a - bT - cTlnT - \\frac{d}{2}T^{2} - \\frac{e}{2T} - \\frac{f}{6}T^{3} - \\frac{(g + hT - V)^{2}}{4m}$\n", + "\n", + "In the literature there are many models to represent the temperature and\n", + "pressure dependences of thermodynamic properties. The Gibbs energy\n", + "difference between a stoichiometric compound and the components at their\n", + "reference states of which the compound is composed,\n", + "${_{\\ }^{0}G}_{i}^{ref}$, is termed as Gibbs energy of formation, i.e.\n", + "\n", + "Eq. \u2011 $\\mathrm{\\Delta}_{f}G = G - \\sum_{}^{}N_{i}{_{\\ }^{0}G}_{i}^{ref}$\n", + "\n", + "with $N_{i}$ being the stoichiometry of the compound. Similarly,\n", + "enthalpy of formation, entropy of formation, and heat capacity of\n", + "formation with respect to components at their reference states,\n", + "$_{\\ }^{0}H_{i}^{ref}$, $_{\\ }^{0}S_{i}^{ref}$, and\n", + "$_{\\ }^{0}{C_{P}}_{i}^{ref}$, can be defined as\n", + "\n", + "Eq. \u2011 $\\mathrm{\\Delta}_{f}H = H - \\sum_{}^{}{N_{i}_{\\ }^{0}H_{i}^{ref}}$\n", + "\n", + "Eq. \u2011 $\\mathrm{\\Delta}_{f}S = S - \\sum_{}^{}{N_{i}_{\\ }^{0}S_{i}^{ref}}$\n", + "\n", + "Eq. \u2011\n", + "$\\mathrm{\\Delta}_{f}C_{P} = C_{P} - \\sum_{}^{}{N_{i}_{\\ }^{0}{C_{P}}_{i}^{ref}}$\n", + "\n", + "It should be mentioned that one mole of a compound usually refers to one\n", + "mole of formula of stoichiometry of the compound. With a formula like\n", + "$A_{a}B_{b}C_{c}$, the compound is composed of total $(a + b + c)$ moles\n", + "of components. One should thus be very careful when dealing with\n", + "numerical values to be sure whether the data is in terms of per mole of\n", + "formula or per mole of components. At the same time the reference states\n", + "must be clearly defined. When the SER state defined in is selected as\n", + "the reference state, the above formation quantities are called standard\n", + "formation quantities such as standard enthalpy of formation.\n", + "\n", + "Since there are only two independent potentials in a one-component\n", + "system, its limit of stability can be evaluated with one potential kept\n", + "constant, i.e. either $T$ or $P$. Consequently, either Helmholtz energy\n", + "or enthalpy is to be used in deriving the limit of stability of a\n", + "homogeneous system. For the practical usefulness, let us use Helmholtz\n", + "energy because its natural variables of $T$ and *V* are measurable\n", + "quantities in typical experiments, while one of the natural variables of\n", + "enthalpy, entropy, is not. From and , the limit of stability for a\n", + "one-component system at constant temperature can be written as\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial( - P)}{\\partial V} \\right)_{T,N} = F_{VV} = \\frac{1}{V\\kappa_{T}} = \\frac{B}{V} = 0$\n", + "\n", + "where the isothermal compressibility and bulk modulus, $\\kappa_{T}$ and\n", + "$B$, are defined in . The limit of stability is thus determined when the\n", + "isothermal compressibility diverges or the bulk modulus becomes zero\n", + "because $V$ has finite values at any temperatures. It is evident that\n", + "Helmholtz energy must have higher order dependence on volume than in for\n", + "a system with instability because $F_{VV}$ from is constant.\n", + "\n", + "From , the consolute point is defined by\n", + "\n", + "Eq. \u2011\n", + "$F_{VVV} = \\left( \\frac{\\partial^{2}( - P)}{\\partial V^{2}} \\right)_{T,N} = \\frac{\\partial\\left( \\frac{1}{V\\kappa_{T}} \\right)}{\\partial V} = - \\frac{1 + \\frac{V}{\\kappa_{T}}\\frac{\\partial\\kappa_{T}}{\\partial V}}{\\kappa_{T}V^{2}} = 0$\n", + "\n", + "Since $\\kappa_{T}$ becomes infinite at the limit of stability,\n", + "$\\frac{\\partial\\kappa_{T}}{\\partial V}$ approaches negative infinite\n", + "when the critical/consolute point is approached so that\n", + "$\\frac{V}{\\kappa_{T}}\\frac{\\partial\\kappa_{T}}{\\partial V} = - 1$ and\n", + "$F_{VVV} = 0$.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_random_solutions.ipynb b/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_random_solutions.ipynb new file mode 100644 index 0000000..be2d299 --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_random_solutions.ipynb @@ -0,0 +1,544 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "62204a33", + "cell_type": "markdown", + "source": [ + "## Phases with variable compositions: Random solutions\n", + "\n", + "The combined law of thermodynamics and the Gibbs-Duhem equation of a\n", + "solution phase with variable compositions are shown by and ,\n", + "respectively. A phase can be represented by a *c+1*-dimensional surface\n", + "in a *c+2*-dimensional space of potentials based on the Gibbs-Duhem\n", + "equation. The directions and curvature of the surface are represented by\n", + "the partial derivatives shown by and secondary derivatives shown by ,\n", + "both being negative for a stable phase. To develop a mathematical\n", + "formula for Gibbs energy of a phase with variable compositions, one can\n", + "consider a phase as a mixture of independent components that the phase\n", + "is made of. Its Gibbs energy function can be postulated as the summation\n", + "of Gibbs energy of the independent components of the same structure of\n", + "the solution, $_{\\ }^{0}G_{i}$, plus the contribution due to the mixing,\n", + "$_{\\ }^{mixing}G$ or $_{\\ }^{M}G$\n", + "\n", + "Eq. \u2011 $G = \\sum_{}^{}{N_{i}_{\\ }^{0}G_{i}} +_{\\ }^{M}G$\n", + "\n", + "Since the system size usually is not important in thermodynamics, its\n", + "properties are typically normalized to one mole with its composition\n", + "represented by mole fractions of components. The molar Gibbs energy is\n", + "obtained as shown below with the molar Gibbs energy of mixing separated\n", + "into two parts: ideal Gibbs energy of mixing assuming no chemical\n", + "interaction among components, $_{\\ }^{ideal}G_{m}$ or $_{\\ }^{I}G_{m}$,\n", + "and excess Gibbs energy of mixing due to chemical reaction among\n", + "components, $_{\\ }^{excess}G_{m}$ or $_{\\ }^{E}G_{m}$\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} +_{\\ }^{M}G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} +_{\\ }^{I}G_{m} +_{\\ }^{E}G_{m}$\n", + "\n", + "From , the chemical potential of a component is thus\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} +_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} + \\frac{\\partial\\left(_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} \\right)}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial\\left(_{\\ }^{I}{G_{m} +}_{\\ }^{E}G_{m} \\right)}{\\partial x_{j}}$\n", + "\n", + "One may define the chemical activity of component *i*, $a_{i}^{\\ }$, as\n", + "follows\n", + "\n", + "Eq. \u2011\n", + "$RTlna_{i}^{\\ } = \\mu_{i} -_{\\ }^{0}G_{i}^{\\ } =_{\\ }^{I}{G_{m} +}\\frac{\\partial_{\\ }^{I}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{I}G_{m}}{\\partial x_{j}} +_{\\ }^{E}G_{m} + \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{j}}$\n", + "\n", + "In this definition, the chemical activity or simply activity is\n", + "calculated with respect to the pure elements in the structure of the\n", + "solution for practical reasons as one would like to understand the\n", + "chemical potential difference of components in the solution and by\n", + "itself with the same structure. It should be noted that this reference\n", + "state for chemical activity is usually different from the SER reference\n", + "state defined in as the solution may have a different structure than\n", + "those of pure components in their SER states. On the other hand, the\n", + "activity under the SER reference state can be easily obtained by\n", + "replacing $_{\\ }^{0}G_{i}$ with ${_{\\ }^{0}G}_{i}^{SER}$ from . In\n", + "principle, one may choose any structure as the reference state for\n", + "activity to be useful for practical applications, i.e.\n", + "\n", + "Eq. \u2011 $RTlna_{i}^{ref} = \\mu_{i} -_{\\ }^{0}G_{i}^{ref}$\n", + "\n", + "For example, the activity of a component in a liquid solution is defined\n", + "with respect to the pure component in its liquid form from , but can\n", + "also be referred to its SER state which is solid using . The following\n", + "sections will discuss in more details how components mix when they are\n", + "brought together including concepts such as random mixing, short-range\n", + "ordering, and long-range ordering.\n", + "\n", + "The limit of stability of a solution with respect to composition\n", + "fluctuation under constant *T*, *P*, and *N1* can be derived\n", + "as follows from and\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},i > 1} > \\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{1},{\\mu_{2},N}_{j \\neq i},i,j > 2}\\ldots... > \\left( \\frac{\\partial\\mu_{c}}{\\partial N_{c}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = 0$\n", + "\n", + "The first term can be derived from as follows\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)_{T,P,N_{j \\neq i},i > 1} = \\sum_{j = 1}^{c}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}\\partial x_{j}}\\frac{\\partial x_{j}}{\\partial N_{i}} - \\sum_{j = 1}^{c}{x_{j}\\sum_{k = 1}^{c}{\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}\\partial x_{k}}\\frac{\\partial x_{k}}{\\partial N_{i}}}} = \\frac{1}{N}\\left( \\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}^{2}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}^{2}}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{i}\\partial x_{j}}} + \\sum_{j = 1}^{c}{\\sum_{k = 1}^{c}{{x_{j}x}_{k}\\frac{\\partial_{\\ }^{2}G_{m}}{\\partial x_{j}\\partial x_{k}}}} \\right)$\n", + "\n", + "Denoting\n", + "$G_{ij} = \\left( \\frac{\\partial\\mu_{i}}{\\partial N_{j}} \\right)_{T,P,N_{k \\neq j}}$and\n", + "using to change the variables kept constant from molar quantities to\n", + "potentials one-by-one (see \\[1\\]), the limit of stability can be further\n", + "obtained as\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{c}}{\\partial N_{c}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = \\frac{\\det\\left( G_{ij}:2 \\leq i,j \\leq c \\right)}{\\det\\left( G_{ij}:2 \\leq i,j \\leq c - 1 \\right)} = 0$\n", + "\n", + "where $\\det$ stands for determinant. indicates that\n", + "$\\det\\left( G_{ij}:2 \\leq i,j \\leq c \\right) = 0$ at the limit of\n", + "stability. Considering $x_{1} = 1 - \\sum_{j \\neq 1}^{}x_{j}$, let us\n", + "introduce\n", + "\n", + "Eq. \u2011\n", + "$g_{i} = \\mu_{i} - \\mu_{1} = \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{k \\neq i}} - \\left( \\frac{\\partial G_{m}}{\\partial x_{1}} \\right)_{x_{k \\neq 1}}$\n", + "\n", + "and\n", + "\n", + "Eq. \u2011\n", + "$g_{ij} = \\frac{\\partial g_{i}}{\\partial x_{j}} = \\frac{\\partial\\left( \\mu_{i} - \\mu_{1} \\right)}{\\partial x_{j}} = \\frac{\\partial^{2}G_{m}}{\\partial x_{i}\\partial x_{j}} - \\frac{\\partial^{2}G_{m}}{\\partial x_{1}\\partial x_{j}} - \\frac{\\partial^{2}G_{m}}{\\partial x_{i}\\partial x_{1}} + \\frac{\\partial^{2}G_{m}}{\\partial\\left( x_{1} \\right)^{2}}$\n", + "\n", + "The limit of stability can be re-written as\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\left( \\mu_{c} - \\mu_{1} \\right)}{\\partial x_{c}} \\right)_{T,P,N,\\mu_{2} - \\mu_{1},\\ ...\\mu_{c - 1} - \\mu_{1}} = \\frac{\\det\\left( g_{ij}:2 \\leq i,j \\leq c \\right)}{\\det\\left( g_{ij}:2 \\leq i,j \\leq c - 1 \\right)} = 0$\n", + "\n", + "i.e. $\\det\\left( g_{ij}:2 \\leq i,j \\leq c \\right) = 0$. The consolute\n", + "point can be defined following\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial^{2}\\mu_{c}}{\\partial\\left( N_{c} \\right)^{2}} \\right)_{T,P,N_{1},\\mu_{2}..\\mu_{c - 1}} = \\left( \\frac{\\partial^{2}\\left( \\mu_{c} - \\mu_{1} \\right)}{\\partial\\left( x_{c} \\right)^{2}} \\right)_{T,P,N,\\mu_{2} - \\mu_{1},\\ ...\\mu_{c - 1} - \\mu_{1}} = 0$\n", + "\n", + "No closed mathematic form has been published in the literature.\n" + ], + "metadata": {} + }, + { + "id": "6f077042", + "cell_type": "markdown", + "source": [ + "### Random solutions\n", + "\n", + "The ideal Gibbs energy of mixing represents an ideal solution in which\n", + "all sites are equivalent and the distributions of components on the\n", + "sites are completely random. The number of different configurations to\n", + "arrange all components is\n", + "\n", + "Eq. \u2011 $w = \\frac{N!}{\\prod_{}^{}\\left( N_{i}! \\right)}$\n", + "\n", + "Based on Boltzmann\u2019s relation from statistic thermodynamics when all\n", + "configurations have the same probability to be observed, the ideal\n", + "configurational molar entropy of mixing due to the distribution is\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{ideal}S_{m} =_{\\ }^{I}S_{m} = \\frac{Rlnw}{N} = R\\frac{lnN! - \\sum_{}^{}\\ln\\left( N_{i}! \\right)}{N} \\cong R\\frac{NlnN - \\sum_{}^{}{N_{i}l{nN}_{i}}}{N} = - R\\sum_{}^{}{x_{i}l{nx}_{i}}$\n", + "\n", + "where $R$ is the gas constant. represents the entropy difference between\n", + "the ideal solution and the states when individual components are by\n", + "themselves, i.e. the mechanical mixing of components. As $x_{i}$ is\n", + "smaller than unity, the entropy production to form an ideal solution\n", + "from pure components is thus positive, indicating that it is a\n", + "spontaneous process. In such an ideal solution, it is assumed that there\n", + "are no interactions between components, and the enthalpy of mixing is\n", + "thus zero as the internal energy and the volume of the system do not\n", + "change. The ideal Gibbs energy of mixing is written as\n", + "\n", + "Eq. \u2011 $_{\\ }^{I}G = - T_{\\ }^{I}S_{m} = RT\\sum_{}^{}{x_{i}l{nx}_{i}}$\n", + "\n", + "The Gibbs energy of real solutions, i.e. , becomes\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} + RT\\sum_{}^{}{x_{i}l{nx}_{i}} +_{\\ }^{E}G_{m}$\n", + "\n", + "From , the chemical potential is obtained as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} = G_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} +_{\\ }^{E}G_{m} + \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial_{\\ }^{E}G_{m}}{\\partial x_{j}}$\n", + "\n", + "From the chemical activity of , the activity coefficient, $\\gamma_{i}$,\n", + "can be defined as follows\n", + "\n", + "Eq. \u2011\n", + "$\\gamma_{i} = \\frac{a_{i}}{x_{i}} = \\frac{1}{x_{i}}\\exp\\frac{G_{i} -_{\\ }^{0}G_{i}\\ }{RT}$\n", + "\n", + "The solution is an ideal solution with $\\gamma_{i} = 1$, and is said to\n", + "be positively or negatively deviating from an ideal solution with\n", + "$\\gamma_{i} > 1$ or $\\gamma_{i} < 1$, respectively. The chemical\n", + "potential is related to the activity and activity coefficient by the\n", + "following equation\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} + RTlna_{i} =_{\\ }^{0}G_{i} + RTln\\gamma_{i}x_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} + RTln\\gamma_{i}$\n", + "\n", + "Let us further exam in more details in order to better understand the\n", + "relation between $G_{m}$ and $\\mu_{i}$. The partial derivatives in\n", + "represent the directions of molar Gibbs energy in the composition space,\n", + "i.e. the tangents of molar Gibbs energy with respect to mole fractions\n", + "of independent components. Collectively, they define the\n", + "multi-dimensional tangent plane of molar Gibbs energy at the given\n", + "composition, $x_{i}^{0}$. The mathematical representation of this\n", + "tangent plane, $z_{G_{m}}$, is defined by its directional derivatives\n", + "and the distance from the point where the derivatives are taken,\n", + "\n", + "Eq. \u2011\n", + "$z_{G_{m}} = G_{m}\\left( x_{i}^{0} \\right) + \\sum_{i = 1}^{c}{\\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{i}^{0}}\\left( x_{i} - x_{i}^{0} \\right)}$\n", + "\n", + "The intercept of this tangent plane at each pure component axis, i.e.\n", + "$x_{i} = 1$ and $x_{j \\neq i} = 0$, is obtained as\n", + "\n", + "Eq. \u2011\n", + "$z_{G_{m},x_{i} = 1} = G_{m}\\left( x_{i}^{0} \\right) + \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{x_{i}^{\\ } = x_{i}^{0}} - \\sum_{j = 1}^{c}{x_{j}^{0}\\left( \\frac{\\partial G_{m}}{\\partial x_{j}} \\right)_{x_{i}^{\\ } = x_{i}^{0}}}$\n", + "\n", + "This is identical to at the point $x_{i}^{0}$. It is thus shown that the\n", + "chemical potential of a component in a solution is represented by the\n", + "intercept of the tangent plane of Gibbs energy of the solution on the\n", + "$G_{m}$ axis of the component. The distance between the intercept and\n", + "the Gibbs energy of the pure component in the same structure of the\n", + "solution is related to the chemical activity of the component as defined\n", + "by . On the other hand, it is evident that one can choose any other\n", + "structure of the pure element to define the chemical activity to compare\n", + "chemical potential of the component as shown by .\n", + "\n", + "The stability of a solution is evaluated following , and the derivatives\n", + "of chemical potential with respect to its moles, i.e. the elements in\n", + "the determinant, are obtained as follows from and ,\n", + "\n", + "Eq. \u2011\n", + "$\\frac{N}{RT}\\frac{\\partial\\mu_{i}}{\\partial N_{i}} = \\frac{N}{RT}G_{ii} = \\frac{1 - x_{i}}{x_{i}} + \\frac{1}{\\gamma_{i}}\\left( \\frac{\\partial\\gamma_{i}}{\\partial x_{i}} - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial\\gamma_{i}}{\\partial x_{j}}} \\right)$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{N}{RT}\\frac{\\partial\\mu_{i}}{\\partial N_{k}} = \\frac{N}{RT}G_{ik} = - \\frac{x_{k}}{x_{i}} + \\frac{1}{\\gamma_{i}}\\left( 1 - \\sum_{j = 1}^{c}{x_{j}\\frac{\\partial\\gamma_{i}}{\\partial x_{j}}} \\right)$\n", + "\n", + "To further study Gibbs energy of solution phases, let us discuss the\n", + "details on the excess Gibbs energy of mixing. At this point, one can\n", + "start with lower-order systems with fewer components, i.e. two component\n", + "and three-component systems, noting that the Gibbs energy of phases with\n", + "one component is already presented in Chapter .\n" + ], + "metadata": {} + }, + { + "id": "9cc6b18b", + "cell_type": "markdown", + "source": [ + "### Binary random solutions\n", + "\n", + "From , the Gibbs-Duhem equation of a binary system consisting of\n", + "components $A$ and $B$ is written as\n", + "\n", + "Eq. \u2011 $0 = - SdT - Vd( - P) - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "This equation represents a four-dimensional surface. It is self-evident\n", + "that both and hold for stable binary solutions too, i.e. the directions\n", + "and the curvature of the surface are all negative. To visualize the\n", + "four-dimensional surface in the three-dimensional space, one needs to\n", + "fix one of the four potentials. As $T$ and $P$ are the natural variables\n", + "of Gibbs energy, they are usually chosen to be kept constant. One can\n", + "typically investigate behaviors of systems consisting of condensed\n", + "phases by varying the temperature at constant pressure. at constant\n", + "pressure thus becomes\n", + "\n", + "Eq. \u2011 $0 = - SdT - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "Similar to and , the property of a phase can be represented by a\n", + "two-dimensional surface in the three-dimensional space composed of $T$,\n", + "$\\mu_{A}$, and $\\mu_{B}$ under constant $P$, keeping in mind the\n", + "following\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = x_{A}\\mu_{A} + x_{B}\\mu_{B} = x_{A}_{\\ }^{0}G_{A} + x_{B}_{\\ }^{0}G_{B} + RT\\left( x_{A}l{nx}_{A} + x_{B}l{nx}_{B} \\right) +_{\\ }^{E}G_{m}$\n", + "\n", + "Since $_{\\ }^{E}G_{m}$ must be zero for pure components $A$ and $B$, it\n", + "needs to be in the following form\n", + "\n", + "Eq. \u2011 $_{\\ }^{E}G_{m} = x_{A}x_{B}L_{AB}$\n", + "\n", + "with $L_{AB}$ being a parameter denoting the interaction between\n", + "components $A$ and $B$, called interaction parameter. When $L_{AB} = 0$,\n", + "the solution is an ideal solution. When $L_{AB}$ is a non-zero constant\n", + "independent of temperature and composition, the solution is called a\n", + "regular solution. Its excess entropy and excess enthalpy of mixing are\n", + "obtained as\n", + "\n", + "Eq. \u2011 $_{\\ }^{E}S_{m} = \\frac{\\partial_{\\ }^{E}G_{m}}{\\partial T} = 0$\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{E}H_{m} =_{\\ }^{E}G_{m} - T_{\\ }^{E}S_{m} = x_{A}x_{B}L_{AB}$\n", + "\n", + "The chemical potential of component $A$ or $B$ in a binary regular\n", + "solution can be derived as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} + \\left( 1 - x_{i} \\right)^{2}L_{AB}$\n", + "\n", + "In a dilute solution with $x_{i} \\rightarrow 0$, one can have\n", + "\n", + "Eq. \u2011\n", + "$RTln\\gamma_{i} = \\left( 1 - x_{i} \\right)^{2}L_{AB} \\approx L_{AB}$\n", + "\n", + "Eq. \u2011 $\\gamma_{i} = e^{\\frac{L_{AB}}{RT}}$\n", + "\n", + "The activity is thus proportional to its mole fraction, which is called\n", + "Henry\u2019s law. By the same token, for the solvent, i.e.\n", + "$x_{i} \\rightarrow 1$,\n", + "\n", + "Eq. \u2011 $RTln\\gamma_{i} = \\left( 1 - x_{i} \\right)^{2}L_{AB} \\approx 0$\n", + "\n", + "which gives $\\gamma_{i} \\approx 1$, and its activity approaches its mole\n", + "fraction. This is called Raoult\u2019s law.\n", + "\n", + "The stability of a binary solution is derived from as\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B}} = \\left\\lbrack \\frac{RT}{x_{A}} - 2\\left( 1 - x_{A} \\right)L_{AB} \\right\\rbrack\\frac{1 - x_{A}}{N}$\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{B}}{\\partial N_{B}} \\right)_{T,P,N_{A}} = \\left\\lbrack \\frac{RT}{x_{B}} - 2\\left( 1 - x_{B} \\right)L_{AB} \\right\\rbrack\\frac{1 - x_{B}}{N}$\n", + "\n", + "It should be noted that the two chemical potentials in a binary system\n", + "at constant temperature and pressure are dependent on each other due to\n", + "the Gibbs-Duhem equation shown in , i.e.\n", + "\n", + "Eq. \u2011 $0 = - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "and the two chemical potentials depend on each other by the following\n", + "relation\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial\\mu_{B}} \\right)_{T,P} = - \\frac{N_{B}}{N_{A}}$\n", + "\n", + "Therefore, at the limit of stability, both and go to zero at the same\n", + "time, which is obtained when\n", + "\n", + "Eq. \u2011 $RT = 2{x_{A}x_{B}L}_{AB}$\n", + "\n", + "As the absolute temperature cannot be negative, has no solution for a\n", + "solution phase with $L_{AB} < 0$, i.e. the solution phase is stable with\n", + "respect to the composition fluctuation. For a solution with\n", + "$L_{AB} > 0$, its limit of stability is represented .\n", + "\n", + "A schematic molar Gibbs energy of a solution with $L_{AB} < 0$ at\n", + "constant temperature and pressure is shown in along with the ideal and\n", + "excess Gibbs energy of mixing. A tangent line on the molar Gibbs energy\n", + "of the solution is drawn, and its two intercepts at $x_{B} = 0$ and\n", + "$x_{B} = 1$ give the chemical potentials of components $A$ and $B$,\n", + "$\\mu_{A}$ and $\\mu_{B}$ by , respectively. It is evident that $\\mu_{A}$\n", + "and $\\mu_{B}$ are not independent on each other as they are two points\n", + "on the same straight line. This is a graphic representation of the\n", + "Gibbs-Duhem equation of . The chemical activity of component $B$ is also\n", + "depicted with the reference state being the pure B with the same\n", + "structure. As shown in , other structures of pure B can be selected as\n", + "the reference states of the chemical activity of component B, resulting\n", + "in the different distances to its chemical potential in the solution,\n", + "thus different values of its chemical activities. It is clear that this\n", + "change of reference state for chemical activity does not affect the\n", + "chemical potential of the component in the solution.\n", + "\n", + "Figure \u2011: Schematic molar Gibbs energy diagram with $L_{AB} < 0$\n", + "\n", + "When $L_{AB} > 0$, represents a parabola in the $T - x_{i}$\n", + "two-dimensional coordinate, symmetric with respect to $x_{A}$ and\n", + "$x_{B}$, shown in , i.e. the spinodal of the solution. The consolute\n", + "point is obtained by applying to and letting equal to zero at the\n", + "consolute point\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial^{2}\\mu_{A}}{\\partial N_{A}^{2}} \\right)_{T,P,N_{B}} = \\left\\lbrack - \\frac{RT}{x_{A}^{2}} + 2L_{AB} \\right\\rbrack\\left( \\frac{1 - x_{A}}{N} \\right)^{2} = 0$\n", + "\n", + "which gives\n", + "\n", + "Eq. \u2011 $T_{cons} = 2x_{A}^{2}L_{AB}$\n", + "\n", + "Solving and , one obtains $x_{A} = x_{B} = 0.5$ and\n", + "\n", + "Eq. \u2011 $T_{cons} = \\frac{L_{AB}}{2R}$\n", + "\n", + "Figure \u2011: A Spinodal curve with $L_{AB} > 0$\n", + "\n", + "A schematic molar Gibbs energy diagram at temperatures below the\n", + "consolute point is shown in . It can be seen that part of the molar\n", + "Gibbs energy has negative curvature, and the solution becomes unstable.\n", + "The chemical potential thus does not change monotonically with respect\n", + "to composition and its derivative changes sign at the inflexion point.\n", + "\n", + "Figure \u2011: Schematic molar Gibbs energy diagram with $L_{AB} > 0$\n", + "\n", + "For more complex solutions, $L_{AB}$ can be a function of temperature,\n", + "pressure, and compositions. In principle, the temperature and pressure\n", + "dependences can be treated by means of formula similar to . There are\n", + "various approaches in the literature to consider the composition\n", + "dependence of $L_{AB}$. The empirical Redlich-Kister polynomial stands\n", + "out as the one most widely used because it can be extrapolated to\n", + "ternary and multi-component systems consistently, which will be\n", + "discussed in Chapter .\n" + ], + "metadata": {} + }, + { + "id": "891d7281", + "cell_type": "markdown", + "source": [ + "### Ternary random solutions\n", + "\n", + "From , the Gibbs-Duhem equation of a ternary system consisting of\n", + "components $A$, $B$ and $C$ is written as\n", + "\n", + "Eq. \u2011\n", + "$0 = - SdT - Vd( - P) - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B} - {N_{C}d\\mu}_{C}$\n", + "\n", + "This equation represents a five-dimensional surface. It can be\n", + "visualized in a three-dimensional space with two of the five potentials\n", + "fixed. Usually $T$ and $P$ are kept constant as they are the natural\n", + "variables of $G$, and reduces to\n", + "\n", + "Eq. \u2011 $0 = - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B} - {N_{C}d\\mu}_{C}$\n", + "\n", + "A phase can thus be represented by a surface in the three-dimensional\n", + "space of $\\mu_{A}$, $\\mu_{B}$, and $\\mu_{C}$ at constant $T$ and $P$\n", + "with similar geometric appearance as .\n", + "\n", + "From , Gibbs energy of a ternary solution is written as\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = x_{A}_{\\ }^{0}G_{A} + x_{B}_{\\ }^{0}G_{B} + x_{C}_{\\ }^{0}G_{C} + RT\\left( x_{A}l{nx}_{A} + x_{B}l{nx}_{B} + x_{C}l{nx}_{C} \\right) +_{\\ }^{E}G_{m}$\n", + "\n", + "When the mole fraction of one component approaches zero,\n", + "$_{\\ }^{E}G_{m}$ reduces to the excess Gibbs energy of mixing of the\n", + "binary systems of the remaining two components, represented by .\n", + "However, for a given composition of a ternary solution, there is no\n", + "unique way to assign the contributions from $_{\\ }^{E}G_{m}$ of each\n", + "binary to $_{\\ }^{E}G_{m}$ of the ternary solution because\n", + "$_{\\ }^{E}G_{m}$ of the ternary solution contains information of both\n", + "binary and ternary interactions. A variety of models is available in the\n", + "literature (see \\[1\\]). One intuitive approach would be to use the same\n", + "formula as that in the binary system, i.e. , with the mole fractions\n", + "substituted by the values in the ternary system, and $_{\\ }^{E}G_{m}$ of\n", + "a ternary solution may thus be defined as the following by including the\n", + "ternary interaction involving all three components,\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{E}G_{m} = x_{A}x_{B}L_{AB} + x_{A}x_{C}L_{AC} + x_{B}x_{C}L_{BC} + x_{A}x_{B}x_{C}L_{ABC}$\n", + "\n", + "The chemical potential of a component is represented by . When all\n", + "interaction parameters in are constant, i.e. a ternary regular solution,\n", + "the chemical potential of component $A$ can be derived as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{A} = G_{A} =_{\\ }^{0}G_{A} + RTlnx_{A} + x_{B}L_{AB} + x_{C}L_{AC} -_{\\ }^{E}G_{m} =_{\\ }^{0}G_{A} + RTlnx_{A} + x_{B}{\\left( 1 - x_{A} \\right)L}_{AB} + x_{C}\\left( 1 - x_{A} \\right)L_{AC} - x_{B}x_{C}L_{BC} + x_{B}x_{C}\\left( 1 - 2x_{A} \\right)L_{ABC} =_{\\ }^{0}G_{A} + RTlnx_{B} + x_{B}^{2}L_{AB} + x_{C}^{2}L_{AC} + x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) + x_{B}x_{C}\\left( 1 - 2x_{A} \\right)L_{ABC}$\n", + "\n", + "Similar equations can be derived for component $B$ and C with\n", + "$L_{AB} = L_{BA}$, $L_{AC} = L_{CA}$, and $L_{BC} = L_{CB}$. A schematic\n", + "molar Gibbs energy diagram at constant temperature and pressure is shown\n", + "in with all three binary systems having $L_{ij} < 0$ of similar values.\n", + "\n", + "Figure \u2011: Schematic ternary molar Gibbs energy diagram as a function of\n", + "compositions for given temperature and pressure\n", + "\n", + "To evaluate the stability of a ternary solution, one needs to calculate\n", + "the elements in the determinant shown in . Using the mole of component\n", + "$C$ as the independent molar quantity, the limit of stability is\n", + "expresses as\n", + "\n", + "Eq. \u2011 $G_{AA}G_{BB} - G_{AB}G_{BA} = 0$\n", + "\n", + "As an example, $G_{AA}$ is shown in the following equation, which must\n", + "be positive for the solution to be stable\n", + "\n", + "Eq. \u2011\n", + "${N\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)}_{T,P,N_{B},N_{C}} = NG_{AA} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}} - 2x_{B}^{2}L_{AB} - 2x_{C}^{2}L_{AC} - 2x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) - 2x_{B}x_{C}\\left( 2 - 3x_{A} \\right)L_{ABC}$\n", + "\n", + "It is evident that any instability in binary systems with positive\n", + "interaction parameters extends into the ternary system. It can also be\n", + "seen that even if all binary interaction parameters are negative, i.e.\n", + "no instability in the binary systems, it is possible that becomes\n", + "negative for some combinations of the binary interaction parameters such\n", + "that $\\mathrm{\\Delta}L = L_{AB} + L_{AC} - L_{BC}$ becomes very positive\n", + "and overshadows the contributions due to $L_{AB}$ and $L_{AC}$, i.e.\n", + "$L_{BC}$ is more negative than $L_{AB}$ and $L_{AC}$ combined. In an\n", + "extreme case with $L_{AB} = L_{AC} = L_{ABC} = 0$ and $L_{BC} < 0$, i.e.\n", + "ideal solutions for the $A - B$ and $A - C$ binary systems, stable\n", + "solution in the $B - C$ binary system, and no additional ternary\n", + "interaction, reduces to\n", + "\n", + "Eq. \u2011\n", + "$N\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B},N_{C}} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}} + 2x_{B}x_{C}L_{BC}$\n", + "\n", + "Setting\n", + "$\\left( \\frac{\\partial\\mu_{A}}{\\partial N_{A}} \\right)_{T,P,N_{B},N_{C}} = 0$,\n", + "one obtains\n", + "\n", + "Eq. \u2011\n", + "$- \\frac{RT}{2L_{BC}} = \\frac{x_{A}x_{B}x_{C}}{1 - x_{A}} = \\frac{{\\left( 1 - x_{B} - x_{C} \\right)x}_{B}x_{C}}{x_{B} + x_{C}}$\n", + "\n", + "With $- \\frac{RT}{2L_{BC}}$ being positive due to $L_{BC} < 0$, there is\n", + "a parabola-shaped composition area in which the solution is unstable at\n", + "constant temperature and pressure. This is reasonable because the system\n", + "tends to maximize the number of B-C bonds due to its lower energy, which\n", + "competes with the entropy of mixing among the three elements and results\n", + "in segregation of B-C bonds, thus miscibility gap at low temperatures.\n", + "\n", + "To evaluate the ternary consolute point, the second derivatives for\n", + "component A and B are obtained as\n", + "\n", + "Eq. \u2011\n", + "${N\\left( \\frac{\\partial_{\\ }^{2}\\mu_{A}}{\\partial N_{A}^{2}} \\right)}_{T,P,N_{B},N_{C}} = \\frac{RT\\left( 1 - x_{A} \\right)}{x_{A}^{2}} + 4x_{B}^{2}L_{AB} + 4x_{C}^{2}L_{AC} + 4x_{B}x_{C}\\left( L_{AB} + L_{AC} - L_{BC} \\right) + 2x_{B}x_{C}\\left( 7 - 9x_{A} \\right)L_{ABC} = 0$\n", + "\n", + "Eq. \u2011\n", + "${N\\left( \\frac{\\partial_{\\ }^{2}\\mu_{B}}{\\partial N_{B}^{2}} \\right)}_{T,P,N_{A},N_{C}} = \\frac{RT\\left( 1 - x_{B} \\right)}{x_{B}^{2}} + 4x_{A}^{2}L_{AB} + 4x_{C}^{2}L_{BC} + 4x_{A}x_{C}\\left( L_{AB} + L_{BC} - L_{AC} \\right) + 2x_{A}x_{C}\\left( 7 - 9x_{B} \\right)L_{ABC} = 0$\n", + "\n", + "The consolute point can then be obtained using , and .\n", + "\n", + "It is observed in that $\\left( 1 - 2x_{A} \\right)L_{ABC} = 0$ at\n", + "$x_{A} = 0.5$, i.e. the ternary interaction parameter does not\n", + "contribute to the chemical potential of $A$. It is also observed in that\n", + "the contribution from the ternary interaction parameter changes sign at\n", + "$x_{i} = 2/3$ due to $\\left( 2 - 3x_{A} \\right)L_{ABC} = 0$.\n" + ], + "metadata": {} + }, + { + "id": "2eab4d60", + "cell_type": "markdown", + "source": [ + "### Multi-component random solutions\n", + "\n", + "Similar to a ternary solution, the excess Gibbs energy of mixing of a\n", + "multi-component solution can be written as\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{E}G_{m} = \\sum_{i}^{}{\\sum_{j}^{}{x_{i}x_{j}L_{ij}}} + \\sum_{i}^{}{\\sum_{j}^{}{\\sum_{k}^{}{x_{i}x_{j}x_{k}L_{ijk}}}}$\n", + "\n", + "In principle, one can add interaction parameters for quaternary and\n", + "higher order systems, but their contributions to Gibbs energy are\n", + "relatively minor because the major contributions have already been taken\n", + "into account by the binary and ternary interactions. It is anticipated\n", + "that not only the interaction parameters of four or more components are\n", + "small, but also the multiplication of mole fractions in front the\n", + "interaction parameters diminishes their contribution to the Gibbs energy\n", + "even further.\n", + "\n", + "Under the condition that all interaction parameters are constant, the\n", + "chemical potential of a component in a multi-component system with\n", + "binary and ternary interaction parameters can be extended from as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} =_{\\ }^{0}G_{i} + RTlnx_{i} + \\sum_{j \\neq i}^{}{x_{j}^{2}L_{ij}} + \\sum_{k > j}^{}{\\sum_{j \\neq i}^{}{x_{j}x_{k}}}\\left\\lbrack L_{ij} + L_{ik} - L_{jk} + \\left( 1 - 2x_{i} \\right)L_{ijk} \\right\\rbrack$\n", + "\n", + "The stability of the solution can also be extended from as\n", + "\n", + "Eq. \u2011\n", + "${N\\left( \\frac{\\partial\\mu_{i}}{\\partial N_{i}} \\right)}_{T,P,N_{j \\neq i}} = NG_{ii} = \\frac{RT\\left( 1 - x_{i} \\right)}{x_{i}} - 2\\sum_{j \\neq i}^{}{x_{j}^{2}L_{ij}} - 2\\sum_{k > j}^{}{\\sum_{j \\neq i}^{}{x_{j}x_{k}}}\\left\\lbrack L_{ij} + L_{ik} - L_{jk} + \\left( 2 - 3x_{i} \\right)L_{ijk} \\right\\rbrack$\n", + "\n", + "The limit of stability of a multi-component random solution can be\n", + "represented by or .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_solutions_with_ordering.ipynb b/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_solutions_with_ordering.ipynb new file mode 100644 index 0000000..236f8ac --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/phases_with_variable_compositions_solutions_with_ordering.ipynb @@ -0,0 +1,420 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "ef80df3d", + "cell_type": "markdown", + "source": [ + "## Phases with variable compositions: Solutions with ordering\n" + ], + "metadata": {} + }, + { + "id": "7908011c", + "cell_type": "markdown", + "source": [ + "### Solutions with short-range ordering\n", + "\n", + "The order in a system can be measured by correlation functions which\n", + "describes how various components are correlated in space. For\n", + "simplicity, let us consider only the pairs between nearest neighbors\n", + "with the correlation function represented by the pair probability of\n", + "nearest neighbor bonds between two components. In a random solution, the\n", + "probability to find nearest neighbor bonds between two components $i$\n", + "and $j$ is\n", + "\n", + "Eq. \u2011 $p_{ij} = x_{i}x_{j}$\n", + "\n", + "When $p_{ij} \\neq x_{i}x_{j}$, the nearest neighbors of component $i$\n", + "are not occupied randomly by component $j$, rather certain components\n", + "are favored, resulting in short-range ordering or local clustering in\n", + "the solution. When short-range ordering develops throughout the\n", + "solution, long-range ordering takes place, and each component has its\n", + "own primary sites in the solution, to be discussed in Chapter . There\n", + "are relations between bond probabilities and mole fractions of\n", + "components due to the mass balance as follows, with the assumption of\n", + "$p_{ij} = p_{ji}$\n", + "\n", + "Eq. \u2011 $\\sum_{i}^{}{\\sum_{j}^{}p_{ij}} = 1$\n", + "\n", + "Eq. \u2011 $x_{i} = \\sum_{j}^{}p_{ij}$\n", + "\n", + "For small deviations from a random solution, one can consider the\n", + "formation of $i - j$ bonds from $i - i\\ $ and $j - j$ bonds and the\n", + "ideal mixing of three types of bonds, similar to a typical Ising model.\n", + "The bond reaction can be written as\n", + "\n", + "Eq. \u2011 $(i - i\\ )bonds + (j - j)\\ bonds = 2\\ (i - j)\\ bonds$\n", + "\n", + "with the Gibbs energy of reaction being\n", + "\n", + "Eq. \u2011\n", + "${\\mathrm{\\Delta}G}_{ij} = 2G_{ij} - \\left( G_{ii} + G_{jj} \\right)\\ $\n", + "\n", + "Gibbs energy of the solution per mole of atom is thus represented by the\n", + "bond energies and the ideal mixing of bonds plus non-ideal interactions\n", + "between pairs,\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{i}^{}{\\sum_{j}^{}{p_{ij}G_{ij}}} + \\frac{Z}{2}RT\\sum_{i}^{}{\\sum_{j}^{}{p_{ij}\\ln p_{ij}}} +_{\\ }^{E}G_{m}$\n", + "\n", + "with $G_{ij}$ being the molar bond energy between components $i$ and\n", + "$j$, $Z$ the number of bonds per atom which is divided by two in the\n", + "equation due to two atoms needed to form one bond, and\n", + "$_{\\ }^{E}G_{m} = \\sum_{}^{}{p_{ij}p_{kl}I_{ijkl}}$ the excess Gibbs\n", + "energy of mixing between bonds. This approach proposed by Guggenheim\n", + "\\[2\\] is called quasi-chemical method as it is based on the chemical\n", + "reaction shown by .\n", + "\n", + "However, the entropy of mixing in does not reduce to ideal entropy of\n", + "mixing for a solution without short-range ordering as defined by . An\n", + "approximated correction may be added for small degree of short-range\n", + "ordering as follows\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{i}^{}{\\sum_{j}^{}{p_{ij}G_{ij}}} + \\frac{Z}{2}RT\\sum_{i}^{}{\\sum_{j}^{}{p_{ij}\\ln\\frac{p_{ij}}{x_{i}x_{j}}}} + RT\\sum_{}^{}{x_{i}l{nx}_{i}} +_{\\ }^{E}G_{m}$\n", + "\n", + "For a random solution defined by , becomes\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{x_{i}_{\\ }^{0}G_{i}} + RT\\sum_{}^{}{x_{i}l{nx}_{i}} + \\sum_{}^{}{x_{i}x_{j}{\\mathrm{\\Delta}G}_{ij}} +_{\\ }^{E}G_{m}$\n", + "\n", + "with $_{\\ }^{0}G_{i} = G_{ii}$, ${\\mathrm{\\Delta}G}_{ij}$ from Eq. 2\u2011107\n", + "representing the interaction parameter between components $i$ and $j$,\n", + "and $_{\\ }^{E}G_{m} = \\sum_{}^{}{x_{i}{x_{j}x_{k}x}_{l}I_{ijkl}}$\n", + "denoting the higher order interactions, in comparison with .\n", + "\n", + "When short-range ordering exists in a solution, one typically uses the\n", + "law of mass reaction for the chemical reaction represented by to define\n", + "the equilibrium among all bonds, i.e.\n", + "\n", + "Eq. \u2011\n", + "$\\frac{\\left( p_{ij} \\right)^{2}}{p_{ii}p_{jj}} = e^{- \\frac{{\\mathrm{\\Delta}G}_{ij}}{kT}}$\n", + "\n", + "However, this is under the assumption that the chemical activities of\n", + "all bonds can be represented by their respective probabilities, which is\n", + "only true for an ideal solution even excluding dilute solutions due to\n", + "the Henry\u2019s law shown by . Preferrably, the bond probabilities can be\n", + "obtained by calculating the driving force for the fluctuation of bond\n", + "probabilities under constant temperature, pressure, and amount of each\n", + "component along with the constraints defined by and and equating the\n", + "driving force to zero, i.e.\n", + "\n", + "Eq. \u2011\n", + "${\\frac{1}{N}\\left( \\frac{\\partial G}{\\partial\\xi} \\right)}_{T,P,N_{n}} = \\left( \\frac{\\partial G_{m}}{\\partial p_{ij}} \\right)_{T,P,N_{n}} = \\left( \\frac{\\partial G_{m}}{\\partial p_{ij}} \\right)_{T,P,x_{n},p_{kl \\neq ij}} - \\sum_{kl \\neq ij}^{}\\left( \\frac{\\partial G_{m}}{\\partial p_{kl}} \\right)_{T,P,x_{n},p_{op \\neq kl}} + \\left( \\frac{\\partial G_{m}}{\\partial x_{i}} \\right)_{T,P,x_{q \\neq i},p_{kl}} + \\left( \\frac{\\partial G_{m}}{\\partial x_{j}} \\right)_{T,P,x_{q \\neq j},p_{kl}} = 0$\n", + "\n", + "where $\\frac{\\partial p_{kl}}{\\partial p_{ij}} = - 1$ and\n", + "$\\frac{\\partial x_{i}}{\\partial p_{ij}} = \\frac{\\partial x_{j}}{\\partial p_{ij}} = 1$\n", + "are used from and . Numerical values of $p_{ij}$ can be obtained by\n", + "minimization of Gibbs energy under constraints given by and .\n", + "\n", + "The chemical potential of independent component $i$ is defined as in and\n", + "can be represented by the following equation\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} = G_{m} + \\frac{\\partial G_{m}}{\\partial x_{i}} - \\sum_{j = 1}^{c}x_{j}\\frac{\\partial G_{m}}{\\partial x_{j}} + 2\\sum_{j = 1}^{c}\\frac{\\partial G_{m}}{\\partial p_{ij}} - \\frac{\\partial G_{m}}{\\partial p_{ii}} - 2\\sum_{j = 1}^{c}x_{j}\\sum_{k = 1}^{c}\\frac{\\partial G_{m}}{\\partial p_{jk}} + \\sum_{j = 1}^{c}x_{j}\\frac{\\partial G_{m}}{\\partial p_{jj}}$\n", + "\n", + "The stability of the solution can be derived similar to .\n", + "\n", + "When the bonding between components becomes very strong, distinctive new\n", + "components may form. They are not independent components and often\n", + "called associates. Both the independent and dependent components are\n", + "collectively called species. The formation of an associate\n", + "$i_{a_{i}}j_{b_{j}}$ consisting of $a_{i}$ mole of $i$ and $a_{j}$ mole\n", + "$j$ can be written as\n", + "\n", + "Eq. \u2011 $a_{i}i + a_{j}j = i_{a_{i}}j_{a_{j}}$\n", + "\n", + "Gibbs energy of the associate follows the same format of that of a\n", + "stoichiometric phase as shown by ,\n", + "\n", + "Eq. \u2011\n", + "${_{\\ }^{0}G}_{i_{a_{i}}j_{a_{j}}} = \\sum_{}^{}a_{i}{_{\\ }^{0}G}_{i}^{SER} + \\mathrm{\\Delta}_{f}G_{i_{a_{i}}j_{a_{j}}}$\n", + "\n", + "Gibbs energy of the solution is obtained by extending to all species\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}_{\\ }^{0}G_{i_{a_{i}}j_{a_{j}}}} + RT\\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}\\ln y_{i_{a_{i}}j_{a_{j}}}} +_{\\ }^{E}G_{m}$\n", + "\n", + "where $y_{i_{a_{i}}j_{a_{j}}}$ is the mole fraction of species\n", + "$i_{a_{i}}j_{a_{j}}$ in the solution with $a_{i} = 1$ and $a_{j} = 0$\n", + "for component $i$ and $a_{i} = 0$ and $a_{j} = 1$ for component $j$. The\n", + "equilibrium amount of each associate $i_{a_{i}}j_{a_{j}}$ is obtained in\n", + "combination of mass balance and the zero driving force for the variation\n", + "of the amount of the associate similar to , i.e.\n", + "\n", + "Eq. \u2011 $\\sum_{i}^{}{\\sum_{j}^{}y_{i_{a_{i}}j_{a_{j}}}} = 1$\n", + "\n", + "Eq. \u2011 $x_{i} = \\sum_{}^{}{a_{i}y_{i_{a_{i}}j_{a_{j}}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{{\\partial G}_{m}}{\\partial y_{i_{a_{i}}j_{a_{j}}}} \\right)_{x_{i}} = 0$\n", + "\n", + "Associates are particularly plentiful in a gas phase, and their amounts\n", + "are significantly affected by pressure. For an ideal gas phase with\n", + "$_{\\ }^{E}G_{m} = 0$ and $PV_{m} = RT$, the effect of pressure is added\n", + "as follows\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}_{\\ }^{0}G_{i_{a_{i}}j_{a_{j}}}} + RT\\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}\\ln y_{i_{a_{i}}j_{a_{j}}}} + \\int_{P_{0}}^{P}{V_{m}dP} = \\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}_{\\ }^{0}G_{i_{a_{i}}j_{a_{j}}}} + RT\\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}\\ln y_{i_{a_{i}}j_{a_{j}}}} + RT\\ln\\frac{P}{P_{0}}$\n", + "\n", + "where $P$ is the total pressure, and $P_{0}$ the reference pressure at\n", + "which $_{\\ }^{0}G_{i_{a_{i}}j_{a_{j}}}$ is defined, usually chosen to be\n", + "one atmospheric pressure. thus becomes\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}_{\\ }^{0}{G_{i_{a_{i}}j_{a_{j}}}(P = 1atm)}} + RT\\sum_{}^{}{y_{i_{a_{i}}j_{a_{j}}}\\ln y_{i_{a_{i}}j_{a_{j}}}} + RTlnP$\n", + "\n", + "with the unit of the total pressure $P$ being in atmospheric pressure\n", + "(atm). The chemical potential of species $i_{a_{i}}j_{a_{j}}$ is equal\n", + "to\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i_{a_{i}}j_{a_{j}}} =_{\\ }^{0}{G_{i_{a_{i}}j_{a_{j}}}(P = 1atm)} + RTlny_{i_{a_{i}}j_{a_{j}}}P =_{\\ }^{0}{G_{i_{a_{i}}j_{a_{j}}}(P = 1atm)} + RTlnP_{i_{a_{i}}j_{a_{j}}}$\n", + "\n", + "where $P_{i_{a_{i}}j_{a_{j}}}$ is the partial pressure of species\n", + "$i_{a_{i}}j_{a_{j}}$ defined as\n", + "\n", + "Eq. \u2011 $P_{i_{a_{i}}j_{a_{j}}} = y_{i_{a_{i}}j_{a_{j}}}P$\n", + "\n", + "Combining and with , the relation between chemical potentials of an\n", + "associate and its constituents is expressed as\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i_{a_{i}}j_{a_{j}}} = a_{i}\\mu_{i} + {a_{j}\\mu}_{j} = a_{i}_{\\ }^{0}G_{i} + a_{j}_{\\ }^{0}G_{j} + RTln\\left( {P_{i}}^{a_{i}}{P_{j}}^{a_{j}} \\right)$\n", + "\n", + "The equilibrium condition for the chemical reaction of an associate\n", + "forming from its constituents in an ideal gas phase is obtained as\n", + "\n", + "Eq. \u2011\n", + "$\\mathrm{\\Delta}_{f}G_{i_{a_{i}}j_{a_{j}}} + RTln\\frac{{P_{i}}^{a_{i}}{P_{j}}^{a_{j}}}{P_{i_{a_{i}}j_{a_{j}}}} = 0$\n", + "\n", + "For non-ideal phases, the mole fractions of various associates can be\n", + "calculated numerically through the minimization of Gibbs energy under\n", + "the constraints of and .\n" + ], + "metadata": {} + }, + { + "id": "dc74ea53", + "cell_type": "markdown", + "source": [ + "### Solutions with long-range ordering\n", + "\n", + "So far, solutions in which a component can occupy any site in a phase\n", + "are discussed. In many phases, this is not the case. For example, in the\n", + "fcc solid solution of Fe and C, Fe atoms take the fcc lattice sites, and\n", + "C atoms occupy the interstitial sites between the fcc lattice sites.\n", + "Therefore, Fe atoms do not mix with C atoms on the fcc lattice sites,\n", + "and they rather develop long-rang ordering by occupying their own\n", + "distinct sites in the phase. Long-range ordering can also develop when\n", + "short-range ordering extends to the whole lattice. New formula for the\n", + "Gibbs energy of mixing is needed by considering the details how\n", + "components are distributed and mixed in various sites in a phase.\n", + "\n", + "One way to group various sites in a phase is based on equivalent\n", + "crystallographic positions in a phase, i.e. Wyckoff positions. Various\n", + "sets of equivalent positions divide the lattice into sub-sets of\n", + "lattices. Each set of equivalent positions forms a sublattice. The\n", + "distributions of components on each sublattice can be represented by\n", + "mole fractions of components in the sublattice, commonly referred to as\n", + "site fractions and defined as\n", + "\n", + "Eq. \u2011 $y_{i}^{t} = \\frac{N_{i}^{t}}{\\sum_{j}^{}N_{j}^{t}}$\n", + "\n", + "Eq. \u2011 $\\sum_{i}^{}y_{i}^{t} = 1$\n", + "\n", + "where the superscript $t$ denotes the sublattice in which the component\n", + "resides, and the summation is for all species in sublattice $t$\n", + "including vacancy. Site fractions and mole fractions are related through\n", + "the mass balance as follows\n", + "\n", + "Eq. \u2011\n", + "$x_{i} = \\frac{\\sum_{}^{}{a^{t}y_{i}^{t}}}{\\sum_{}^{}{a^{t}\\left( 1 - y_{va}^{t} \\right)}}$\n", + "\n", + "where $a^{t}$ and $y_{va}^{t}$ are the number of sites and the site\n", + "fraction of vacancy in the sublattice *t*.\n", + "\n", + "Random solutions form when each component enters all sublattices\n", + "equally. Mole fractions and site fractions thus become identical.\n", + "Solutions with both substitutional and interstitial component, like the\n", + "fcc Fe-C solution mentioned above, can be represented by two\n", + "sublattices. Stoichiometric compounds have its site fractions equal to\n", + "unity in each sublattice. When site fractions in a compound deviate from\n", + "unity, the compound is no longer stoichiometric and develops a\n", + "composition range of homogeneity. When the composition range is small,\n", + "the deviations are often referred to as defects. Since many properties\n", + "of a compound are determined by defects, a distinct field of defect\n", + "chemistry exists, predominantly for charged species. As will be\n", + "demonstrated in Chapter and the rest of the book, defects can be treated\n", + "as an integral part of the thermodynamics of a phase with more than one\n", + "sublattices.\n", + "\n", + "Let us consider a case where there is only one component in each\n", + "sublattice, which represents one possible stoichiometric composition of\n", + "the phase and is often called an end-member of the phase. The Gibbs\n", + "energy of an end-member is the same as that of a phase with a fixed\n", + "composition shown by or or . By re-arranging , Gibbs energy of an\n", + "end-member, $_{\\ }^{0}G_{em}$, is obtained as\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{0}G_{em} = \\sum_{t}^{}{a^{t}{_{\\ }^{0}G}_{i}^{t,ref}} + \\mathrm{\\Delta}_{f}G_{em}$\n", + "\n", + "where ${_{\\ }^{0}G}_{i}^{t,ref}$ represents the Gibbs energy of\n", + "component $i$ in a given reference state which occupies sublattice $t$\n", + "in the end-member. For vacancy, $_{\\ }^{0}G_{Va} = 0$ is defined. The\n", + "contribution of each end-member to the Gibbs energy of the phase is the\n", + "product of site fraction of each component in their respective\n", + "sublattices and the Gibbs energy of the end-member per mole of formula\n", + "unit (*mf*), i.e.\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{0}G_{mf} = \\sum_{em}^{}\\left( \\prod_{t}^{}y_{i}^{t}_{\\ }^{0}G_{em} \\right)$\n", + "\n", + "The ideal mixing in each sublattice is similar to that in a random\n", + "solution with mole fractions substituted by site fractions. The excess\n", + "Gibbs energy of mixing consists of two contributions: (i) the mixing in\n", + "one sublattice with all other sublattices containing only one component\n", + "in each sublattice and (ii) the mixing simultaneously in more than one\n", + "sublattices. The Gibbs energy of a solution phase with multi-sublattices\n", + "can thus be written in terms of per mole of formula unit as\n", + "\n", + "Eq. \u2011\n", + "$G_{mf} =_{\\ }^{0}G_{mf} + RT\\sum_{t}^{}{a^{t}\\sum_{i}^{}{y_{i}^{t}\\ln y_{i}^{t}}} +_{\\ }^{E}G_{mf}$\n", + "\n", + "with $_{\\ }^{E}G_{mf}$ given by\n", + "\n", + "Eq. \u2011\n", + "$_{\\ }^{E}G_{mf} = \\sum_{t}^{}{\\prod_{s \\neq t}^{}y_{l}^{s}\\sum_{i > j}^{}{\\sum_{j}^{}{y_{i}^{t}y_{j}^{t}L_{i,j:l}^{t}}}} + \\sum_{t}^{}{\\prod_{s \\neq t}^{}y_{l}^{s}\\sum_{i > j}^{}{\\sum_{j > k}^{}{\\sum_{k}^{}{y_{i}^{t}y_{j}^{t}y_{k}^{t}L_{i,j,k:l}^{t}}}}} + \\sum_{t}^{}{\\prod_{s \\neq t,u}^{}y_{l}^{s}\\sum_{i > j}^{}{\\sum_{j > k}^{}{\\sum_{k}^{}{y_{i}^{t}y_{j}^{t}y_{m}^{u}y_{n}^{u}L_{i,j:m,n:l}^{t}}}}}$\n", + "\n", + "The first term in represents the binary interaction between component\n", + "$i$ and $j$ in sublattice $t$ with sublattice $s$ occupied by component\n", + "$l$ with comma separating interacting components in one sublattice and\n", + "colon separating sublattices. The product,\n", + "$\\prod_{s \\neq t}^{}y_{l}^{s}$, runs through all other sublattices with\n", + "one component in each sublattice, except sublattice $t$ in which the\n", + "interaction is considered. The second term denotes the ternary\n", + "interaction among $i$, $j$, and $k$ in sublattice $t$ with sublattice\n", + "$s$ occupied by component $l$. The third term depicts the interactions\n", + "simultaneously in both sublattice $t$ and $u$, and the product runs\n", + "through all other sublattices with one component in each sublattice,\n", + "except sublattice $t$ and $u$ in which the interactions are considered.\n", + "The third term thus partially reflects the short-range ordering among\n", + "components between two sublattices. In principles, high-order\n", + "interaction parameters such as quaternary, quinary, and multiple\n", + "sublattice interaction parameters could be added, but their\n", + "contributions to $_{\\ }^{E}G_{mf}$ are small due to the physical\n", + "insignificance of co-location of four or five components indicated by\n", + "the product of their site fractions in front of the interaction\n", + "parameters.\n", + "\n", + "In , the chemical potential of a stoichiometric compound was defined in\n", + "terms of a summation of chemical potential of individual components in\n", + "the compound because the relative amounts of components are constrained\n", + "by the stoichiometry of the compound and chemical potentials of\n", + "individual components can not vary independently. By the same token, the\n", + "chemical potential of an end-member in a solution can be written as\n", + "\n", + "Eq. \u2011 $\\mu_{em} = G_{em} = \\sum_{t}^{}a^{t}\\mu_{i}^{t}$\n", + "\n", + "where $\\mu_{i}^{t}$ is the chemical potential of component $i$ that\n", + "occupies the sublattice $t$ in the end-member, and can be derived using\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i}^{t} = a^{t}_{\\ }^{0}G_{i}^{t,ref} + a^{t}RTlny_{i}^{t} +_{\\ }^{E}G_{mf}^{\\ } + \\frac{\\partial_{\\ }^{E}G_{mf}^{\\ }}{\\partial y_{i}^{t}} - \\sum_{j}^{\\ }y_{j}^{t}\\frac{\\partial_{\\ }^{E}G_{mf}^{\\ }}{\\partial y_{j}^{t}}$\n", + "\n", + "For constant interaction parameters in , for chemical potential reduces\n", + "to the following expression from\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i}^{t} = a^{t}_{\\ }^{0}G_{i}^{t} + a^{t}RTlny_{i}^{t} + \\sum_{j \\neq i}^{}{\\left( y_{i}^{t} \\right)^{2}L}_{i,j}^{t} + \\sum_{k > j}^{}{\\sum_{j \\neq i}^{}{y_{j}^{t}y_{k}^{t}\\left\\lbrack L_{i,j}^{t} + L_{i,k}^{t} - L_{j,k}^{t} + \\left( 1 - 2y_{i}^{t} \\right)L_{i,j,k}^{t} \\right\\rbrack}}$\n", + "\n", + "The stability of the solution is defined by\n", + "$\\frac{\\partial\\mu_{em}}{\\partial N_{em}}$ with $N_{em}$ being the moles\n", + "of the end-member in the solution given by\n", + "$N_{em} = N\\prod_{u}^{}y_{j}^{u}$ and\n", + "\n", + "Eq. \u2011\n", + "$\\frac{\\partial N_{em}}{\\partial y_{j}^{u}} = \\frac{N\\prod_{t}^{}y_{i}^{t}}{y_{j}^{u}\\left( 1 - \\prod_{t}^{}y_{i}^{t} \\right)}$\n", + "\n", + "Following , one obtains\n", + "\n", + "Eq. \u2011\n", + "$\\frac{\\partial\\mu_{em}}{\\partial N_{em}} = \\sum_{u}^{}{\\frac{\\partial\\left( \\sum_{t}^{}a^{t}\\mu_{i}^{t} \\right)}{\\partial y_{j}^{u}}\\frac{\\partial y_{j}^{u}}{\\partial N_{em}}} = \\frac{\\left( 1 - \\prod_{t}^{}y_{j}^{t} \\right)}{N\\prod_{t}^{}y_{j}^{t}}\\sum_{u}^{}{a^{u}y_{i}^{u}\\frac{\\partial\\mu_{i}^{u}}{\\partial y_{i}^{u}}} = \\frac{\\left( 1 - \\prod_{t}^{}y_{j}^{t} \\right)}{N\\prod_{t}^{}y_{j}^{t}}\\sum_{u}^{}{a^{u}y_{i}^{u}\\left\\{ \\frac{RT\\left( 1 - y_{i}^{u} \\right)}{y_{i}^{u}} - 2\\sum_{j \\neq i}^{}\\left( y_{j}^{u} \\right)^{2}L_{i,j}^{u} - 2\\sum_{k > j}^{}{\\sum_{j \\neq i}^{}{y_{j}^{u}y_{k}^{u}\\left\\lbrack L_{i,j}^{u} + L_{i,k}^{u} - L_{j,k}^{u} + \\left( 2 - 3y_{i}^{u} \\right)L_{i,j,k}^{u} \\right\\rbrack}} \\right\\}}$\n", + "\n", + "It is self-evident from that a site fraction is only uniquely defined\n", + "from the mole fraction of the component when the component enters into\n", + "one sublattice only and does not form any associates. Therefore, in\n", + "general, the distribution of components on sublattices and different\n", + "kinds of molecules can only be obtained by equilibrium calculations, and\n", + "the thermodynamic properties for such a phase can thus not be\n", + "represented in a closed form using mole fractions of independent\n", + "components. This was demonstrated in Chapter when short-range ordering\n", + "exists in solution phases, where the energy minimization procedure was\n", + "used to obtain the distribution of components on different kinds of\n", + "bonds and the amounts of individual associates.\n" + ], + "metadata": {} + }, + { + "id": "31d4168e", + "cell_type": "markdown", + "source": [ + "### Solutions with both short-range and long-range ordering\n", + "\n", + "The short-range ordering in a solution with long-rang ordering can take\n", + "place in each sublattice or between two sublattices. The short-range\n", + "ordering in one sublattice can be treated similarly as in Chapter 2.3.1\n", + "with mole fractions substituted by site fractions. In case that\n", + "associates form, the relation between mole fractions and site fractions\n", + "becomes more complicated as follows\n", + "\n", + "Eq. \u2011\n", + "$x_{i} = \\frac{\\sum_{}^{}{a^{t}\\sum_{k}^{}{i_{k}y}_{k}^{t}}}{\\sum_{}^{}{a^{t}\\left( 1 - y_{va}^{t} \\right)}}$\n", + "\n", + "where the summation for $k$ goes over all associates in sublattice $t$\n", + "containing component $i$.\n", + "\n", + "The short-range ordering between two-sublattices indicates that a\n", + "component in one sublattice has different interactions with different\n", + "components in another sublattice. This results in local ordering of one\n", + "component around another component in two neighboring sublattices. Such\n", + "local ordering involves interactions between two sublattices shown as\n", + "the third term in .\n" + ], + "metadata": {} + }, + { + "id": "bb96bbcc", + "cell_type": "markdown", + "source": [ + "### Solutions with charged species\n", + "\n", + "One special type of solutions with both short-range and long-range\n", + "ordering is solutions with charged species, i.e. ionic solutions, plus\n", + "electrons and holes. There is an additional constraint on species\n", + "concentrations to maintain the charge neutrality of such solutions, i.e.\n", + "\n", + "Eq. \u2011 $0 = \\sum_{t}^{}{\\sum_{i}^{}{a^{t}y_{i}^{t}v_{i}^{t}}}$\n", + "\n", + "where $v_{i}^{t}$ is the valance of species $i$ in sublattice $t$\n", + "including its sign which is positive for cations, negative for anions,\n", + "and zero for neutral species. The conventional defect chemistry theory\n", + "is typically based on the ideal mass action laws and applicable to a\n", + "single set of defects and at very low defect concentrations, i.e. in the\n", + "limit of ideal solutions. For interacting defects, their concentrations\n", + "should be replaced by their activities, which can be obtained from\n", + "thermodynamic principles similarly as discussed in previous sections. It\n", + "should be emphasized that in addition to formation of many more charged\n", + "species, one component may have different valences, particularly the\n", + "transition metals. Consequently, there can be many more species in an\n", + "ionic phase than the number of independent components in the system, and\n", + "their concentrations can be found by equilibrium calculations as\n", + "discussed in Chapter .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/gibbs_energy_function/polymer_solutions_and_polymer_blends.ipynb b/src/psu410/src/psu410/gibbs_energy_function/polymer_solutions_and_polymer_blends.ipynb new file mode 100644 index 0000000..450ad26 --- /dev/null +++ b/src/psu410/src/psu410/gibbs_energy_function/polymer_solutions_and_polymer_blends.ipynb @@ -0,0 +1,82 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "5dc6e2f1", + "cell_type": "markdown", + "source": [ + "## Polymer solutions and polymer blends\n", + "\n", + "A polymer solution is a mixture between polymer molecules and solvents,\n", + "while a polymer blend is a mixture between different polymer molecules.\n", + "A polymer molecule consists of the same repeating units of one or more\n", + "monomers, which can be an atom or a small molecule. The number of\n", + "repeating units is called the degree of polymerization and can be as\n", + "large as 104\u2013105. It defines the molecular mass,\n", + "i.e. the mass of one polymer molecule. There are three typical\n", + "architectures of polymerization: a linear chain, a branched chain, and a\n", + "cross-linked polymer. Nearly all polymers are mixtures of molecules with\n", + "a different degree of polymerization with a molecular mass distribution,\n", + "complicating the modeling of their thermodynamic properties because of\n", + "the dependence of properties on molecular mass.\n", + "\n", + "Gibbs energy functions of polymers with a single molecular mass can be\n", + "treated similarly as in Chapter . For a polymer solution, the ideal\n", + "entropy of mixing is quite different from that of atomically random\n", + "solutions discussed in Chapter because the monomers in a polymer\n", + "molecule are connected to each other and cannot move freely. One common\n", + "approach to calculate the ideal entropy of mixing is to evoke a lattice\n", + "model and assume that one monomer occupies a lattice site with a fixed\n", + "volume. The number of translational states of a single molecule is equal\n", + "to the number of lattice sites available. In a homogeneous solution, the\n", + "total number of lattice sites available is\n", + "\n", + "Eq. \u2011 $n = \\sum_{i}^{}{m_{i}n_{i}}$\n", + "\n", + "where $n_{i}$ and $m_{i}$ are the number of molecule $i$ and the number\n", + "of lattice sites per molecule $i$, respectively. While in its pure\n", + "state, i.e. before mixing, the number of states of molecule $i$ in terms\n", + "of the number of lattice sites is\n", + "\n", + "Eq. \u2011 $w_{i} = m_{i}n_{i} = n\\varphi_{i}$\n", + "\n", + "where $\\varphi_{i}$ is the volume fraction of molecule $i$ in the\n", + "solution. The entropy change per molecule $i$ is thus\n", + "\n", + "Eq. \u2011\n", + "$S_{i} = kln(n) - klnw_{i} = kln\\frac{1}{\\varphi_{i}} = - kln\\varphi_{i}$\n", + "\n", + "The total entropy of mixing is the summation for all molecules,\n", + "normalized to per mole of lattice site\n", + "\n", + "Eq. \u2011\n", + "$_{}^{I}S_{m} = \\frac{N_{a}}{n}\\sum_{i}^{}{n_{i}S_{i}} = - R\\sum_{i}^{}{\\frac{\\varphi_{i}}{m_{i}}\\ln\\varphi_{i}}$\n", + "\n", + "where $N_{a}$ is the Avogadro number. When $m_{i} = 1$ for all\n", + "molecules, Eq. 2\u2011143 reduces to . Since $m_{i}$ values are typically\n", + "very large numbers for polymers, the entropy of mixing in polymer\n", + "solutions and blends is thus significantly lower than those in\n", + "non-polymer solutions as shown schematically in for binary systems with\n", + "various $m_{i}$ values.\n", + "\n", + "Figure \u2011: Schematic entropy of mixing in solutions with the numbers of\n", + "lattice sites per molecule shown.\n", + "\n", + "Similar to , Gibbs energy of a multi-component random polymer\n", + "solution/blend can be written as\n", + "\n", + "Eq. \u2011\n", + "$G_{m} = \\sum_{}^{}\\frac{\\varphi_{i}}{m_{i}}_{\\ }^{0}G_{im} + RT\\left( \\sum_{}^{}{\\frac{\\varphi_{i}}{m_{i}}\\ln\\varphi_{i}} + \\sum_{}^{}{\\varphi_{i}\\varphi_{j}\\chi_{ij}} \\right)$\n", + "\n", + "where $_{\\ }^{0}G_{im}$ is the Gibbs energy of molecular $i$ per mole of\n", + "lattice site, and $\\chi_{ij}$ the unitless interaction parameter between\n", + "molecule $i$ and $j$. Other equations shown in Chapter can be derived\n", + "similarly too. It is to be noted that is very similar to the\n", + "Flory\u2013Huggins solution equation widely used in the polymer community.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/laws_of_thermodynamics/combined_law_of_thermodynamics_and_equilibrium_conditions.ipynb b/src/psu410/src/psu410/laws_of_thermodynamics/combined_law_of_thermodynamics_and_equilibrium_conditions.ipynb new file mode 100644 index 0000000..411cc3d --- /dev/null +++ b/src/psu410/src/psu410/laws_of_thermodynamics/combined_law_of_thermodynamics_and_equilibrium_conditions.ipynb @@ -0,0 +1,229 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "a75b942c", + "cell_type": "markdown", + "source": [ + "## Combined law of thermodynamics and equilibrium conditions\n", + "\n", + "For a system with an irreversible internal process taking place, the\n", + "entropy change in the system thus consists of three parts: the heat\n", + "exchange with the surrounding defined by , the entropy production due to\n", + "the internal process represented by , and the entropy of mass exchange\n", + "with the surrounding. The total entropy change of the system can thus be\n", + "written as follows\n", + "\n", + "Eq. \u2011 $dS = \\frac{dQ}{T} + d_{ip}S + \\sum_{}^{}{S_{i}dN_{i}}$\n", + "\n", + "where $S_{i}$ is the unit entropy of component *i* in the surroundings,\n", + "often called partial entropy of component *i*, and will be further\n", + "discussed in Chapter\n", + "\n", + "Combining and and re-arranging, one obtains\n", + "\n", + "Eq. \u2011 $dQ = TdS - Dd\\xi - \\sum_{}^{}{TS_{i}dN_{i}}$\n", + "\n", + "Inserting and into yields the combined law of thermodynamics from the\n", + "first and second laws of thermodynamics,\n", + "\n", + "Eq. \u2011\n", + "$dU = TdS - PdV + \\sum_{}^{}\\left( H_{i} - TS_{i} \\right){dN}_{i} - Dd\\xi$\n", + "\n", + "The internal energy of the system is thus a function of *S*, *V*,\n", + "*Ni* and *\u03be* of the system, which are called natural\n", + "variables of the internal energy, i.e. *U*(*S*,*V*,*Ni*,*\u03be*).\n", + "The other variables are dependent variables and can be represented by\n", + "partial derivatives of the internal energy with respect to their\n", + "respective natural variables with other natural variables kept constant\n", + "as shown below\n", + "\n", + "Eq. \u2011\n", + "$T = \\left( \\frac{\\partial U}{\\partial S} \\right)_{V,\\ N_{i},\\ \\xi}$\n", + "\n", + "Eq. \u2011\n", + "$- P = \\left( \\frac{\\partial U}{\\partial V} \\right)_{S,\\ N_{i},\\ \\xi}$\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i} = H_{i} - TS_{i} = \\left( \\frac{\\partial U}{\\partial N_{i}} \\right)_{S,\\ V,N_{j \\neq i},\\ \\xi} = U_{i}$\n", + "\n", + "Eq. \u2011\n", + "$- D = \\left( \\frac{\\partial U}{\\partial\\xi} \\right)_{S,\\ V,N_{i}\\ }$\n", + "\n", + "In , a new variable, $\\mu_{i}$, is introduced. It is called chemical\n", + "potential and defined as the internal energy change with respect of the\n", + "addition of the component *i* when the entropy, volume and the amount of\n", + "other components of the system are kept constant. It may be worth\n", + "pointing out that for a system at equilibrium, i.e. $d_{ip}S = 0$, and\n", + "with constant entropy, $dS = 0$, if it exchanges mass with the\n", + "surroundings, $dN_{i} \\neq 0$, the system must also exchange heat with\n", + "the surroundings at the same time in order to keep the entropy invariant\n", + "as demonstrated by .\n", + "\n", + "The pairs of the natural variables and their corresponding partial\n", + "derivatives are called conjugate variables, i.e. *S* and *T*, *V* and\n", + "*\u2013P*, *Ni* and $\\mu_{i}$, and *\u03be* and *\u2013D*. There are minus\n", + "sign in front of *P* and *D* as the increase of volume and the progress\n", + "of the internal process decrease the internal energy of the system. The\n", + "importance of this conjugate relation will be evident when various forms\n", + "of combined thermodynamic laws and various types of phase diagrams are\n", + "introduced in the book.\n", + "\n", + "The last pair of conjugate variables, *\u03be* and *\u2013D*, is worthy of further\n", + "discussion. Based on the second law of thermodynamics, i.e. , no\n", + "internal processes take place spontaneously if there is no entropy\n", + "productions, i.e. D\u22640 or *d\u03be*=0 and *D*\\>0. With D\u22640, there is no\n", + "driving for any internal processes, and the system is at a full\n", + "equilibrium state. The last term in drops off, and *\u03be* becomes a\n", + "dependent variable of the system and can be calculated from the\n", + "equilibrium conditions. With *d\u03be*=0 and *D*\\>0, the system is under a\n", + "constrained equilibrium or freezing-in condition when the internal\n", + "process is constrained not to take place, and *\u03be* remains to be an\n", + "independent variable of the system.\n", + "\n", + "These two cases represent the two branches of thermodynamics:\n", + "equilibrium, reversible thermodynamics and irreversible thermodynamics.\n", + "It is clear from the above discussions that these two branches are\n", + "identical if the internal energy is not only a function of *S*, *V*, and\n", + "*Ni* , but also any internal process variable *\u03be*. This means\n", + "that one should be able to evaluate the internal energy of a system for\n", + "any freezing-in equilibrium conditions in addition to the full\n", + "equilibrium condition. In the rest of the book, the freezing-in\n", + "equilibrium and full equilibrium are not differentiated unless\n", + "specified.\n", + "\n", + "As the mechanical work under hydrostatic pressure is very important in\n", + "experiments, let us define a new quantity called enthalpy as follows\n", + "\n", + "Eq. \u2011 $H = U + PV$\n", + "\n", + "Its differential form can be obtained from as\n", + "\n", + "Eq. \u2011 $dH = dU + d(PV) = dQ + VdP + \\sum_{}^{}H_{i}{dN}_{i}$\n", + "\n", + "There are two significant consequences of the above equation. First, for\n", + "a close system under constant pressure, i.e. ${dN}_{i} = dP = 0$, one\n", + "has $dH = dQ$. This implies that the enthalpy change in a system is\n", + "equal to the heat exchange between the system and the surrounding of the\n", + "system, which is why enthalpy and heat are often exchangeable in the\n", + "literature. Second, for an adiabatic system under constant pressure,\n", + "i.e. $dQ = dP = 0$, can be re-arranged to the following equation\n", + "\n", + "Eq. \u2011\n", + "$H_{i} = \\left( \\frac{\\partial H}{\\partial N_{i}} \\right)_{N_{j \\neq i,\\ \\ dQ = dP = 0}}$\n", + "\n", + "$H_{i}$ is thus the partial enthalpy of component *i* and will be\n", + "further discussed in Chapter . The chemical potential of component *i*\n", + "defined in is thus related to the partial enthalpy and partial entropy\n", + "of the component.\n", + "\n", + "To further define equilibrium conditions of a system, consider a\n", + "homogeneous system in a state of internal equilibrium, i.e. no\n", + "spontaneous internal processes are possible with $Dd\\xi = 0$, and\n", + "becomes\n", + "\n", + "Eq. \u2011\n", + "$dU = TdS - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} = \\sum_{}^{}{Y_{i}dX_{i}}$\n", + "\n", + "where *X* represents *S*, *V*, *Ni*, and *Y* their conjugate\n", + "variables *T*, *-P*, $\\mu_{i}$. The state of the system with *c*\n", + "independent components is completely determined by the *c+2* variables,\n", + "i.e. *S*, *V*, and *Ni* with *i* from 1 to *c*.\n", + "\n", + "To simplify the situation, let us limit the discussion to an isolated\n", + "equilibrium system, i.e. $dU = 0$, and conduct a virtual internal\n", + "experiment inside the system by moving an infinitesimal amount of\n", + "$X_{i}$, ${dX}_{i}$, with other $X_{j}$ kept constant, from one region\n", + "of the system to another region of the system as schematically shown in\n", + ".\n", + "\n", + "Figure \u2011: Virtual experiment for a system at equilibrium\n", + "\n", + "As the system is homogeneous and at equilibrium,\n", + "$- dX_{i}^{'} = dX_{i}^{\"} = dX_{i}$. The total change of the internal\n", + "energy of this internal process is the combination of the changes in the\n", + "two regions, i.e.\n", + "\n", + "Eq. \u2011\n", + "$dU = dU^{'} + dU^{\"} = Y_{i}^{'}dX_{i}^{'} + Y_{i}^{\"}dX_{i}^{\"} = \\left( - Y_{i}^{'} + Y_{i}^{\"} \\right)dX_{i} = 0$\n", + "\n", + "Therefore, $Y_{i}^{'} = Y_{i}^{\"}$ for *T*, *-P*, and $\\mu_{i}$,\n", + "indicating that *T*, *-P*, and $\\mu_{i}$ are homogeneous in the system,\n", + "respectively, and are thus named as potentials of the system.\n", + "Furthermore these potentials are independent of the size of the system\n", + "and are often referred to as intensive variables in the literature. On\n", + "the other hand, all *X:s*, i.e. *S*, *V*, and *Ni*, are\n", + "proportional to the size of the system and may be normalized with\n", + "respect to the size of the system, usually in terms of total moles,\n", + "\n", + "Eq. \u2011 $N = \\sum_{}^{}N_{i}$\n", + "\n", + "They are thus called molar quantities and often referred to as extensive\n", + "variables, and the respective normalized variables are molar entropy,\n", + "molar volume, and mole fractions, defined as follows\n", + "\n", + "Eq. \u2011 $S_{m} = \\frac{S}{N}$\n", + "\n", + "Eq. \u2011 $V_{m} = \\frac{V}{N}$\n", + "\n", + "Eq. \u2011 $x_{i} = \\frac{N_{i}}{N}$\n", + "\n", + "Consider a small subsystem in this homogeneous system at equilibrium and\n", + "let the subsystem grow in size. The entropy, volume, and mass enclosed\n", + "in the subsystem increase as follows\n", + "\n", + "Eq. \u2011 ${dS = S}_{m}dN$\n", + "\n", + "Eq. \u2011 $dV = V_{m}dN$\n", + "\n", + "Eq. \u2011 $dN_{i} = x_{i}dN$\n", + "\n", + "The corresponding change in the internal energy of the subsystem becomes\n", + "\n", + "Eq. \u2011\n", + "$dU = TdS - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} = \\left( TS_{m} - PV_{m} + \\sum_{}^{}\\mu_{i}x_{i} \\right)dN = U_{m}dN$\n", + "\n", + "By integration one obtains the integral form of the internal energy as\n", + "\n", + "Eq. \u2011\n", + "$U = TS - PV + \\sum_{}^{}\\mu_{i}N_{i} = \\left( TS_{m} - PV_{m} + \\sum_{}^{}\\mu_{i}x_{i} \\right)N = U_{m}N$\n", + "\n", + "Similarly, the molar enthalpy can be defined as follows\n", + "\n", + "Eq. \u2011\n", + "$H = U + PV = U_{m}N + PV_{m}N = \\left( U_{m} + PV_{m} \\right)N = H_{m}N$\n", + "\n", + "In case a potential is not homogeneous in a system, the system will not\n", + "be in a state of equilibrium. Let us consider the same virtual\n", + "experiment as shown in for an isolated system that is not in\n", + "equilibrium, i.e. by moving an infinitesimal amount of $X_{i}$,\n", + "${dX}_{i}$, with other $X_{j}$ kept constant, from one region of the\n", + "system to another region of the system with the two regions having\n", + "different potentials. The total internal energy change equals to zero as\n", + "the virtual experiment has $dU = 0$. Similarly, each region can be\n", + "considered to be homogeneous by itself, and one has\n", + "$- dX_{i}^{'} = dX_{i}^{\"} = dX_{i}$. The total internal energy change\n", + "in the system is thus the sum of these two regions plus the entropy\n", + "production due to the internal process with $d\\xi = dX_{i}$, i.e.\n", + "\n", + "Eq. \u2011\n", + "$dU = dU^{'} + dU^{\"} + Dd\\xi = Y_{i}^{'}dX_{i}^{'} + Y_{i}^{\"}dX_{i}^{\"} + Dd\\xi = \\left( - Y_{i}^{'} + Y_{i}^{\"} \\right)dX_{i} + Dd\\xi = 0$\n", + "\n", + "Consequently, one obtains the following\n", + "\n", + "*Eq. 1\u201131* $D = Y_{i}^{'} - Y_{i}^{\"}$\n", + "\n", + "The driving force thus represents the difference of the potential at the\n", + "two regions, and the internal process is to eliminate inhomogeneity of\n", + "the potential with the heat transfer from high temperature regions to\n", + "low temperature regions, volume shrink of low pressure regions (high\n", + "$\u2013P$) and volume expansion of high pressure regions (low $\u2013P$), and\n", + "transport of components from high chemical potential regions to low\n", + "chemical potential regions.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/laws_of_thermodynamics/first_and_second_laws_of_thermodynamics.ipynb b/src/psu410/src/psu410/laws_of_thermodynamics/first_and_second_laws_of_thermodynamics.ipynb new file mode 100644 index 0000000..436bf7f --- /dev/null +++ b/src/psu410/src/psu410/laws_of_thermodynamics/first_and_second_laws_of_thermodynamics.ipynb @@ -0,0 +1,128 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "b09c8a86", + "cell_type": "markdown", + "source": [ + "## First and second laws of thermodynamics\n", + "\n", + "A system typically consists of many chemical components. The first law\n", + "of thermodynamics states that the exchanges of heat, work, and\n", + "individual components with its surroundings must obey the law of\n", + "conversation of energy. In the domain of materials science and\n", + "engineering, the energy of interest is at the atomic and molecular\n", + "levels. The energy at the higher and lower levels such as nuclear energy\n", + "and kinetic and potential energies of a rigid body are usually excluded\n", + "from the discussion of thermodynamics of materials.\n", + "\n", + "Let us consider a system receiving an amount of heat, *dQ*, and an\n", + "amount of work, *dW*, and an amount of each independent component *i*,\n", + "*dNi*, from the surroundings. Such a system is called an open\n", + "system in contrast to a closed system when *dNi*=0 for all\n", + "components, i.e. no exchange of mass between the system and the\n", + "surrounding. Other types of systems commonly defined in thermodynamics\n", + "include adiabatic systems without exchange of heat, i.e. *dQ*=0, and\n", + "isolated systems without exchange of any, i.e. *dQ*= *dW*=\n", + "*dNi*=0.\n", + "\n", + "The corresponding change of energy in the system, i.e. the internal\n", + "energy change, *dU*, is formulated in terms of the first law of\n", + "thermodynamics as follows,\n", + "\n", + "Eq. \u2011 $dU = dQ + dW + \\sum_{}^{}{H_{i}dN_{i}}$\n", + "\n", + "where $H_{i}$ is the unit energy of component *i* in the surroundings,\n", + "and the summation is for all components in the system, which can be\n", + "controlled independently from the surroundings, i.e. the independent\n", + "components of the system.\n", + "\n", + "It is self-evident that the left-hand side of refers to the change\n", + "inside the system, while its right-hand side is for the contributions\n", + "from the surroundings to the system. In principle, no matter how the\n", + "heat and mass are added, or how the work is done to the system, as far\n", + "as their summation is the same, the change of the internal energy will\n", + "be the same based on the first law of thermodynamics, indicating that\n", + "the system reaches the same state for a closed system. The internal\n", + "energy is thus a state function in a close system as it does not depend\n", + "on how the state is reached.\n", + "\n", + "On the other hand, for the purpose of easy mathematical treatment, a\n", + "reversible process can be considered for a closed system, in which the\n", + "initial state of the system can be restored reversibly without any\n", + "changes left to the surroundings. Therefore, the heat transferred and\n", + "the work done to the system are identical to the heat and work lost by\n", + "the surroundings and vice versa. The classic example of reversible\n", + "processes is the Carnot\u2019s cycle, which is shown in . It consists of four\n", + "reversible processes for a closed system. The four reversible processes\n", + "are compression at constant temperature *T1* (isothermal,),\n", + "compression without heat exchange (adiabatic) ending at *T2*,\n", + "isothermal expansion at *T2*, and adiabatic expansion ending\n", + "at *T1*.\n", + "\n", + "Figure \u2011: Schematics of the Carnot\u2019s cycle\n", + "\n", + "The Carnot\u2019s cycle involves a simple type of mechanical work, either\n", + "hydrostatic expansion or compression, with the work that the surrounding\n", + "does to the system represented by\n", + "\n", + "Eq. \u2011 $dW = - PdV$\n", + "\n", + "with *P* being the external pressure that the surrounding exerts on the\n", + "system and *V* the volume of the system. It is now necessary to\n", + "differentiate the external and internal variables for further discussion\n", + "with the former representing variables in the surroundings and the\n", + "latter representing variables in the system. For the isothermal\n", + "processes in the Carnot\u2019s cycle, the entropy change of the system, *dS*,\n", + "can be defined as the heat exchange divided by temperature\n", + "\n", + "Eq. \u2011 $dS = \\frac{dQ}{T}$\n", + "\n", + "In addition to processes involving heat, work, and mass exchanges\n", + "between the system and the surroundings, there could be internal\n", + "processes taking place inside the system. As the system cannot do work\n", + "to itself, the criterion for whether an internal process can occur\n", + "spontaneously must be related to the heat exchange, which is related to\n", + "the entropy change as shown by .\n", + "\n", + "It is a known fact that heat can spontaneously transfer from a higher\n", + "temperature (*T2*) region to a lower temperature\n", + "(*T1*) region inside a system if the heat conduction is\n", + "allowed, and this process is irreversible because heat cannot be\n", + "conducted from a low temperature region to a high temperature region by\n", + "itself. indicates that for the same amount of heat change, the entropy\n", + "change at *T1* is higher than that at *T2*, and\n", + "the heat conduction thus results in a positive entropy change in the\n", + "system, i.e.\n", + "\n", + "Eq. \u2011\n", + "$\\mathrm{\\Delta}S = - \\frac{dQ}{T_{2}} + \\frac{dQ}{T_{1}} = \\frac{dQ}{{T_{2}T}_{1}}\\left( {T_{2} - T}_{1} \\right) > 0$\n", + "\n", + "Consequently, the second law of thermodynamics is obtained, which states\n", + "that for an internal process to take place spontaneously or\n", + "irreversibly, this internal process (*ip*) must have a positive entropy\n", + "production, which can be written in a differential form as follows\n", + "\n", + "Eq. \u2011 $d_{ip}S > 0$\n", + "\n", + "From the definition of entropy change shown by , the amount of heat\n", + "produced by this irreversible internal process can be calculated as\n", + "follows\n", + "\n", + "Eq. \u2011 $d_{ip}Q = Td_{ip}S$\n", + "\n", + "Let us represent this internal process by *d\u03be* and define the driving\n", + "force for this internal process by *D*. The work done by this internal\n", + "process is thus *Dd\u03be*, which is released as heat, i.e.\n", + "\n", + "Eq. \u2011 $Dd\\xi = d_{ip}Q = Td_{ip}S$\n", + "\n", + "An irreversible process thus must have a positive driving force in order\n", + "for it to take place spontaneously.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/laws_of_thermodynamics/gibbsduhem_equation.ipynb b/src/psu410/src/psu410/laws_of_thermodynamics/gibbsduhem_equation.ipynb new file mode 100644 index 0000000..923eaac --- /dev/null +++ b/src/psu410/src/psu410/laws_of_thermodynamics/gibbsduhem_equation.ipynb @@ -0,0 +1,91 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "aceb69c3", + "cell_type": "markdown", + "source": [ + "## Gibbs-Duhem equation\n", + "\n", + "In experiments, it is difficult to control *S* and *V* of a system in\n", + "comparison with their conjugate variables *T* and *-P*. It is thus\n", + "desirable to construct new functions to represent the system with *T*\n", + "and *-P* as natural variables of the functions. One of them is enthalpy\n", + "defined in , and other two can be defined as follows\n", + "\n", + "Eq. \u2011 $F = U - TS$\n", + "\n", + "Eq. \u2011 $G = U - TS + PV = \\sum_{}^{}\\mu_{i}N_{i} = H - TS = F + PV$\n", + "\n", + "with *F* and *G* called Helmholtz energy and Gibbs energy, respectively.\n", + "The middle part of is obtained using $U$ from . The corresponding\n", + "combined law of thermodynamics in terms of *H*, *F*, and *G* can be\n", + "obtained through the Legendre transformation of as\n", + "\n", + "Eq. \u2011 $dH = TdS - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", + "\n", + "Eq. \u2011 $dF = - SdT - PdV + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", + "\n", + "Eq. \u2011 $dG = - SdT - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", + "\n", + "The independent variables in each of the above form are regarded as the\n", + "natural variables to the corresponding function. The integral forms of\n", + "all the functions can thus be written as the following with their\n", + "natural variables listed in the parenthesis\n", + "\n", + "Eq. \u2011 $U = U\\left( S,V,N_{i},\\xi \\right)$\n", + "\n", + "Eq. \u2011 $H = H\\left( S, - P,N_{i},\\xi \\right)$\n", + "\n", + "Eq. \u2011 $F = F\\left( T,V,N_{i},\\xi \\right)$\n", + "\n", + "Eq. \u2011 $G = G\\left( T, - P,N_{i},\\xi \\right)$\n", + "\n", + "By differentiating , one obtains\n", + "\n", + "Eq. \u2011\n", + "$dG = \\sum_{}^{}\\mu_{i}{dN}_{i} + \\sum_{}^{}{N_{i}d\\mu}_{i} = - SdT - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi$\n", + "\n", + "For a system at equilibrium, $Dd\\xi = 0$, re-arranging gives the\n", + "Gibbs-Duhem equation\n", + "\n", + "Eq. \u2011 $0 = - SdT - Vd( - P) - \\sum_{}^{}{N_{i}d\\mu}_{i}$\n", + "\n", + "This equation indicates that for a homogeneous system with *c*\n", + "independent components at equilibrium, there is a direct relation among\n", + "all the *c+2* potentials, and they are $c$ chemical potentials\n", + "($\\mu_{i}$), temperature, and pressure. Consequently, only *c+1*\n", + "potentials can change independently, and the remaining potential is\n", + "dependent on the other potentials. As discussed in connection with ,\n", + "there are $c + 2$ independent variables for an equilibrium system with\n", + "*c* independent components, where all of them are molar quantities.\n", + "\n", + "With the relationships between potentials and molar quantities defined\n", + "by to , one can switch between potentials and molar quantities as\n", + "natural variables of the system. For example, one can define a new free\n", + "energy function when the chemical potential of one component is\n", + "controlled from the surroundings instead of its content and obtain the\n", + "following combined first and second law of thermodynamics\n", + "\n", + "Eq. \u2011 $\\Phi = G - \\mu_{1}N_{1} = \\sum_{i = 2}^{c}{\\mu_{i}N_{i}}$\n", + "\n", + "Eq. \u2011\n", + "$d\\Phi = - SdT - Vd( - P) - N_{1}{d\\mu}_{1} + \\sum_{i = 2}^{c}{\\mu_{i}{dN}_{i}} - Dd\\xi$\n", + "\n", + "However, even though the $c + 2$ molar quantities are independent of\n", + "each other, indicates that not all the $c + 2$ potentials are\n", + "independent, i.e., if chemical potentials of all components are changed\n", + "to natural variables, one would obtain . Therefore, among the *c+2*\n", + "independent variables used to define the system, the maximum number of\n", + "independent potential is *c+1*, and at least one of the *c+2*\n", + "independent variables must be a molar quantity. This variable is usually\n", + "chosen to be the size of the system or the major element in the system.\n", + "The Gibbs-Duhem equation is used to derive Gibbs phase rule in\n", + "heterogeneous systems, which is discussed in Chapter of the book.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/laws_of_thermodynamics/index.ipynb b/src/psu410/src/psu410/laws_of_thermodynamics/index.ipynb new file mode 100644 index 0000000..8068dc8 --- /dev/null +++ b/src/psu410/src/psu410/laws_of_thermodynamics/index.ipynb @@ -0,0 +1,15 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "2bb2daa7", + "cell_type": "markdown", + "source": [ + "# Laws of thermodynamics\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/laws_of_thermodynamics/stability_at_equilibrium_and_property_anomaly.ipynb b/src/psu410/src/psu410/laws_of_thermodynamics/stability_at_equilibrium_and_property_anomaly.ipynb new file mode 100644 index 0000000..d35cf1a --- /dev/null +++ b/src/psu410/src/psu410/laws_of_thermodynamics/stability_at_equilibrium_and_property_anomaly.ipynb @@ -0,0 +1,192 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "9ccd12f0", + "cell_type": "markdown", + "source": [ + "## Stability at equilibrium and property anomaly\n", + "\n", + "As shown by , potentials are homogenous for a homogeneous system in a\n", + "state of internal equilibrium. To study the stability of the equilibrium\n", + "state, one considers the entropy production due to a fluctuation of a\n", + "molar quantity as an internal process. Based on the second law of\n", + "thermodynamics, the driving force, as the first derivative of the\n", + "entropy production with respect to the internal process, is zero for\n", + "such a fluctuation at equilibrium, i.e. *D*=0, and the entropy of\n", + "production thus depends on the second derivative. It can be written as\n", + "follows\n", + "\n", + "Eq. \u2011\n", + "$Td_{ip}S = \\frac{\\partial_{ip}S}{\\partial\\xi}d\\xi + \\frac{1}{2}{\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}(d\\xi)}^{2} = Dd\\xi - \\frac{1}{2}D_{2}(d\\xi)^{2}$\n", + "\n", + "with $D_{2} = - \\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}$. When\n", + "$\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}} < 0$ or $D_{2} > 0$ along\n", + "with $D = 0$, the fluctuation does not produce positive entropy of\n", + "production and can thus not develop further. The equilibrium state of\n", + "the system is therefore stable against the fluctuation. On the other\n", + "hand, when $\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}} > 0$ or\n", + "$D_{2} < 0$ along with $D = 0$, the fluctuation creates positive entropy\n", + "of production and can continue to grow. The equilibrium state of the\n", + "system is therefore unstable against the fluctuation. In connection with\n", + ", one can realize that for a system at stable equilibrium without heat\n", + "and mass exchanges with the surroundings, its entropy is at its maximum,\n", + "and there are no other internal processes, which could produce any more\n", + "entropy. This is schematically shown in .\n", + "\n", + "Figure \u2011: Schematic diagram showing maximum entropy\n", + "\n", + "Using , , and , the combined law of thermodynamics can be written as\n", + "\n", + "*Eq. 1\u201133*\n", + "$dU = \\sum_{}^{}{Y_{i}dX_{i}} - Dd\\xi + \\frac{1}{2}D_{2}(d\\xi)^{2}$\n", + "\n", + "Let us carry out the same virtual internal experiment shown in Chapter ,\n", + "i.e. moving an infinitesimal amount of *Xi* in a homogenous\n", + "system with other $X_{j}$ kept constant in an isolated system, i.e.\n", + "$dU = 0$ and $D = 0$. The internal energy change due to this internal\n", + "process is\n", + "\n", + "Eq. \u2011\n", + "$dU = \\frac{1}{2}D_{2}\\left\\{ \\left( dX_{i}^{'} \\right)^{2} + \\left( dX_{i}^{\"} \\right)^{2} \\right\\}$\n", + "\n", + "For a homogeneous system in a state of stable equilibrium with\n", + "$\\left( dX_{i}^{'} \\right)^{2} = \\left( dX_{i}^{\"} \\right)^{2} = \\left( dX_{i} \\right)^{2}$,\n", + "this internal process must result in an increase of internal energy,\n", + "$dU > 0$, and thus gives\n", + "\n", + "Eq. \u2011\n", + "$D_{2} = 2\\left( \\frac{\\partial^{2}U}{\\partial\\left( X_{i} \\right)^{2}} \\right)_{X_{j}} = 2\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} > 0$\n", + "\n", + "shows that for a system to be stable, any pair of conjugate variables\n", + "must change in the same direction when other independent molar\n", + "quantities are kept constant. For the conjugate variables discussed so\n", + "far, it means that for a stable system, the addition of entropy\n", + "increases temperature with $\\frac{\\partial T}{\\partial S}$\\>0, the\n", + "volume decreases with pressure or increases with the negative of\n", + "pressure with $\\frac{\\partial( - P)}{\\partial V} > 0$, and the chemical\n", + "potential of a component increases with its amount, i.e.\n", + "$\\frac{\\partial\\mu_{i}}{\\partial N_{i}} > 0$, where the derivatives are\n", + "taken with all other molar quantities kept constant. The limit of\n", + "stability is reached when becomes zero, i.e.\n", + "\n", + "Eq. \u2011\n", + "$D_{2} = 2\\left( \\frac{\\partial Y_{i}}{\\partial X_{i}} \\right)_{X_{j}} = 0$\n", + "\n", + "shows schematically the energy as a function of configurations including\n", + "three states: unstable, stable, and metastable. Both the stable and\n", + "metastable states have positive curvatures due to $D_{2} > 0$, while the\n", + "unstable state has a negative curvature due to $D_{2} < 0$. There is an\n", + "inflection point of $D_{2} = 0$ for a state between a stable or\n", + "metastable state with $D_{2} > 0$ and an unstable state with\n", + "$D_{2} < 0$. These two inflection points, called spinodal, represent the\n", + "limit of stability. The states between the two inflection points are\n", + "unstable, and other states are either stable or metastable. The two\n", + "inflection points can move apart from or close to each other depending\n", + "on the change of external conditions, i.e. the natural variables. One\n", + "extreme situation is when these two inflection points merge into one\n", + "point, and the instability occurs only at this particular point. It is\n", + "evident that all three states, stable, metastable, and unstable, also\n", + "merge into one point. This point is called critical or consolute point,\n", + "beyond which the instability no longer exists.\n", + "\n", + "Figure \u2011: Schematic diagram showing the stable and unstable equilibrium\n", + "states\n", + "\n", + "To mathematically define the consolute point, the third derivative needs\n", + "to be added to because both $D$ and $D_{2}$ vanish at this point, i.e.\n", + "\n", + "Eq. \u2011\n", + "$Td_{ip}S = \\frac{\\partial_{ip}S}{\\partial\\xi}d\\xi + \\frac{1}{2}{\\frac{\\partial_{ip}^{2}S}{\\partial\\xi^{2}}(d\\xi)}^{2} + \\frac{1}{6}{\\frac{\\partial_{ip}^{3}S}{\\partial\\xi^{3}}(d\\xi)}^{3} = Dd\\xi - \\frac{1}{2}D_{2}(d\\xi)^{2} + \\frac{1}{6}{D_{3}(d\\xi)}^{3}$\n", + "\n", + "Eq. \u2011\n", + "$dU = \\sum_{}^{}{Y_{i}dX_{i}} - Dd\\xi + \\frac{1}{2}D_{2}(d\\xi)^{2} - \\frac{1}{6}{D_{3}(d\\xi)}^{3}$\n", + "\n", + "At the consolute point, the third derivative also becomes zero, i.e.\n", + "\n", + "Eq. \u2011 $D_{3} = \\frac{\\partial_{ip}^{3}S}{\\partial\\xi^{3}}^{3} = 0$\n", + "\n", + "Let us further discuss the properties of the system in relation to the\n", + "critical point. By taking the inverse of the equation of the limit of\n", + "stability, , one obtains\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial X_{i}}{\\partial Y_{i}} \\right)_{X_{j}} = + \\ \\infty$\n", + "\n", + "i.e. all $X_{i}$ quantities diverge at the critical point. Therefore,\n", + "when a system approaches the critical point from its stable region, the\n", + "change of a molar quantity with respect to its conjugate potential\n", + "varies dramatically and becomes infinite at the critical point,\n", + "resulting in property anomalies in the system. In the unstable region,\n", + "the system would thus separate into stable subsystems and becomes\n", + "heterogeneous, and $X_{i}$:s change discontinuously between subsystems.\n", + "While in the stable region, the change of a molar quantity with respect\n", + "to its conjugate potential decreases as the system moves away from the\n", + "critical point and remains positive due to the stability criteria\n", + "denoted by .\n", + "\n", + "However, it is not clear how a molar quantity changes with respect to a\n", + "non-conjugate potential at the critical point. From the Maxwell\n", + "relation, one has\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial Y_{i}}{\\partial X_{j}} \\right)_{X_{k \\neq j}} = \\frac{\\partial^{2}U}{\\partial X_{i}\\partial X_{j}} = \\left( \\frac{\\partial Y_{j}}{\\partial X_{i}} \\right)_{X_{k \\neq i}}$\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial X_{j}}{\\partial Y_{i}} \\right)_{X_{k \\neq j}} = \\left( \\frac{\\partial X_{i}}{\\partial Y_{j}} \\right)_{X_{k \\neq i}}$\n", + "\n", + "Since all $X_{i}$:s diverge at the critical point, both derivatives in\n", + "should also go to infinite at the critical point. To investigate their\n", + "signs, let us carry out a virtual experiment similar to the one in\n", + "deriving the stability condition ( and ). In this case, two internal\n", + "processes are needed for moving two molar quantities simultaneously in\n", + "an isolated system, i.e.\n", + "\n", + "*Eq. 1\u201143*\n", + "$dU = - D_{\\xi_{1}}d\\xi_{1} - D_{\\xi_{2}}d\\xi_{2} + D_{\\xi_{1}\\xi_{2}}d\\xi_{1}d\\xi_{2} + \\frac{1}{2}D_{2\\xi_{1}}\\left( d\\xi_{1} \\right)^{2} + \\frac{1}{2}D_{2\\xi_{2}}\\left( d\\xi_{2} \\right)^{2}$\n", + "\n", + "Based on the above discussions, in a stable system at equilibrium with\n", + "$D_{\\xi_{1}} = D_{\\xi_{2}} = 0$, $D_{2\\xi_{1}} > 0$ and\n", + "$D_{2\\xi_{2}} > 0$, the sign of $D_{\\xi_{1}\\xi_{2}}$ cannot be\n", + "unambiguously determined in keeping the change of internal energy\n", + "positive, i.e. $dU > 0$. This indicates that the quantities in can be\n", + "either positive or negative in the stable region and become zero at the\n", + "critical point. By the same token, the quantities in can be either\n", + "positive or negative and become positive or negative infinite at the\n", + "critical point.\n", + "\n", + "A profound conclusion from this analysis is that in a stable system even\n", + "though a molar quantity always changes in the same direction as its\n", + "conjugate potential, the same molar quantity may change in the opposite\n", + "direction of a non-conjugate potential, resulting in additional\n", + "anomalies represented by Eq. 1\u201140. One example of is the thermal\n", + "expansion in a closed system, i.e. $dN_{i} = 0$, as follows\n", + "\n", + "Eq. \u2011\n", + "$\\left( \\frac{\\partial V}{\\partial T} \\right)_{S} = \\left( \\frac{\\partial S}{\\partial( - P)} \\right)_{V}$\n", + "\n", + "The left-hand side of can be understood as follows: with the increase of\n", + "temperature, the system regulates its pressure in order to keep the\n", + "entropy from increasing, which results in the volume change of the\n", + "system. The behavior of the system depends on whether the pressure\n", + "decreases or increases in order to maintain the entropy of the system\n", + "constant. If the pressure decreases to maintain the entropy of the\n", + "system constant, the volume would increase with the increase of\n", + "temperature, i.e. the left-hand side of the equation has a positive\n", + "sign, which is also shown by the right-hand side of the equation as the\n", + "changes of $S$ and $\u2013P$ have the same sign. That the volume increases\n", + "with temperature is the normal scenario. On the other hand, if the\n", + "pressure increases to maintain the entropy of the system constant, the\n", + "volume would decrease with the increase of temperature, resulting in a\n", + "negative sign for the left-hand side of the equation. This decrease of\n", + "volume with the increase of temperature is usually considered to be\n", + "anomalous, originated from the increase of entropy by the decrease of\n", + "$\u2013P$ or the increase of pressure. More discussions on entropy will\n", + "follow in Chapter 5.2.5 and Chapter 9.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/general_condition_of_equilibrium.ipynb b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/general_condition_of_equilibrium.ipynb new file mode 100644 index 0000000..4aae221 --- /dev/null +++ b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/general_condition_of_equilibrium.ipynb @@ -0,0 +1,123 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "7fc1ab97", + "cell_type": "markdown", + "source": [ + "## General condition of equilibrium\n", + "\n", + "A system is heterogeneous when some properties have different values at\n", + "different portions of the system when the system is at equilibrium. Two\n", + "scenarios may exist where the variations of properties can be either\n", + "continuous or discontinuous. In the scenario of continuous variations,\n", + "the gradients of those variations must be coupled so that the system\n", + "remains at equilibrium. The number of independent variables is thus\n", + "reduced. These gradients must also be constrained along the boundaries\n", + "between the system and the surroundings. This type of constrained\n", + "equilibrium is not discussed in the book as it involves heterogeneous\n", + "boundary conditions between the system and the surroundings and depends\n", + "on the morphology of the system.\n", + "\n", + "In the second scenario with discontinuous variations, those properties\n", + "have different values in different portions of the system, but remain\n", + "homogenous within each portion. The system is in equilibrium as each\n", + "portion is in equilibrium with all other portions of the system. Those\n", + "homogeneous portions represent different phases in the system with the\n", + "properties in each phase being homogeneous at equilibrium. In the\n", + "previous chapter, it has been shown that all potentials are homogeneous\n", + "in a homogeneous system.\n", + "\n", + "For a heterogeneous system, the same conclusion can be obtained. If the\n", + "temperature is inhomogeneous, heat can be conducted from high\n", + "temperature locations to low temperature locations, and this process is\n", + "irreversible based on the second law of thermodynamics because it\n", + "increases the internal entropy of the system. If the pressure is\n", + "inhomogeneous, the amounts of lower molar volume phases will increase to\n", + "reduce the internal energy of the system. If the chemical potential of a\n", + "component is inhomogeneous, the chemical potential difference of the\n", + "component will drive that component to the locations with a lower\n", + "chemical potential so the internal energy of the system can be\n", + "decreased. Therefore, it can be concluded that all potentials are\n", + "homogeneous in a heterogeneous system at equilibrium, and the variables\n", + "that are not homogeneous are thus their conjugate molar quantities.\n", + "Under certain special circumstances to be discussed in later part of\n", + "this book, some molar quantities may also have the same values in\n", + "difference phases.\n", + "\n", + "In a system at equilibrium with $c$ independent components, there are\n", + "$c + 2$ pairs of conjugate variables based on or though more can be\n", + "added as shown by depending on experimental conditions. For simplicity,\n", + "most discussions in this book are limited to systems with $c + 2$ pairs\n", + "of conjugate variables unless otherwise specified, with number \u201c2\u201d\n", + "representing conjugate variables of $T - S$ and $( - P) - V$.\n", + "\n", + "For a system under constant temperature, pressure, and moles of each\n", + "independent component, the equilibrium condition derives from as\n", + "\n", + "Eq. \u2011\n", + "$dG = - SdT - Vd( - P) + \\sum_{}^{}\\mu_{i}{dN}_{i} - Dd\\xi = - Dd\\xi = 0$\n", + "\n", + "Consequently, the equilibrium state is defined by the minimization of\n", + "Gibbs energy of the system at constant $T$, $P$ and $N_{i}$ because the\n", + "second derivatives need to be positive for the equilibrium system to be\n", + "stable as stipulated by . For heterogeneous systems with two or more\n", + "phases, Gibbs energy of the system is the weighted summation of Gibbs\n", + "energies of individual phases, i.e.\n", + "\n", + "Eq. \u2011 $\\frac{G}{N} = G_{m} = \\sum_{\\beta}^{}{f^{\\beta}G_{m}^{\\beta}}$\n", + "\n", + "where $f^{\\beta}$ and $G_{m}^{\\beta}$ are the mole fraction and molar\n", + "Gibbs energy of the phase $\\beta$, respectively, and the summation goes\n", + "over all phases in the system. $f^{\\beta}$ is equal to zero for phases\n", + "not present in the equilibrium state.\n", + "\n", + "The minimization of Gibbs energy of the system is carried out under the\n", + "following mass balance conditions\n", + "\n", + "Eq. \u2011\n", + "$x_{i} = \\sum_{\\beta}^{}{f^{\\beta}x_{i}^{\\beta}} = \\sum_{\\beta}^{}{f^{\\beta}\\frac{\\sum_{\\beta - t}^{}{a^{\\beta - t}\\sum_{k}^{}{i_{k}^{\\beta - t}y_{k}^{\\beta - t}}}}{\\sum_{\\beta - t}^{}{a^{\\beta - t}\\left( 1 - y_{va}^{\\beta - t} \\right)}}}$\n", + "\n", + "Eq. \u2011 $\\sum_{i}^{}x_{i} = 1$\n", + "\n", + "Eq. \u2011 $\\sum_{k}^{}y_{k}^{\\beta - t} = 1$\n", + "\n", + "where $a^{\\beta - t}$ and $y_{k}^{\\beta - t}$ are the number of site in\n", + "sublattice $t$ in the $\\beta$ phase and the corresponding site fraction\n", + "of species $k$ in the sublattice, respectively, and $i_{k}^{\\beta - t}$\n", + "is the stoichiometry of the component $i$ in the species $k$, as used in\n", + ". The summation in runs over species for each sublattice. For phases\n", + "containing ionic species, electroneutrality also needs to be maintained,\n", + "i.e. is applied to each phase. This minimization problem of Gibbs energy\n", + "under the constraint of mass conservation can be solved by means of a\n", + "range of algorithms. It should be noted that the mole fractions of\n", + "phases and site fractions of species are bounded between 0 and 1.\n", + "\n", + "This minimization procedure must result in that potentials are\n", + "homogeneous in the system as discussed above. Since the present book\n", + "deals with thermodynamics of materials, the chemical potential of each\n", + "component is of particular interest and must be homogenous in all phases\n", + "of the system at equilibrium, i.e.\n", + "\n", + "Eq. \u2011\n", + "$\\mu_{i}^{\\alpha} = \\mu_{i}^{\\beta} = \\mu_{i}^{\\gamma}\\ldots\\ldots$\n", + "\n", + "For phases in which the chemical potentials of individual components\n", + "cannot be evaluated due to stoichiometry, the combined chemical\n", + "potentials can be used to relate individual potentials as shown by and .\n", + "As proved in Chapter shown by , the chemical potential of a component in\n", + "a solution is represented by the intercept on the Gibbs energy axis by\n", + "the multi-dimensional tangent surface of Gibbs energy of the solution\n", + "plotted with respect to mole fractions of independent components. The\n", + "Gibbs energy functions of all phases in equilibrium must thus share the\n", + "same tangent surface. This is usually referred to as the common tangent\n", + "construction for phases at equilibrium. Any phase with its Gibbs energy\n", + "curve above the tangent surface is not stable under given compositions\n", + "of the system.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/gibbs_phase_rule.ipynb b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/gibbs_phase_rule.ipynb new file mode 100644 index 0000000..22182f2 --- /dev/null +++ b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/gibbs_phase_rule.ipynb @@ -0,0 +1,64 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "9550cd18", + "cell_type": "markdown", + "source": [ + "## Gibbs phase rule\n", + "\n", + "The Gibbs-Duhem equation, i.e. , states that only $c + 1$ potentials are\n", + "independent in a homogeneous system with $c$ independent components and\n", + "the additional two variables of temperature and pressure. In a\n", + "heterogeneous system at equilibrium, this equation can be applied to\n", + "individual phases as each phase is homogeneous. Noting that each\n", + "potential has the same value in all phases at equilibrium, can be\n", + "written as follows for each individual phase, $\\ \\beta$, in the system\n", + "at equilibrium\n", + "\n", + "Eq. \u2011\n", + "$0 = - S^{\\beta}dT - V^{\\beta}d( - P) - \\sum_{}^{}{N_{i}^{\\beta}d\\mu}_{i}$\n", + "\n", + "For a system with $p$ phases at equilibrium, there are $p$ such\n", + "equations relating the potentials in the system. The number of\n", + "independent potentials thus becomes\n", + "\n", + "Eq. \u2011 $\\upsilon = c + 2 - p$\n", + "\n", + "is called Gibbs phase rule. It dictates the number of potentials that\n", + "can change independently for a given number of phases co-existing at\n", + "equilibrium, commonly called degree of freedom of the system at\n", + "equilibrium. It stipulates that the maximum number of phases can\n", + "co-exist in a system at equilibrium is obtained by setting\n", + "$\\upsilon = 0$, called an invariant equilibrium due to the zero degree\n", + "of freedom,\n", + "\n", + "Eq. \u2011 $p_{\\max} = c + 2$\n", + "\n", + "There are thus maximum three phases in a one-component system, four\n", + "phases in a binary system, five phases in a ternary system, and so on,\n", + "that can co-exist simultaneously at equilibrium with all potentials in\n", + "the system at fixed values. This should not be confused with the total\n", + "number of phases that could exist, but not co-exist in a system, which\n", + "of course are not limited by Gibbs phase rule.\n", + "\n", + "It should be emphasized that the degree of freedom, $\\upsilon$, is\n", + "referred to the number of potentials only, not to molar quantities of\n", + "the system because molar quantities are generally not homogeneous in a\n", + "heterogeneous system. For example, in a system at equilibrium with\n", + "$\\upsilon = 0$, the amount of each component can be varied, while\n", + "keeping the number of phases at $p_{\\max} = c + 2$. This can be done\n", + "through changing the amount of each phase in the system through the mass\n", + "balance equation, , without altering the composition of each phase and\n", + "thus the chemical potentials in the system. As mentioned at the\n", + "beginning of Chapter , the number of independent variables in a system\n", + "at equilibrium, i.e. the sum of independent potentials and independent\n", + "molar quantities, is $c + 2$ with the maximum number of independent\n", + "potentials determined by Gibbs phase rule, .\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/index.ipynb b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/index.ipynb new file mode 100644 index 0000000..7752e80 --- /dev/null +++ b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/index.ipynb @@ -0,0 +1,15 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "45d835d9", + "cell_type": "markdown", + "source": [ + "# Phase equilibria in heterogeneous systems\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/molar_phase_diagrams.ipynb b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/molar_phase_diagrams.ipynb new file mode 100644 index 0000000..5d44860 --- /dev/null +++ b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/molar_phase_diagrams.ipynb @@ -0,0 +1,638 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "cf1f5e65", + "cell_type": "markdown", + "source": [ + "## Molar phase diagrams\n", + "\n", + "The potential phase diagrams discussed in Chapter present information on\n", + "which phases are in equilibrium under given values of potentials, but do\n", + "not have any information on the properties of phases in equilibrium. On\n", + "the other hand, there are direct relations between potentials and their\n", + "conjugate molar quantities for each phase at equilibrium depicted by to\n", + ". One may thus substitute the potentials by their conjugate molar\n", + "quantities in the potential phase diagrams as molar quantities provide\n", + "more information on the properties of phases and the system. This is\n", + "particularly true when chemical potentials are replaced by compositions\n", + "as the compositions of the system are often the variables controlled and\n", + "measured in experiments instead of chemical potentials.\n" + ], + "metadata": {} + }, + { + "id": "8ea13828", + "cell_type": "markdown", + "source": [ + "### Tie-lines and lever rule\n", + "\n", + "It is self-evident from to Eq. 2\u20114 that while potentials are homogeneous\n", + "in all phases in a heterogeneous system at equilibrium, the molar\n", + "quantities usually have different values in individual phases. This is\n", + "also stipulated in various Clausius-Clapeyron equations such as to and\n", + "to . The difference in molar quantities thus increases the\n", + "dimensionality of the phase region by the number of potentials replaced\n", + "by their conjugate molar quantities. The maximum dimensionality of a\n", + "phase region is the dimensionality of the phase diagram under\n", + "consideration. This thus creates a finite space between phases in\n", + "equilibrium in the phase diagram with some axes being molar quantities.\n", + "\n", + "For an equilibrium system under constant $T$, $P$ and $N_{i}$, the\n", + "potentials in the system and their conjugate molar quantities in each\n", + "phase are all uniquely defined. In a phase diagram with one or more\n", + "potentials replaced by their conjugate molar quantities, two phases in\n", + "equilibrium in a system with $c$ independent components are connected by\n", + "a $c$ dimensional line in a *c*+2 dimensional space or\n", + "its$\\ $*c+1*-dimensional projection as discussed in Chapter . These\n", + "lines are called tie-lines and collectively represent a two-phase\n", + "equilibrium region. For a $k$-phase equilibrium, there are total\n", + "$C_{k}^{2} = \\frac{k(k - 1)}{2}$ tie-lines connecting every two phases\n", + "with $k - 1\\ $of them independent because the number of independent\n", + "tie-lines increases by one with each new phase added. For the invariant\n", + "equilibrium with zero degree of freedom, the number of phases in\n", + "equilibrium is $c + 2$ shown by containing\n", + "$C_{c + 2}^{2} = \\frac{(c + 2)(c + 1)}{2}$ tie-lines with $c + 1$ of\n", + "them being independent.\n", + "\n", + "Inside the space encapsulated by the tie-lines, the axis variables of\n", + "the phase diagram (a mixture of potentials and molar quantities) can be\n", + "changed independently without changing the phases in equilibrium and\n", + "their properties. Only the relative amounts of individual phases are\n", + "adjusted accordingly to maintain the conservation of the molar\n", + "quantities in the system specified by the molar quantity axes of the\n", + "phase diagram. The geometric feature circumscribing the space\n", + "encapsulated by the tie-lines no longer represents any phase regions,\n", + "but a boundary between the neighbouring phase regions. Its\n", + "characteristics will be discussed in more details in the next few\n", + "sections. As properties in each phase are homogeneous, the values of\n", + "molar quantities of a system are simply the sum of individual phases and\n", + "can be represented by the following equation\n", + "\n", + "Eq. \u2011 $A_{m} = \\sum_{\\alpha}^{}{f^{\\alpha}A_{m}^{\\alpha}}$\n", + "\n", + "where $A_{m}$ and $A_{m}^{\\alpha}$ represent the values of a molar\n", + "quantity of the system and the $\\alpha$ phase, respectively,\n", + "$f^{\\alpha}$ the mole fraction of the $\\alpha$ phase, and the summation\n", + "goes over all phases in equilibrium with each other. With\n", + "$\\sum_{\\alpha}^{}f^{\\alpha} = 1$, can be re-arranged into the following\n", + "equation\n", + "\n", + "Eq. \u2011\n", + "$\\sum_{\\alpha}^{}{f^{\\alpha}\\left( {A_{m} - A}_{m}^{\\alpha} \\right)} = 0$\n", + "\n", + "is commonly referred as lever rule. For a two-phase equilibrium of\n", + "$\\alpha$ and $\\beta$, it becomes\n", + "\n", + "Eq. \u2011\n", + "$f^{\\alpha} = \\frac{A_{m}^{\\beta} - A_{m}}{A_{m}^{\\beta} - A_{m}^{\\alpha}}$\n", + "\n", + "Eq. \u2011\n", + "$f^{\\beta} = \\frac{A_{m}^{\\alpha} - A_{m}}{A_{m}^{\\alpha} - A_{m}^{\\beta}}$\n", + "\n", + "For a phase diagram with the number of axes being\n", + "$n = \\left( c - n_{s} \\right) + 1$, the number of possible axes being\n", + "molar quantities is thus $k \\leq n$. There are thus $k$ equations\n", + "similar to with one for each molar quantity, $A_{mi}$, resulting in the\n", + "following $k + 1$ equations\n", + "\n", + "Eq. \u2011\n", + "$\\sum_{\\alpha}^{}{f^{\\alpha}\\left( {A_{mi} - A}_{mi}^{\\alpha} \\right)} = 0$\n", + "\n", + "Eq. \u2011 $1 - \\sum_{\\alpha}^{}f^{\\alpha} = 0$\n", + "\n", + "The summations in and go over the phases in equilibrium, and the amount\n", + "of each phase is obtained by solving these $k + 1$ equations\n", + "simultaneously along with the equilibrium conditions.\n" + ], + "metadata": {} + }, + { + "id": "5fd889c2", + "cell_type": "markdown", + "source": [ + "### Phase diagrams with both potentials and molar quantities\n", + "\n", + "Based on Gibbs phase rule discussed in Chapters and , the\n", + "dimensionalities of phase regions in a potential phase diagram are given\n", + "by or . With every potential substituted by its conjugate molar\n", + "quantity, the dimensionalities of phase regions increase by one until\n", + "the phase region reaches the dimensionality of the phase diagram. The\n", + "axes of this phase diagram now consist of both potentials and molar\n", + "quantities. The dimensionality of a phase region can thus be represented\n", + "by the following equation based on\n", + "\n", + "Eq. \u2011\n", + "$\\upsilon_{m} = \\left( c - n_{s} \\right) + 2 - p + n_{m} \\leq \\left( c - n_{s} \\right) + 1$\n", + "\n", + "where $n_{m}$ is the number of molar axes. This equation is applicable\n", + "to phase regions with more than $n_{m} + 1$ phases. For phase regions\n", + "with $n_{m} + 1$ phases or fewer, the dimensionalities are the same as\n", + "the phase diagram, i.e. $\\upsilon_{m} = \\left( c - n_{s} \\right) + 1$,\n", + "and no longer vary with the number of molar quantity axes. When all\n", + "$\\left( c - n_{s} \\right) + 1$ potentials are substituted by their\n", + "conjugate molar quantities, one obtains a complete molar phase diagrams\n", + "to be discussed in Chapter , and all phase regions have the\n", + "same-dimensionality of $\\left( c - n_{s} \\right) + 1$.\n", + "\n", + "For the sake of graphic visualization, let us exam a two-dimensional\n", + "phase diagram of a one-component system. Topologically, it is equivalent\n", + "to a multi-component system with $n_{s} = c - 1$. In , three\n", + "two-dimensional phase diagrams are shown for pure Fe. In principle, one\n", + "can use any one of them to illustrate mixed potential and molar phase\n", + "diagrams. For the purpose of practical usefulness, one selects the\n", + "$T - ( - P)$ potential diagram as temperature and pressure are the two\n", + "typical variables controlled in experiments of one-component systems.\n", + "The conjugate molar quantities of $- P$ and $T$ are molar volume and\n", + "molar entropy, respectively. For stable phases, any pair of conjugate\n", + "variables changes in the same direction as illustrated by and , i.e. the\n", + "phase stable at higher $T$ has higher molar entropy, and the phase\n", + "stable at higher $\u2013P$, i.e. lower pressure, has higher molar volume. Let\n", + "us first substitute $\u2013P$ by $V_{m}$ as shown in a. The dimensionality of\n", + "a sing-phase region remains unchanged because of\n", + "$p = 1 < 2 = n_{m} + 1$. The dimensionality of two-phase regions is\n", + "changed from 1 to 2 due to $\\upsilon_{m} = 3 - 2 + 1 = 2$ from .\n", + "\n", + "Figure \u2011: T-Vm and Sm-(-P) phase diagrams of Fe\n", + "\n", + "As both phases in a two-phase equilibrium have the same temperature, all\n", + "tie-lines, depicted by dotted lines, are perpendicular to the\n", + "temperature axis in a. When the molar volume of the system changes from\n", + "one end of a tie-line to another end at a constant temperature, the mole\n", + "fraction of one phase increases from 0 to 1, and the mole fraction of\n", + "another phase decreases from 1 to 0. The tine-lines at various\n", + "temperatures combine together to form a two-dimensional two-phase\n", + "region. The two curves at the two ends of tie-lines represent the\n", + "boundaries between the single-phase and two-phase regions and are no\n", + "longer phase regions themselves. They are thus called phase boundaries.\n", + "\n", + "By the same token, by changing the temperature at a constant molar\n", + "volume of the system, the system will locate on different tie-lines with\n", + "the amounts of the two phases determined by the lever rule. It is thus\n", + "clear that the system maintains the two-phase equilibrium state with\n", + "both $T$ and $V_{m}$ changing independently inside the two-dimensional\n", + "two-phase region. This seems in contradiction to Gibbs phase rule being\n", + "$\\upsilon = 3 - p = 1$ from , but it is not because Gibbs phase rule\n", + "applies strictly to potential phase diagrams only, while the $T - V_{m}$\n", + "phase diagram has one of its axis being a molar quantity. As an\n", + "alternative, one may consider as a modified Gibbs phase rule in\n", + "describing the dimensionality of a phase region in a mixed potential and\n", + "molar phase diagram with $p \\geq n_{m} + 1$.\n", + "\n", + "The two three-phase equilibria in pure Fe are also represented by\n", + "tie-lines connecting all three phases. The dimensionality of three-phase\n", + "regions is $\\upsilon_{m} = 3 - 3 + 1 = 1$ from , and the three two-phase\n", + "tie-lines for a three-phase equilibrium thus overlap each other with\n", + "their three molar volumes on the same tie-line.\n", + "\n", + "Let us examine the two three-phase equilibria in more detail. In the\n", + "\u03b3/\u03b1/\u03b5 three-phase equilibrium at $T_{E} = 756.6\\ K$ and\n", + "$\\left( - P_{E} \\right) = - 1.046 \\bullet 10^{10}\\ Pa$, the molar\n", + "volumes of \u03b1, \u03b3, and \u03b5 are 6.837, 6.677, 6.582 $10^{- 6}\\ m^{3}/mol$,\n", + "respectively. There are two two-phase regions at higher temperatures and\n", + "one two-phase region at lower temperatures. This is also shown in the\n", + "potential phase diagram of a with two two-phase curves entering into and\n", + "one two-phase curve leaving from the three-phase equilibrium point with\n", + "decreasing temperature. Considering the system with the fixed molar\n", + "volume equal to that of the $\\gamma$ phase, i.e.\n", + "$V_{m}^{\\ }\\left( T_{E} \\right) = 6.677 \\bullet 10^{- 6}\\ m^{3}/mol$. At\n", + "$T > T_{E}$, the system is in the single \u03b3 phase region. With decrease\n", + "in temperature across $T_{E}$, it enters into the $\\alpha + \\varepsilon$\n", + "two-phase region. This transformation can be written as follows and is\n", + "called a eutectoid reaction\n", + "\n", + "Eq. \u2011 $\\gamma \\rightarrow \\alpha + \\varepsilon$\n", + "\n", + "This type of transformations is named as eutectic reaction if the high\n", + "temperature phase is a liquid phase. If the system molar volume is\n", + "between $V_{m}^{\\gamma}$ and $V_{m}^{\\alpha}$ at $756.6K$, with decrease\n", + "of temperature, the system first moves from the single \u03b3 phase region to\n", + "the $\\alpha + \\gamma$ two-phase region when the\n", + "$\\gamma/(\\alpha + \\gamma)$ phase boundary is crossed. When the\n", + "temperature reaches $T_{E}$, the eutectoid transformation takes place in\n", + "the remaining \u03b3 phase. The $\\alpha$ formed prior to the eutectoid\n", + "transformation is called proeutectoid $\\alpha$. By the same token, when\n", + "the system molar volume is between $V_{m}^{\\gamma}$ and\n", + "$V_{m}^{\\varepsilon}$ at $756.6K$, proeutectoid $\\varepsilon$ would form\n", + "followed by the eutectoid transformation with decrease in temperature.\n", + "\n", + "On the other hand, the $L/\\delta/\\gamma$ three-phase equilibrium at\n", + "$T_{P} = 1977.9\\ K$ and\n", + "$\\left( - P_{P} \\right) = - 5.111 \\bullet \\ 10^{9}\\ Pa$ has different\n", + "characteristics, where the subscript P will be defined shortly. There\n", + "are one two-phase equilibrium above and two two-phase equilibria below\n", + "the invariant temperature, shown in the potential phase diagram of a\n", + "with one two-phase curve entering into and two two-phase curves leaving\n", + "from the three-phase equilibrium point with decreasing temperature. The\n", + "molar volumes of $L$, $\\delta$, and $\\gamma$ at $T_{P}$ are 7.735,\n", + "7.542, and 7.498 $10^{- 6}\\ m^{3}/mol$, respectively. For $T > T_{P}$,\n", + "the two-phase region is $L + \\gamma$. If the system molar volume is\n", + "between 7.735 and 7.498 $10^{- 6}\\ m^{3}/mol$, i.e.\n", + "$V_{m}^{L}\\left( T_{P} \\right)$ and\n", + "$V_{m}^{\\gamma}\\left( T_{P} \\right)$, when the temperature reaches\n", + "$T_{P}$, $L$ and $\\gamma$ are combined to form $\\delta$ with the\n", + "transformation written as\n", + "\n", + "Eq. \u2011 $L + \\gamma \\rightarrow \\delta$\n", + "\n", + "This type of reactions is called as peritectic reaction or peritectoid\n", + "reaction when the liquid phase is replaced by a solid phase, denoted by\n", + "the subscript P. At $T < T_{P}$, one or both high temperature phases may\n", + "no longer be present in equilibrium depending on the value of the system\n", + "molar volume. For\n", + "$V_{m}^{\\ } = V_{m}^{\\delta}\\left( T_{P} \\right) = 7.542 \\bullet 10^{- 6}\\ m^{3}/mol$,\n", + "the peritectic reaction, , can come to completion with no $L$ and\n", + "$\\gamma$ left upon decreasing temperature. For\n", + "$V_{m}^{\\gamma}\\left( T_{P} \\right) = 7.498 < V_{m}^{\\ } < V_{m}^{\\delta}\\left( T_{P} \\right) = 7.542\\ \\left( 10^{- 6}\\ m^{3}/mol \\right)$,\n", + "the liquid phase is consumed, and the system enters the\n", + "$\\gamma + \\delta$ two-phase region. On the other hand, for\n", + "$V_{m}^{\\delta}\\left( T_{P} \\right) = 7.542 < V_{m}^{\\ } < V_{m}^{\\ L}\\left( T_{P} \\right) = 7.735\\ \\ \\left( 10^{- 6}\\ m^{3}/mol \\right)$,\n", + "the $\\gamma$ phase is consumed instead, and the system enters into the\n", + "$L + \\delta$ two-phase equilibrium region upon cooling.\n", + "\n", + "Let us now replace $T$ by $S_{m}$ to obtain the $( - P) - S_{m}$ phase\n", + "diagram shown in b. The morphology of this phase diagram is identical to\n", + "the $T - V_{m}$ phase diagram just discussed with all tie-lines\n", + "perpendicular to the pressure axis. The transformations at the two\n", + "three-phase equilibria with $( - P)$ decreasing or $P$ increasing are as\n", + "follows\n", + "\n", + "Eq. \u2011 $\\gamma + \\alpha \\rightarrow \\varepsilon$\n", + "\n", + "Eq. \u2011 $\\delta \\rightarrow L + \\gamma$\n", + "\n", + "To visualize two-dimensional phase diagrams of binary systems, one\n", + "usually keeps the pressure constant. One type of commonly used binary\n", + "phase diagram is the temperature-composition ($T - x$) phase diagram. As\n", + "an example, let us re-plot the $T - \\mu_{C}$ potential diagram shown in\n", + "into a $T - x_{C}$ mixed potential and molar phase diagram by replacing\n", + "the chemical potential of $C$ by its mole fraction. The $T - x_{C}$\n", + "phase diagram thus obtained is shown in . In this phase diagram there\n", + "are one peritectic reaction and two eutectic reactions as follows\n", + "\n", + "Eq. \u2011 $L + \\delta \\rightarrow \\gamma$\n", + "\n", + "Eq. \u2011 $L \\rightarrow \\gamma + C$\n", + "\n", + "Eq. 3\u201161 $\\gamma \\rightarrow \\alpha + C$\n", + "\n", + "Figure \u2011: $T - x_{C}\\ $ phase diagram of the Fe-C binary system\n", + "\n", + "In in Chapter , it was discussed the formation of miscibility gaps due\n", + "to repulsive interactions between components. One example is shown in\n", + "for the Al-Zn binary system in terms of both $T - \\mu_{Zn}$ potential\n", + "phase diagram and $\\ T - x_{Zn}\\ $ mixed potential and molar phase\n", + "diagram.\n", + "\n", + "Figure \u2011: $T - \\mu_{Zn}$ potential phase diagram (a) and\n", + "$\\ T - x_{Zn}\\ $ mixed potential and molar phase diagram (b) of the\n", + "Al-Zn binary system\n", + "\n", + "In ,there are one eutectic reaction and one eutectoid reaction as\n", + "follows\n", + "\n", + "Eq. \u2011 $L \\rightarrow fcc + hcp$\n", + "\n", + "Eq. \u2011 $fcc\\# 1 \\rightarrow fcc\\# 2 + hcp$\n", + "\n", + "The eutectoid reaction, , is also termed as monotectoid reaction because\n", + "the fcc phase appears on both sides of the reaction with different\n", + "compositions, $fcc\\# 1$ and $fcc\\# 2$, due to the miscibility gap. The\n", + "highest temperature of the miscibility gap is called the consolute point\n", + "as discussed in Chapter , which can be clearly seen in the\n", + "$T - \\mu_{Zn}$ potential phase diagram shown in . This is a critical\n", + "point, marking the limit of instability as shown in .\n", + "\n", + "When there is only one phase on either side of the reaction, i.e. both\n", + "phases have the same composition, the reaction is called a congruent\n", + "reaction. One example is shown in for the $T - x_{SiO_{2}}\\ $ mixed\n", + "potential and molar phase diagram of the CaO-SiO2\n", + "pseudo-binary system with two congruent reactions as follows\n", + "\n", + "Eq. 3\u201164 $L \\rightarrow CaSiO_{3}$\n", + "\n", + "Eq. 3\u201165 $L \\rightarrow {Ca}_{2}SiO_{4}$\n", + "\n", + "They are not invariant reactions based on the Gibbs phase rule. In , it\n", + "is noted that there are one miscibility gap in the liquid phase close to\n", + "the $SiO_{2}$ side, four eutectic reactions with one being monotectic\n", + "involving two liquid phases due to the miscibility gap, and three\n", + "peritectic reactions.\n", + "\n", + "Figure \u2011: $T - x_{SiO_{2}}\\ $ mixed potential and molar phase diagram of\n", + "the CaO-SiO2 pseudo-binary system.\n", + "\n", + "Let us generalize the above discussion to phase diagrams with\n", + "$\\left( c - n_{s} \\right) + 1$ axes. In such a phase diagram, the\n", + "maximum number of phases is given by as\n", + "$p_{\\max} = \\left( c - n_{s} \\right) + 2$. The number of phases on the\n", + "either side of an invariant reaction can vary from one phase to\n", + "$p_{\\max} - 1 = \\left( c - n_{s} \\right) + 1$ phases with the remaining\n", + "phases on the other side of the reaction, typically with the potential\n", + "decreasing from left to right. The invariant reaction with one phase on\n", + "the left of the reaction is named as eutectic, or eutectoid reaction\n", + "depending on if the phase on the left of the reaction is liquid or\n", + "solid. The rest invariant reactions are named as peritectic or\n", + "peritectoid reactions with or without a liquid phase.\n" + ], + "metadata": {} + }, + { + "id": "86435606", + "cell_type": "markdown", + "source": [ + "### Phase diagrams with only molar quantities\n", + "\n", + "When all $\\left( c - n_{s} \\right) + 1$ potentials in a potential phase\n", + "diagrams are replaced by their conjugate molar quantities, one obtains a\n", + "molar phase diagram with molar quantities on all axes of the phase\n", + "diagram. For regions with the number of phases\n", + "$p \\leq n_{m} + 1 = \\left( c - n_{s} \\right) + 2 = p_{\\max}$ (see ), the\n", + "phase regions have the same-dimensionality as that of the phase diagram,\n", + "i.e. all phase regions have the same-dimensionality of\n", + "$\\left( c - n_{s} \\right) + 1$, and any geometric feature with\n", + "lower-dimensionalities, i.e. from 0 to $\\ \\left( c - n_{s} \\right)$, is\n", + "not phase regions, but phase boundaries between neighbouring phase\n", + "regions. For the sake of graphic visualization, the molar phase diagram\n", + "of pure Fe is shown in obtained by combining the two mixed phase\n", + "diagrams in .\n", + "\n", + "Figure \u2011: Molar phase diagram of Fe\n", + "\n", + "In this molar phase diagram, all one-, two-, and three-phase regions are\n", + "two-dimensional, the same as the dimensionality of the phase diagram. A\n", + "two-phase region is made up by tie-lines connecting the two phases in\n", + "equilibrium, while a three phase-region is surrounded by three two-phase\n", + "tie-lines, i.e. a tie-triangle. The amount of each phase in the\n", + "tie-triangle can be obtained using the lever rule represented by and .\n", + "As can be seen, phase boundaries between a one-phase region and a\n", + "two-phase region are one-dimensional. When the system crosses such a\n", + "phase boundary, the number of phases changes by one from two to one or\n", + "vice versa. Phase boundaries between two- and three-phase regions are\n", + "represented by two-phase tie-lines. When the system crosses such a phase\n", + "boundary, the number of phases also changes by one. The\n", + "lowest-dimensional phase boundaries are the points between one- and\n", + "three-phase regions that are zero-dimensional and the intercept of four\n", + "one-dimensional phase boundaries. When the system crosses such a phase\n", + "boundary, the number of phases changes by two.\n", + "\n", + "For multi-component systems, the phase relations cannot be directly\n", + "visualized. By representing the system equations in terms of equilibrium\n", + "conditions and level rules on a phase boundary using phases separately\n", + "from the two adjacent phase regions, Palatnik and Landau \\[4\\]\n", + "postulated that the difference between the number of unknowns and\n", + "equations gives the dimensionality of the phase boundary and derived the\n", + "following relationships\n", + "\n", + "Eq. \u2011 $D^{+} + D^{-} = r - b = c - n_{s} - b$\n", + "\n", + "where $D^{+}$ and $D^{-}$ are the numbers of phases added and removed\n", + "when the phase boundary is crossed, and $r$ and $b$ are the\n", + "dimensionalities of the phase diagram and the phase boundary,\n", + "respectively. They termed the as the contact rule, which is named as the\n", + "MPL boundary rule by Hillert \\[1\\].\n", + "\n", + "By the same token, is applicable to any phase boundary where the two\n", + "adjacent phase regions have the same-dimensionality of the phase\n", + "diagram, even in phase diagrams with a mixture of potentials and molar\n", + "quantities as the diagram axes. This can be understood because the\n", + "potentials are homogeneous in all phases in equilibrium on the phase\n", + "boundary. The phase boundary is thus equivalent to those in a complete\n", + "molar phase diagram with its number of components equal to the number of\n", + "molar axes in a mixed potential and molar phase diagrams minus one, i.e.\n", + "\n", + "Eq. \u2011 $c^{'} = n_{m} - 1 = c - n_{s}$\n", + "\n", + "The last part of stems from the discussion related to when all\n", + "$c^{'} + 1$ potentials are replaced by their conjugate molar quantities,\n", + "which is analogous to a molar phase diagram with $\\ c$ independent\n", + "components and $n_{s}$ potentials fixed.\n", + "\n", + "For a two-dimensional phase diagram with $r = 2$, the phase boundary can\n", + "be either zero- or one--dimensional. As shown in , the basic element of\n", + "a molar phase diagram is a joint of four one-dimensional phase boundary\n", + "lines. When a phase boundary line is crossed, the number of phases is\n", + "either increased or decreased by one. The joint of four one-dimensional\n", + "phase boundary lines is zero-dimensional. The number of phases differs\n", + "by two between the phase regions across the zero-dimensional joint. Two\n", + "scenarios are possible\n", + "\n", + "Two phases are added or removed, i.e. $D^{+} = 2$ and $D^{-} = 0$ or\n", + "$D^{+} = 0$ and $D^{-} = 2$, and the number of phases in the two phase\n", + "regions differs by two;\n", + "\n", + "One phase is added, one phase is removed, i.e. $D^{+} = D^{-} = 1$, and\n", + "the phase regions have the same number of phases.\n", + "\n", + "By combining the contact rules for both zero- and one-dimensional phase\n", + "boundaries, it is evident that the above two scenarios co-exist in a\n", + "joint of four-phase regions with two-phase regions following the first\n", + "scenario and other two-phase regions following the second scenario.\n", + "Based on the Schreinemakers\u2019 rule generalized by Hillert \\[5\\], each of\n", + "the two-phase regions with the same number of phases contains one\n", + "extrapolation of the phase boundaries, while the other two-phase regions\n", + "contain either zero or two extrapolations of the phase boundaries. This\n", + "can be observed for all the zero-dimensional phase boundaries in and is\n", + "further schematically illustrated in for general cases.\n", + "\n", + "Figure \u2011: Schematic molar phase diagram, demonstrating the\n", + "Schreinemakers\u2019 rule\n" + ], + "metadata": {} + }, + { + "id": "b0c34261", + "cell_type": "markdown", + "source": [ + "### Projection and section of phase diagrams with potential and molar quantities\n", + "\n", + "As discussed in Chapter , projections of high-dimensional phase diagrams\n", + "usually cannot keep all information. However, there is one type of\n", + "widely used projection in the literature, i.e. the liquidus surface in\n", + "ternary systems under constant pressure with temperature and mole\n", + "fractions of two components as its axes. The projection along the\n", + "temperature axis reveals the composition regions for primary phases that\n", + "solidify from liquid upon cooling. These regions are separated by\n", + "univariant lines of three-phase equilibria. The projections along one of\n", + "the two mole fractions show the temperature as a function of composition\n", + "on the univariant three-phase equilibrium lines and also depict whether\n", + "a four-phase equilibrium is peritectic or eutectic. There are four\n", + "scenarios for the three univariant three-phase equilibrium lines to meet\n", + "at the four-phase equilibrium as depicted in and discussed individually\n", + "below.\n", + "\n", + "Figure \u2011: Schematic four options for three univariant three-phase\n", + "equilibrium lines to meet at the invariant four-phase equilibrium\n", + "\n", + "The first scenario is that with decreasing temperature, all three\n", + "univariant lines merge into the four-phase equilibrium. It indicates\n", + "that the liquid phase does not exist at temperatures below the\n", + "four-phase invariant reaction. This invariant reaction is thus a ternary\n", + "eutectic reaction with liquid completely transformed to three solid\n", + "phases upon cooling, i.e.\n", + "\n", + "Eq. \u2011 $L \\rightarrow \\alpha + \\beta + \\gamma$\n", + "\n", + "In the second scenario, two univariant lines merge into and one leaves\n", + "from the four-phase equilibrium with decreasing temperature. This means\n", + "that one solid phase at higher temperature is no longer stable at lower\n", + "temperature, and it must react with the liquid phase to form the\n", + "remaining two solid phases. The four-phase invariant reaction is thus\n", + "peritectic. The solid phase common to both univariant lines at high\n", + "temperatures reacts with the liquid phase. Assuming that this phase is\n", + "$\\alpha$, the four-phase invariant reaction becomes\n", + "\n", + "Eq. \u2011 $L + \\alpha \\rightarrow \\beta + \\gamma$\n", + "\n", + "In the third scenario, one univariant line points to and two leave from\n", + "the four-phase equilibrium with decreasing temperature. A new phase\n", + "forms at low temperatures from the three high temperature phases, e.g.\n", + "liquid, $\\alpha$, and $\\beta$, with the four-phase invariant reaction as\n", + "\n", + "Eq. \u2011 $L + \\alpha + \\beta \\rightarrow \\gamma$\n", + "\n", + "The fourth scenario is the inverse of the first scenario, indicating the\n", + "formation of liquid from solid phases upon cooling, i.e.\n", + "\n", + "Eq. \u2011 $\\alpha + \\beta + \\gamma \\rightarrow L$\n", + "\n", + "This case has not been observed in reality.\n", + "\n", + "As an example, the liquidus projections of the Al-Fe-Si ternary system\n", + "are shown in in two formats\\[6\\], i.e. (a) three-dimensional liquidus\n", + "surface with the isotherms showing the liquidus contours; (b)\n", + "conventional projection to the composition axis with the temperature\n", + "decrease shown by arrows; (c) projection to the temperature and weight\n", + "fraction of Si. The first to third scenarios of invariant reactions\n", + "discussed above can clearly be identified and listed in . It is evident\n", + "that c provides the easiest route to visualize the type of invariant\n", + "reactions as show by .\n", + "\n", + "Figure \u2011: Liquidus of the Al-Fe-Si ternary system\\[6\\], (a)\n", + "three-dimensional presentation of the liquidus; (b) projection to the\n", + "composition triangle with isotherms (dotted lines) superimposed and\n", + "their temperatures indicated close to the horizontal axis.\n", + "\n", + "Table \u2011: Invariant liquidus reactions of the Al-Fe-Si ternary system\n", + "with the composition of the liquid phase \\[6\\]\n", + "\n", + "| Reaction | T, \u00b0C | wFe, % | wSi, % |\n", + "|----------|-------|-------------------|-------------------|\n", + "| | 1178 | 77.9 | 21.0 |\n", + "| | 1155 | 49.0 | 0.16 |\n", + "| | 1127 | 52.7 | 2.81 |\n", + "| -H-L | 1076 | 41.6 | 44.0 |\n", + "| | 1073 | 51.0 | 7.19 |\n", + "| | 1050 | 53.8 | 18.4 |\n", + "| -H-L | 1019 | 34.8 | 44.4 |\n", + "| | 1004 | 49.0 | 12.6 |\n", + "| | 1000 | 46.7 | 13.2 |\n", + "| -L | 940 | 37.9 | 32.0 |\n", + "| | 921 | 33.7 | 20.1 |\n", + "| | 899 | 33.8 | 32.2 |\n", + "| | 884 | 30.8 | 26.0 |\n", + "| -L | 877 | 29.5 | 35.2 |\n", + "| | 851 | 23.3 | 21.6 |\n", + "| | 834 | 22.2 | 31.7 |\n", + "| | 825 | 22.1 | 25.7 |\n", + "| | 823 | 21.8 | 25.4 |\n", + "| | 715 | 6.64 | 10.8 |\n", + "| | 694 | 6.11 | 17.1 |\n", + "| | 680 | 4.68 | 11.6 |\n", + "| | 630 | 2.11 | 4.10 |\n", + "| | 616 | 1.76 | 6.56 |\n", + "| | 598 | 1.22 | 14.3 |\n", + "| | 575 | 0.73 | 12.7 |\n", + "\n", + "In contrast to projections, sectioning is used more often to understand\n", + "phase relations in multi-component systems. Sectioning of a potential\n", + "phase diagrams is relatively simple as the resulted phase diagram\n", + "behaves like a system with one component less. The same is true if\n", + "potentials are sectioned in phase diagrams with both potential and molar\n", + "quantities as the section is along the tie-lines of the fixed\n", + "potentials. As an example, shows the ternary Al-Fe-Si potential and\n", + "molar phase diagrams sectioned at T=1273K and P=1atm, commonly referred\n", + "to as isothermal section. It is evident that the geometric features of\n", + "both phase diagrams are identical to those of pure Fe shown in and ,\n", + "respectively, with one-, two-, and three-phase regions and corresponding\n", + "phase boundaries.\n", + "\n", + "Figure \u2011: Ternary isothermal section of the Al-Fe-Si ternary system at\n", + "T=1273K and P=1atm\n", + "\n", + "On the other hand, when the phase diagram is sectioned along a molar\n", + "quantity, it would usually not follow a tie-line because phases in\n", + "equilibrium usually have different values for the same molar quantity.\n", + "Consequently, there are no tie-lines inside such phase diagrams in\n", + "general, and any phase regions only show which phases are in equilibrium\n", + "with each other without any information on the values of molar\n", + "quantities of individual phases.\n", + "\n", + "This type of sectioning reduces both the dimensionalities of the phase\n", + "diagram and phase boundary by the same number, but does not alter the\n", + "number of phases in the adjacent phase regions. The contact rule, i.e. ,\n", + "thus remains valid and is applicable to phase regions with the\n", + "same-dimensionality as that of the sectioned phase diagram. Similarly,\n", + "the Schreinemakers\u2019 rule shown in is valid under the same conditions.\n", + "\n", + "For example, the two-dimensional phase diagram of the Mg-Al-Zn ternary\n", + "system sectioned with one atmospheric pressure and the weight fraction\n", + "of Zn fixed at 0.01 is shown in plotted with temperature and mole\n", + "fraction of Al \\[7\\]. This phase diagram is commonly called isopleth and\n", + "is generated by fixing one potential, the pressure, $P$, changing the\n", + "chemical potentials of Al and Zn to their conjugate molar quantities\n", + "represented by weight fractions of Al and Zn, and sectioning at\n", + "$w_{Zn} = 0.01$. From the discussions in Chapter , the phase regions\n", + "with the number of phases equal to three or fewer, i.e.\n", + "$p \\leq n_{m} + 1 = 3$, have the same-dimensionality as the phase\n", + "diagram, i.e. two-dimensional in the present case, and the phase\n", + "boundary rule is applicable. The maximum number of phases co-existing at\n", + "equilibrium is given by as following for the present case\n", + "\n", + "Eq. \u2011 $p_{\\max} = \\left( c - n_{s} \\right) + 2 = 3 - 1 + 2 = 4$\n", + "\n", + "This is because introducing molar quantities only increases the\n", + "dimensionality of phase regions and does not change the maximum number\n", + "of co-existing phases.\n", + "\n", + "The dimensionality of a four-phase region is calculated from as\n", + "\n", + "Eq. \u2011\n", + "$\\upsilon_{m} = \\left( c - n_{s} \\right) + 2 - p + n_{m} - n_{ms} = 3 - 1 + 2 - 4 + 2 - 1 = 1$\n", + "\n", + "where $n_{ms}$ is the number of sectioned molar quantities. Since the\n", + "dimensionality of a four-phase region is lower than that of the phase\n", + "diagram, the phase boundary rule cannot be applied directly. Such a\n", + "four-phase region, liquid+Mg+\u03b3+\u03c6, is shown in between three three-phase\n", + "regions of liquid+Mg+\u03b3, liquid+Mg+\u03c6, and Mg+\u03b3+\u03c6.\n", + "\n", + "Figure \u2011: Isopleth with the weight fraction of Zn fixed at 0.01 of the\n", + "Mg-Al-Zn ternary system.\n", + "\n", + "also displays information on what phases are in equilibrium for a given\n", + "alloy at various temperatures. One example is shown by the dotted\n", + "vertical line marking the weight fraction of Al being 0.09, a widely\n", + "used Mg alloy called AZ91. Various phases are present at different\n", + "temperature ranges, but the equilibrium phase fractions and phase\n", + "compositions are not shown in the figure as the tie-lines are not in the\n", + "plane of the phase diagram and have to be calculated at each temperature\n", + "individually. shows the amount of each phase of the AZ91 alloy as a\n", + "function of temperature with the dotted lines depicting the values under\n", + "the equilibrium condition and the solid lines depicting the values under\n", + "the so-called Scheil condition assuming no diffusion in solid phases and\n", + "infinitelyfast diffusion in liquid. Similarly, the composition of each\n", + "phase can also be plotted as shown in .\n", + "\n", + "Figure \u2011: Mole fraction of individual phases under equilibrium (dotted\n", + "curves) and Scheil (solid curves) conditions in the AZ91 alloy\n", + "\n", + "Figure \u2011: Mass fraction of Al and Zn in the Mg solid solution phase\n", + "under equilibrium (dotted curves) and Scheil (solid curves) conditions\n", + "in AZ91\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/potential_phase_diagrams.ipynb b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/potential_phase_diagrams.ipynb new file mode 100644 index 0000000..021ee87 --- /dev/null +++ b/src/psu410/src/psu410/phase_equilibria_in_heterogeneous_systems/potential_phase_diagrams.ipynb @@ -0,0 +1,400 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "f2770bd3", + "cell_type": "markdown", + "source": [ + "## Potential phase diagrams\n", + "\n", + "Gibbs phase rule can be further understood through the\n", + "$c + 2$-dimensional space of potentials consisting of $T$, $- P$, and\n", + "$\\mu_{i}$ with $i$ from 1 to $c$. Each phase is a $c + 1$-dimensional\n", + "feature in this $c + 2$-dimensional space characterized by . The\n", + "directions of this $c + 1$-dimensional feature are represented by their\n", + "molar quantities as shown by following equations,\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial\\mu_{i}}{\\partial T} \\right)_{P,\\mu_{j \\neq i}} = - \\frac{S^{\\beta}}{N_{i}^{\\beta}} = - \\frac{S_{m}^{\\beta}}{x_{i}^{\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial\\mu_{i}}{\\partial( - P)} \\right)_{T,\\mu_{j \\neq i}} = - \\frac{V^{\\beta}}{N_{i}^{\\beta}} = - \\frac{V_{m}^{\\beta}}{x_{i}^{\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\ \\left( \\frac{\\partial( - P)}{\\partial T} \\right)_{\\mu_{i}} = - \\frac{S^{\\beta}}{V^{\\beta}} = - \\frac{S_{m}^{\\beta}}{V_{m}^{\\beta}}$\n", + "\n", + "As can be seen, all the direction derivatives are negative, indicating\n", + "that the $c + 1$-dimensional feature is convex. The intercept of any two\n", + "$c + 1$-dimensional features is thus a $c$-dimensional feature. On this\n", + "$c$-dimensional feature, these two phases are in equilibrium with each\n", + "other because each potential has the same value in both phases. This\n", + "feature thus represents a two-phase equilibrium. By the same token, the\n", + "intercept of any three $c + 1$-dimensional features is a\n", + "$c - 1$-dimensional feature in the $c + 2$-dimensional space of\n", + "potentials and represents a three-phase equilibrium. This continues\n", + "until the number of phases reaches $c + 2$ with all $c + 2$ potentials\n", + "completely determined, and the dimension of their intercepts becomes\n", + "zero.\n", + "\n", + "Those $c + 1$ to zero-dimensional geometrical features in the\n", + "$c + 2$-dimensional space of potentials thus denote one-phase,\n", + "two-phase, three-phase to $(c + 2)$-phase equilibria of the system with\n", + "the dimensionality of the feature and the number of phases in\n", + "equilibrium related by , i.e. Gibbs phase rule. Their arrangements in\n", + "the $c + 2$-dimensional space of potentials thus depict the phase\n", + "relations in the system and are commonly called phase diagrams. Since\n", + "all the diagram axes in the phase diagram discussed above are\n", + "potentials, the diagram is called potential phase diagram in order to\n", + "differentiate it from phase diagrams with some or all diagram axes being\n", + "their conjugate molar quantities. Both potential and molar phase\n", + "diagrams are discussed in this chapter.\n" + ], + "metadata": {} + }, + { + "id": "c4d45002", + "cell_type": "markdown", + "source": [ + "### Potential phase diagrams of one-component systems\n", + "\n", + "As physical vision of human being is limited to three-dimensions, only\n", + "one-component system can be completely visualized as shown in for one\n", + "phase where any two of the three potentials can change independently.\n", + "From Gibbs phase rule, when two phases are in equilibrium, only one\n", + "potential can vary freely if the two-phase equilibrium is to be\n", + "maintained. While three phases are in equilibrium, the degree of freedom\n", + "is zero, and all three potentials are fixed.\n", + "\n", + "For a two-phase equilibrium, two surfaces intersect each other as\n", + "depicted by the dashed line in . This two-phase equilibrium line is\n", + "obtained by applying to both phases in a one-component system. Since one\n", + "of the potentials is dependent on the other two, one can eliminate it by\n", + "dividing the equation by its conjugate molar quantity and subtracting\n", + "the two equations, resulting in the following three equations\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{S^{\\alpha}}{N_{A}^{\\alpha}} - \\frac{S^{\\beta}}{N_{A}^{\\beta}} \\right)dT + \\left( \\frac{V^{\\alpha}}{N_{A}^{\\alpha}} - \\frac{V^{\\beta}}{N_{A}^{\\beta}} \\right)d( - P) = \\mathrm{\\Delta}S_{m}^{\\alpha\\beta}dT + \\mathrm{\\Delta}V_{m}^{\\alpha\\beta}d( - P)$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{S^{\\alpha}}{V^{\\alpha}} - \\frac{S^{\\beta}}{V^{\\beta}} \\right)dT + \\left( \\frac{N_{A}^{\\alpha}}{V^{\\alpha}} - \\frac{N_{A}^{\\beta}}{V^{\\beta}} \\right){d\\mu}_{A} = \\mathrm{\\Delta}\\left( \\frac{S_{m}}{V_{m}} \\right)^{\\alpha\\beta}dT + \\mathrm{\\Delta}\\left( \\frac{1}{V_{m}} \\right)^{\\alpha\\beta}{d\\mu}_{A}$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{V^{\\alpha}}{S^{\\alpha}} - \\frac{V^{\\beta}}{S^{\\beta}} \\right)d( - P) + \\left( \\frac{N_{A}^{\\alpha}}{S^{\\alpha}} - \\frac{N_{A}^{\\beta}}{S^{\\beta}} \\right){d\\mu}_{A} = \\mathrm{\\Delta}\\left( \\frac{V_{m}}{S_{m}} \\right)^{\\alpha\\beta}d( - P) + \\mathrm{\\Delta}\\left( \\frac{1}{S_{m}} \\right)^{\\alpha\\beta}{d\\mu}_{A}$\n", + "\n", + "Figure \u2011: Gibbs energy surfaces of two phases and their intersection,\n", + "representing the two-phase equilibrium.\n", + "\n", + "The directions of the two-phase equilibrium line can thus be obtained as\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{dT} = - \\frac{\\mathrm{\\Delta}S_{m}^{\\alpha\\beta}}{\\mathrm{\\Delta}V_{m}^{\\alpha\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{A}} = - \\frac{\\mathrm{\\Delta}\\left( \\frac{1}{V_{m}} \\right)^{\\alpha\\beta}}{\\mathrm{\\Delta}\\left( \\frac{S_{m}}{V_{m}} \\right)^{\\alpha\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{{d\\mu}_{A}} = - \\frac{\\mathrm{\\Delta}\\left( \\frac{1}{S_{m}} \\right)^{\\alpha\\beta}}{\\mathrm{\\Delta}\\left( \\frac{V_{m}}{S_{m}} \\right)^{\\alpha\\beta}}$\n", + "\n", + "These three equations define the mathematical forms of the two-phase\n", + "equilibrium line in the two-dimensional spaces of $T - ( - P)$,\n", + "$\\mu_{A} - T$ and $\\mu_{A} - ( - P)$, respectively, and can thus be\n", + "plotted as two-dimensional diagrams. is commonly called\n", + "Clausius-Clapeyron equation in the literature. One may thus call all\n", + "three equations above as generalized Clausius-Clapeyron equations. At\n", + "equilibrium, the chemical potentials of the component in both phases are\n", + "equal to each other, so are their Gibbs energies. One thus has\n", + "\n", + "Eq. \u2011\n", + "$G_{m}^{\\alpha} - G_{m}^{\\beta} = 0 = \\mathrm{\\Delta}G_{m} = \\mathrm{\\Delta}H_{m}^{\\alpha\\beta} - T\\mathrm{\\Delta}S_{m}^{\\alpha\\beta}$\n", + "\n", + "The Clausius-Clapeyron equation, , can be re-written as\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{dT} = - \\frac{\\mathrm{\\Delta}H_{m}^{\\alpha\\beta}}{T\\mathrm{\\Delta}V_{m}^{\\alpha\\beta}}$\n", + "\n", + "As an example, three potential phase diagrams of pure Fe are shown in .\n", + "There are four phases in the system, bcc, fcc, hcp, and liquid. In the\n", + "literature, the high temperature and low temperature bcc phases are\n", + "usually denoted by \u03b4 (high temperature) and \u03b1 (low temperature), the fcc\n", + "and hcp phases by \u03b3 and \u03b5, and the liquid phase by L, respectively. In\n", + "these figures, the two-dimensional areas are single-phase regions where\n", + "two potentials can change independently with the system remaining as\n", + "single-phase. The lines denote two-phase equilibrium regions where only\n", + "one potential can vary independently if the two-phase equilibrium is to\n", + "be maintained. The points where three two-phase equilibrium lines meet\n", + "represent the invariant three-phase equilibria with three potentials\n", + "fixed.\n", + "\n", + "Figure \u2011 $T - ( - P)$, $\\mu_{A} - T$ and $\\mu_{A} - ( - P)$ phase\n", + "diagrams of pure Fe\n", + "\n", + "Based on the discussions in Chapter , enthalpy and entropy of a phase\n", + "increase monotonically with temperature, and phases stable at higher\n", + "temperatures have higher enthalpy and entropy than phases stable at\n", + "lower temperatures. Consequently, the two-phase equilibrium lines in a\n", + "$T - ( - P)$ potential phase diagram have negative slopes if the phase\n", + "stable at higher temperatures also has larger molar volume than the\n", + "phase stable at lower temperatures (note that if $P$ is plotted instead\n", + "of $- P$, the slope is positive). This is the case for the two-phase\n", + "equilibrium lines of \u03b4/L, \u03b3/L, and \u03b3/\u03b4 at high temperatures, and \u03b5/\u03b3\n", + "shown in a. On the other hand, the two-phase equilibrium lines of \u03b1/\u03b5\n", + "and \u03b1/\u03b3 at low temperatures have positive slopes, indicating that \u03b5 and\n", + "\u03b3 have smaller molar volume than \u03b1 as \u03b5 and \u03b3 are more stable at higher\n", + "pressures than \u03b1 at constant temperatures. It is thus evident that the\n", + "phase stable at higher pressure can have either higher or lower entropy\n", + "than the phase stable at lower pressure, and the phase stable at higher\n", + "temperature can have either higher or lower volume than the phase stable\n", + "at lower temperature. This is the property anomaly discussed in Chapter\n", + ".\n", + "\n", + "Another useful example of potential phase diagram is the\n", + "pressure-temperature phase diagram of $H_{2}O$ shown in with three\n", + "phases: ice, water, and vapour. It is known that the solid ice has many\n", + "polymorphic structures at high pressures, which are not included in this\n", + "diagram. As in the pure Fe potential phase diagram discussed above, the\n", + "single-phase regions of ice, water, and vapour are represented by the\n", + "two-dimensional areas with two-degree of freedom based on the Gibbs\n", + "phase rule, the lines are for the two-phase regions of ice-water,\n", + "ice-vapour, and water-vapour, and the three-phase equilibrium has\n", + "zero-degree of freedom represented by a point at $273.16\\ K$ and\n", + "$611.73\\ Pa$.\n", + "\n", + "There are two features in which are different from those of Fe shown in\n", + "a. The first feature is that the slope of the liquid-solid two-phase\n", + "equilibrium line in has the opposite sign of that in a. This is because\n", + "solid ice has larger molar volume than liquid water, while the molar\n", + "volume of liquid Fe is larger than those of fcc-Fe and bcc-Fe. The\n", + "second feature is that the two-phase equilibrium line of water-vapour\n", + "ends at $647\\ K$ and $22.064 \\cdot 10^{6}\\ Pa$. Beyond this point, the\n", + "difference between vapour and water disappears when the pressure and\n", + "temperature are changed, i.e. it behaves like one phase. This point is a\n", + "critical point, as discussed in Chapter . However, it should be pointed\n", + "out that it does not represent an invariant reaction as the degree of\n", + "freedom based on the Gibbs phase rule is equal to one and not zero. On\n", + "the other hand, both the temperature and pressure of the critical point\n", + "are invariant due to the two constraints introduced by the limit of\n", + "stability of a single phase, i.e. the second and third derivatives of\n", + "temperature to entropy or pressure to volume are zero.\n", + "\n", + "Figure \u2011: P-T phase diagram of $H_{2}O$\n" + ], + "metadata": {} + }, + { + "id": "a261a7d1", + "cell_type": "markdown", + "source": [ + "### Potential phase diagrams of two-component systems\n", + "\n", + "From Gibbs-Duhem equation (see ), a single phase in a two-component\n", + "system has three independent potentials, out of the four potentials of\n", + "$T$, $- P$, $\\mu_{A}$, and $\\mu_{B}$, and is a three-dimensional\n", + "geometric feature in a four-dimensional space. Alternatively, it can be\n", + "represented by a three-dimensional space constructed by the three\n", + "independent potentials. A two-phase equilibrium is thus a\n", + "two-dimensional surface in this three-dimensional space created by the\n", + "intercept of two three-dimensional spaces, and a three-phase equilibrium\n", + "is a one-dimensional line, and a four-phase equilibrium is a\n", + "zero-dimensional point. This is shown in for the Fe-C binary system\n", + "involving four phases: fcc, bcc, Fe3C and graphite. Since any\n", + "one of the four potentials can be chosen as the dependent one, four\n", + "three-dimensional potential phase diagrams are depicted in .\n", + "\n", + "Figure \u2011: Projected potential phase diagram of Fe-C system with fcc,\n", + "bcc, Fe3C, and graphite\n", + "\n", + "The two-phase equilibrium surfaces are obtained by choosing any one of\n", + "the four potentials as the dependent one and solving the Gibbs-Duhem\n", + "equations for both phases, resulting in following four equations\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{S^{\\alpha}}{N_{A}^{\\alpha}} - \\frac{S^{\\beta}}{N_{A}^{\\beta}} \\right)dT + \\left( \\frac{V^{\\alpha}}{N_{A}^{\\alpha}} - \\frac{V^{\\beta}}{N_{A}^{\\beta}} \\right)d( - P) + \\left( \\frac{N_{B}^{\\alpha}}{N_{A}^{\\alpha}} - \\frac{N_{B}^{\\beta}}{N_{A}^{\\beta}} \\right){d\\mu}_{B} = \\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}dT + \\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}d( - P) + \\mathrm{\\Delta}z_{B}^{\\alpha\\beta}{d\\mu}_{B}$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{S^{\\alpha}}{N_{B}^{\\alpha}} - \\frac{S^{\\beta}}{N_{B}^{\\beta}} \\right)dT + \\left( \\frac{V^{\\alpha}}{N_{B}^{\\alpha}} - \\frac{V^{\\beta}}{N_{B}^{\\beta}} \\right)d( - P) + \\left( \\frac{N_{B}^{\\alpha}}{N_{B}^{\\alpha}} - \\frac{N_{B}^{\\beta}}{N_{B}^{\\beta}} \\right){d\\mu}_{B} = \\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}dT + \\mathrm{\\Delta}V_{mB}^{\\alpha\\beta}d( - P) + \\mathrm{\\Delta}z_{A}^{\\alpha\\beta}{d\\mu}_{A}$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{S^{\\alpha}}{V^{\\alpha}} - \\frac{S^{\\beta}}{V^{\\beta}} \\right)dT + \\left( \\frac{N_{A}^{\\alpha}}{V^{\\alpha}} - \\frac{N_{A}^{\\beta}}{V^{\\beta}} \\right){d\\mu}_{A} + \\left( \\frac{N_{B}^{\\alpha}}{V^{\\alpha}} - \\frac{N_{B}^{\\beta}}{V^{\\beta}} \\right){d\\mu}_{B} = \\mathrm{\\Delta}\\left( \\frac{S_{m}}{V_{m}} \\right)^{\\alpha\\beta}dT + \\mathrm{\\Delta}\\left( \\frac{1}{V_{mA}} \\right)^{\\alpha\\beta}{d\\mu}_{A} + \\mathrm{\\Delta}\\left( \\frac{1}{V_{mB}} \\right)^{\\alpha\\beta}{d\\mu}_{B}$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\frac{V^{\\alpha}}{S^{\\alpha}} - \\frac{V^{\\beta}}{S^{\\beta}} \\right)d( - P) + \\left( \\frac{N_{A}^{\\alpha}}{S^{\\alpha}} - \\frac{N_{A}^{\\beta}}{S^{\\beta}} \\right){d\\mu}_{A} + \\left( \\frac{N_{B}^{\\alpha}}{S^{\\alpha}} - \\frac{N_{B}^{\\beta}}{S^{\\beta}} \\right){d\\mu}_{B} = \\mathrm{\\Delta}\\left( \\frac{V_{m}}{S_{m}} \\right)^{\\alpha\\beta}d( - P) + \\mathrm{\\Delta}\\left( \\frac{1}{S_{mA}} \\right)^{\\alpha\\beta}{d\\mu}_{A} + \\mathrm{\\Delta}\\left( \\frac{1}{S_{mB}} \\right)^{\\alpha\\beta}{d\\mu}_{B}$\n", + "\n", + "A three-phase equilibrium line is represented by the intercept of two\n", + "two-phase surfaces by applying any one of the above four equations to\n", + "two two-phase equilibria. Let us use as an example\n", + "\n", + "Eq. \u2011\n", + "$0 = \\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}dT + \\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}d( - P) + {\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}{d\\mu}_{B}$\n", + "\n", + "Eq. \u2011\n", + "$0 = \\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma}dT + \\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma}d( - P) + \\mathrm{\\Delta}{z_{B}^{\\alpha\\gamma}d\\mu}_{B}$\n", + "\n", + "It is self-evident that the two-phase equilibrium surface between\n", + "$\\beta$ and $\\gamma$ is not independent and can be obtained by\n", + "subtraction of and\n", + "\n", + "Eq. \u2011\n", + "$0 = \\left( \\mathrm{\\Delta}S_{mA}^{\\alpha\\beta} - \\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma} \\right)dT + \\left( \\mathrm{\\Delta}V_{mA}^{\\alpha\\beta} - \\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma} \\right)d( - P) + \\left( {\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta} - \\mathrm{\\Delta}z_{B}^{\\alpha\\gamma} \\right){d\\mu}_{B} = \\mathrm{\\Delta}S_{mA}^{\\gamma\\beta}dT + \\mathrm{\\Delta}V_{mA}^{\\gamma\\beta}d( - P) + {\\mathrm{\\Delta}z}_{B}^{\\gamma\\beta}{d\\mu}_{B}$\n", + "\n", + "Eliminating one of three potentials in and , one can obtain three\n", + "equations for the three-phase equilibrium line\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{dT} = - \\frac{\\frac{\\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}}{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma}}{\\mathrm{\\Delta}z_{B}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}}{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma}}{\\mathrm{\\Delta}z_{B}^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}}{\\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}z_{B}^{\\alpha\\gamma}}{\\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}}{\\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma}}{\\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}z_{B}^{\\alpha\\gamma}}{\\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}V_{mA}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}V_{mA}^{\\alpha\\gamma}}{\\mathrm{\\Delta}S_{mA}^{\\alpha\\gamma}}}$\n", + "\n", + "to can be referred as generalized Clausius-Clapeyron equations for\n", + "binary systems. Similar equations can be derived for\n", + "$T - ( - P) - \\mu_{A}$, $T - \\mu_{A} - \\mu_{B}$, and\n", + "$( - P) - \\mu_{A} - \\mu_{B}$ potential phase diagrams from to , and are\n", + "listed below\n", + "\n", + "- Generalized Clausius-Clapeyron equations for a three-phase equilibrium\n", + " in $T - ( - P) - \\mu_{A}$ potential phase diagrams\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{dT} = - \\frac{\\frac{\\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}}{{\\mathrm{\\Delta}z}_{A}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}S_{mB}^{\\alpha\\gamma}}{\\mathrm{\\Delta}z_{A}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}V_{mB}^{\\alpha\\beta}}{{\\mathrm{\\Delta}z}_{A}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}V_{mB}^{\\alpha\\gamma}}{\\mathrm{\\Delta}z_{A}^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{A}} = - \\frac{\\frac{{\\mathrm{\\Delta}z}_{A}^{\\alpha\\beta}}{\\mathrm{\\Delta}V_{mB}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}z_{A}^{\\alpha\\gamma}}{\\mathrm{\\Delta}V_{mB}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}}{\\mathrm{\\Delta}V_{mB}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}S_{mB}^{\\alpha\\gamma}}{\\mathrm{\\Delta}V_{mB}^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{{d\\mu}_{A}} = - \\frac{\\frac{{\\mathrm{\\Delta}z}_{A}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}z_{A}^{\\alpha\\gamma}}{\\mathrm{\\Delta}S_{mB}^{\\alpha\\gamma}}}{\\frac{\\mathrm{\\Delta}V_{mB}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}} - \\frac{\\mathrm{\\Delta}V_{mB}^{\\alpha\\gamma}}{\\mathrm{\\Delta}S_{mB}^{\\alpha\\gamma}}}$\n", + "\n", + "- Generalized Clausius-Clapeyron equations for a three-phase equilibrium\n", + " in $\\ T - \\mu_{A} - \\mu_{B}$ potential phase diagrams\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{A}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{{d\\mu}_{A}}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/V_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/V_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( S_{m}/V_{m} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n", + "\n", + "- Generalized Clausius-Clapeyron equations for a three-phase equilibrium\n", + " in $( - P) - \\mu_{A} - \\mu_{B}$ potential phase diagrams\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{{d\\mu}_{A}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{d( - P)}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{{d\\mu}_{A}}{{d\\mu}_{B}} = - \\frac{\\frac{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/S_{mB} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\gamma}}}{\\frac{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\beta}}{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\beta}} - \\frac{{\\mathrm{\\Delta}\\left( 1/S_{mA} \\right)}_{\\ }^{\\alpha\\gamma}}{{\\mathrm{\\Delta}\\left( V_{m}/S_{m} \\right)}_{\\ }^{\\alpha\\gamma}}}$\n" + ], + "metadata": {} + }, + { + "id": "a8f22c51", + "cell_type": "markdown", + "source": [ + "### Section of potential phase diagrams\n", + "\n", + "Based on the Gibbs-Duhem equation (see ), a single-phase equilibrium in\n", + "a system with more than two independent components has more than three\n", + "independent potentials. There is no problem in representing them using\n", + "the mathematical formulas discussed so far, but it is not possible for\n", + "us to visualize graphically the full potential phase diagrams in\n", + "multi-component systems with more than two independent components. In\n", + "principles, there are two options. One option is to project the\n", + "multi-dimensional potential phase diagram into a two- or three-dimension\n", + "diagram, and another option is to section the multi-dimensional\n", + "potential phase diagram by fixing the values of some potentials.\n", + "\n", + "The projection approach is used for one-component systems in Chapter .\n", + "Since a two-phase equilibrium in a one-component potential phase diagram\n", + "is one-dimensional, the projection does not lose any information, and\n", + "the same is true for a three-phase equilibrium in a one-component\n", + "potential phase diagram. In a binary system, the projections of three-\n", + "and four-phase equilibria do not lose any information, while the\n", + "projections of two-phase equilibria become two-dimensional and cannot\n", + "retain all the information as the original-dimensionality of these\n", + "two-phase equilibria is three. Consequently, sectioning at fixed values\n", + "of some potentials is necessary in order to visualize the phase\n", + "relations in systems with two or more components. Gibbs phase rule shown\n", + "in and are thus modified to\n", + "\n", + "Eq. \u2011 $\\upsilon = c + 2 - p - n_{s} = \\left( c - n_{s} \\right) + 2 - p$\n", + "\n", + "Eq. \u2011 $p_{\\max} = \\left( c - n_{s} \\right) + 2$\n", + "\n", + "where $n_{s}$ is the number of potentials fixed in sectioning. As can be\n", + "seen in the last part of , the number of sectioning is equivalent to the\n", + "reduction of the effective number of independent components. Therefore,\n", + "any multi-component systems with $n_{s} = c - i$ behave like an\n", + "$i$-component system. The equations presented in Chapter and are thus\n", + "directly applicable to multi-component systems with $n_{s} = c - 1$ and\n", + "$n_{s} = c - 2$, respectively.\n", + "\n", + "A common practice in experiments is to fix pressure, temperature or\n", + "chemical potentials of volatile components as they are usually the\n", + "variables controlled experimentally. In a binary system, the potential\n", + "phase diagram at constant pressure can be represented by any two of the\n", + "three potentials, i.e. two chemical potentials and temperature, with the\n", + "remaining potential being dependent, and has the identical morphology as\n", + "a one-component system. The Gibbs-Duhem equation under such conditions\n", + "becomes\n", + "\n", + "Eq. \u2011 $0 = - SdT - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B}$\n", + "\n", + "The corresponding two-phase Clausius-Clapeyron equations are written as\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{A}} = - \\frac{{\\mathrm{\\Delta}z}_{A}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mB}^{\\alpha\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{dT}{{d\\mu}_{B}} = - \\frac{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}}{\\mathrm{\\Delta}S_{mA}^{\\alpha\\beta}}$\n", + "\n", + "Eq. \u2011\n", + "$\\frac{{d\\mu}_{A}}{{d\\mu}_{B}} = - \\frac{\\mathrm{\\Delta}\\left( \\frac{1}{S_{mB}^{}} \\right)^{\\alpha\\beta}}{\\mathrm{\\Delta}\\left( \\frac{1}{S_{mA}^{}} \\right)^{\\alpha\\beta}}$\n", + "\n", + "As an example, the $T$-$\\mu_{C}$ potential phase diagram for the Fe-C\n", + "binary system at one atmospheric pressure is shown in .\n", + "\n", + "Figure \u2011: $T$-$\\mu_{C}$ potential phase diagram for the Fe-C binary\n", + "system at $P = 1atm$\n", + "\n", + "In a ternary system, two potentials need to be fixed in order to obtain\n", + "two-dimensional potential phase diagrams. When the pressure and the\n", + "chemical potential of one species are fixed, the system behaves like a\n", + "binary system discussed above. When the system temperature and pressure\n", + "are fixed, the Gibbs-Duhem equation is written as\n", + "\n", + "Eq. \u2011 $0 = - {N_{A}d\\mu}_{A} - {N_{B}d\\mu}_{B} - {N_{C}d\\mu}_{C}$\n", + "\n", + "Taking the component A as the dependent element, the two-phase\n", + "Clausius-Clapeyron equation is simplified as\n", + "\n", + "Eq. \u2011\n", + "$\\frac{{d\\mu}_{B}}{{d\\mu}_{C}} = \\frac{d\\left( \\ln a_{B} \\right)}{d\\left( \\ln a_{C} \\right)} = - \\frac{\\mathrm{\\Delta}z_{C}^{\\alpha\\beta}}{{\\mathrm{\\Delta}z}_{B}^{\\alpha\\beta}}$\n", + "\n", + "When the two phases in equilibrium are stoichiometric phases, the\n", + "two-phase equilibrium is thus a straight line. For example, the Ti-O-Cl\n", + "potential phase diagram at 600\u00b0C and one atmospheric pressure is shown\n", + "in . Since both O and Cl are volatile components, their activities are\n", + "usually represented by their partial pressures with the pure\n", + "O2 and Cl2 gas as their respective reference\n", + "states at the given temperature and pressure.\n", + "\n", + "Figure \u2011: Ti-O-Cl potential phase diagram at 600\u00b0C and one atmospheric\n", + "pressure\n", + "\n", + "For systems with more than three components, the chemical potentials of\n", + "one or more components must be fixed in order to obtain a\n", + "two-dimensional potential phase diagram similar to the potential phase\n", + "diagrams discussed above.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/src/psu410/src/psu410/references/index.ipynb b/src/psu410/src/psu410/references/index.ipynb new file mode 100644 index 0000000..251b924 --- /dev/null +++ b/src/psu410/src/psu410/references/index.ipynb @@ -0,0 +1,274 @@ +{ + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {}, + "cells": [ + { + "id": "f5ad9e97", + "cell_type": "markdown", + "source": [ + "# References\n", + "\n", + "1\\. M. Hillert, *Phase Equilibria, Phase Diagrams and Phase\n", + "Transformations,* Cambridge University Press, Cambridge, ed. 2nd, 2007.\n", + "\n", + "2\\. E. A. Guggenheim, *Mixtures,* Clarendon Press, Oxford, 1952.\n", + "\n", + "3\\. J. F. Nye, *Physical properties of crystals : their representation\n", + "by tensors and matrices* Clarendon, Oxford, New York, 1985.\n", + "\n", + "4\\. L. S. Palatnik and A. I. Landau, *Phase Equilibria in Multicomponent\n", + "Systems,* Holt, Rinehart and Winston, Inc., 1964.\n", + "\n", + "5\\. M. Hillert, \"Principles of Phase Diagrams\", *Intern. Metals Rev.*\n", + "**30** (1985) 45-67.\n", + "\n", + "6\\. Z. K. Liu and Y. A. Chang, \"Thermodynamic assessment of the Al-Fe-Si\n", + "system\", *Metall. Mater. Trans. A-Phys. Metall. Mater. Sci.* **30**\n", + "(1999) 1081-1095.\n", + "\n", + "7\\. Z. K. Liu, \"Design magnesium alloys: how computational\n", + "thermodynamics can help\", H. I. Kaplan, J. N. Hryn, B. B. Clow, Eds.,\n", + "*Magnesium Technology 2000*, Nashville, TN, USA, ***TMS, PA, USA***,\n", + "2000, 2000, pp. 191-198.\n", + "\n", + "8\\. W. Kohn and L. J. Sham, \"SELF-CONSISTENT EQUATIONS INCLUDING\n", + "EXCHANGE AND CORRELATION EFFECTS\", *Phys. Rev.* **140** (1965) A1133-38.\n", + "\n", + "9\\. A. R. H. Goodwin, K. N. Marsh and W. A. Wakeham, Eds., *Measurement\n", + "of the thermodynamic properties of single phases,* Elsevier, Amsterdam,\n", + "The Netherlands, 2003.\n", + "\n", + "10\\. R. D. Weir and T. W. d. Loos, Eds., *Measurement of the\n", + "thermodynamic properties of multiple phases,* Elsevier, Amsterdam, The\n", + "Netherlands, 2005.\n", + "\n", + "11\\. J.-C. Zhao, Ed., *Methods for phase diagram determination,*\n", + "Elsevier, Amsterdam, The Netherlands, 2007.\n", + "\n", + "12\\. K. N. Marsh and P. A. G. O'Hare, Eds., *Solution calorimetry,*\n", + "Blackwell Scientific Publications, 1994.\n", + "\n", + "13\\. G. Kresse and D. Joubert, \"From ultrasoft pseudopotentials to the\n", + "projector augmented-wave method\", *Phys. Rev. B* **59** (1999)\n", + "1758-1775.\n", + "\n", + "14\\. G. Kresse and J. Furthmuller, \"Efficiency of ab-initio total energy\n", + "calculations for metals and semiconductors using a plane-wave basis\n", + "set\", *Comput. Mater. Sci.* **6** (1996) 15-50.\n", + "\n", + "15\\. Y. Wang, L.-Q. Chen and Z.-K. Liu, \"YPHON: A package for\n", + "calculating phonons of polar materials\", *Commun.Comput. Phys.* **185**\n", + "(2014) 2950-2968.\n", + "\n", + "16\\. Y. Wang, Z. K. Liu and L. Q. Chen, \"Thermodynamic properties of Al,\n", + "Ni, NiAl, and Ni3Al from first-principles calculations\", *Acta Mater.*\n", + "**52** (2004) 2665-2671.\n", + "\n", + "17\\. D. M. Teter, G. V. Gibbs, M. B. Boisen, D. C. Allan and M. P.\n", + "Teter, \"FIRST-PRINCIPLES STUDY OF SEVERAL HYPOTHETICAL SILICA FRAMEWORK\n", + "STRUCTURES\", *Phys. Rev. B* **52** (1995) 8064-8073.\n", + "\n", + "18\\. S. L. Shang, Y. Wang, D. Kim and Z. K. Liu, \"First-principles\n", + "thermodynamics from phonon and Debye model: Application to Ni and\n", + "Ni3Al\", *Comput. Mater. Sci.* **47** (2010) 1040-1048.\n", + "\n", + "19\\. J. J. Xie, S. de Gironcoli, S. Baroni and M. Scheffler,\n", + "\"First-principles calculation of the thermal properties of silver\",\n", + "*Phys. Rev. B* **59** (1999) 965-969.\n", + "\n", + "20\\. A. van de Walle, M. Asta and G. Ceder, \"The Alloy Theoretic\n", + "Automated Toolkit: A user guide\", *CALPHAD* **26** (2002) 539-553.\n", + "\n", + "21\\. D. Alfe, \"PHON: A program to calculate phonons using the small\n", + "displacement method\", *Comput. Phys. Commun.* **180** (2009) 2622-2633.\n", + "\n", + "22\\. M. Kresch, O. Delaire, R. Stevens, J. Y. Y. Lin and B. Fultz,\n", + "\"Neutron scattering measurements of phonons in nickel at elevated\n", + "temperatures\", *Phys. Rev. B* **75** (2007) 104301.\n", + "\n", + "23\\. M. Born and K. Huang, *Dynamical Theory of Crystal Lattices,*\n", + "Clarendn, Oxford, 1954.\n", + "\n", + "24\\. B. Fultz, L. Anthony, L. J. Nagel, R. M. Nicklow and S. Spooner,\n", + "\"Phonon Densities of States and Vibrational Entropies of Ordered and\n", + "Disordered Ni3al\", *Phys. Rev. B* **52** (1995) 3315-3321.\n", + "\n", + "25\\. M. Mostoller, R. M. Nicklow, D. M. Zehner, S. C. Lui, J. M.\n", + "Mundenar and E. W. Plummer, \"Bulk and Surface Vibrational-Modes in\n", + "Nial\", *Phys. Rev. B* **40** (1989) 2856-2872.\n", + "\n", + "26\\. C. Statassis, F. X. Kayser, C.-K. Loong and D. Rach, \"Lattice\n", + "dynamics of Ni3Al\", *Phys. Rev. B* **24** (1981) 3048-3054.\n", + "\n", + "27\\. M. E. Manley, G. H. Lander, H. Sinn, A. Alatas, W. L. Hults, R. J.\n", + "McQueeney, J. L. Smith and J. Willit, \"Phonon dispersion in uranium\n", + "measured using inelastic x-ray scattering\", *Phys. Rev. B* **67** (2003)\n", + "052302.\n", + "\n", + "28\\. Y. Wang, J. J. Wang, H. Zhang, V. R. Manga, S. L. Shang, L. Q. Chen\n", + "and Z. K. Liu, \"A First-principles Approach to Elasticity at Finite\n", + "Temperatures\", *J. Phys. Cond. Mat.* **22** (2010) 225404.\n", + "\n", + "29\\. J. C. Slater, \"A SIMPLIFICATION OF THE HARTREE-FOCK METHOD\", *Phys.\n", + "Rev.* **81** (1951) 385-390.\n", + "\n", + "30\\. J. P. Perdew and A. Zunger, \"Self-Interaction Correction to\n", + "Density-Functional Approximations for Many-Electron Systems\", *Phys.\n", + "Rev. B* **23** (1981) 5048-5079.\n", + "\n", + "31\\. J. P. Perdew and Y. Wang, \"ACCURATE AND SIMPLE ANALYTIC\n", + "REPRESENTATION OF THE ELECTRON-GAS CORRELATION-ENERGY\", *Phys. Rev. B*\n", + "**45** (1992) 13244-13249.\n", + "\n", + "32\\. J. P. Perdew, K. Burke and M. Ernzerhof, \"Generalized gradient\n", + "approximation made simple\", *Phys. Rev. Lett.* **77** (1996) 3865-3868.\n", + "\n", + "33\\. D. C. Wallace, *Thermodynamics of crystals,* Joha Wiley & Sons,\n", + "Inc., New York, London, Sydney, Toronto, 1972.\n", + "\n", + "34\\. S. Baroni, S. de Gironcoli, A. Dal Corso and P. Giannozzi, \"Phonons\n", + "and related crystal properties from density-functional perturbation\n", + "theory\", *Rev. Mod. Phys.* **73** (2001) 515-562.\n", + "\n", + "35\\. A. van de Walle and G. Ceder, \"The effect of lattice vibrations on\n", + "substitutional alloy thermodynamics\", *Rev. Mod. Phys.* **74** (2002)\n", + "11-45.\n", + "\n", + "36\\. S. Baroni, P. Giannozzi and A. Testa, \"Elastic-Constants of\n", + "Crystals from Linear-Response Theory\", *Phys. Rev. Lett.* **59** (1987)\n", + "2662-2665.\n", + "\n", + "37\\. G. Kern, G. Kresse and J. Hafner, \"Ab initio calculation of the\n", + "lattice dynamics and phase diagram of boron nitride\", *Phys. Rev. B*\n", + "**59** (1999) 8551-8559.\n", + "\n", + "38\\. Y. Wang, J. J. Wang, W. Y. Wang, Z. G. Mei, S. L. Shang, L. Q. Chen\n", + "and Z. K. Liu, \"A Mixed-space Approach to First-principles Calculations\n", + "of Phonon Frequencies for Polar Materials\", *J. Phys.-Condes. Matter*\n", + "**11** (2010) 202201.\n", + "\n", + "39\\. C. Jiang, *Ph. D. Thesis*, *Theoretical studies of aluminum and\n", + "aluminide alloys using CALPHAD and first-principles approach*, The\n", + "Pennsylvania State University 2004.\n", + "\n", + "40\\. C. Jiang, C. Wolverton, J. Sofo, L. Q. Chen and Z. K. Liu,\n", + "\"First-principles study of binary bcc alloys using special quasirandom\n", + "structures\", *Phys. Rev. B* **69** (2004) 214202.\n", + "\n", + "41\\. C. Sigli, M. Kosugi and J. Sanchez, \"Calculation of thermodynamic\n", + "properties and phase diagrams of binary transition-metal alloys\", *Phys.\n", + "Rev. Lett* **57** (1986) 253-256.\n", + "\n", + "42\\. C. Wolverton and A. Zunger, \"Ising-like description of structurally\n", + "relaxed ordered and disordered alloys\", *Phys. Rev. Lett.* **75** (1995)\n", + "3162-65.\n", + "\n", + "43\\. A. Zunger, S. H. Wei, L. G. Ferreira and J. E. Bernard, \"Special\n", + "quasirandom structures\", *Phys. Rev. Lett.* **65** (1990) 353.\n", + "\n", + "44\\. A. van de Walle, P. Tiwary, M. de Jong, D. L. Olmsted, M. Asta, A.\n", + "Dick, D. Shin, Y. Wang, L. Q. Chen and Z. K. Liu, \"Efficient stochastic\n", + "generation of special quasirandom structures\", *CALPHAD* **42** (2013)\n", + "13-18.\n", + "\n", + "45\\. Y. Wang, C. L. Zacherl, S. L. Shang, L. Q. Chen and Z. K. Liu,\n", + "\"Phonon dispersions in random alloys: a method based on special\n", + "quasi-random structure force constants\", *J. Phys.-Condes. Matter*\n", + "**23** (2011) 485403.\n", + "\n", + "46\\. B. Dutta, K. Bisht and S. Ghosh, \"Ab initio calculation of phonon\n", + "dispersions in size-mismatched disordered alloys\", *Phys. Rev. B* **82**\n", + "(2010) 134207.\n", + "\n", + "47\\. L. Kaufman and H. Bernstein, *Computer Calculation of Phase\n", + "Diagram,* Academic Press Inc., New York, 1970.\n", + "\n", + "48\\. N. Saunders and A. P. Miodownik, *CALPHAD (Calculation of Phase\n", + "Diagrams): A Comprehensive Guide,* Pergamon, Oxford; New York, 1998.\n", + "\n", + "49\\. H. L. Lukas, S. G. Fries and B. Sundman, *Computational\n", + "Thermodynamics: The CALPHAD Method,* Cambridge University Press, 2007.\n", + "\n", + "50\\. \"Software for CALPHAD modeling\", **26(2)** (2002).\n", + "\n", + "51\\. \"Software for CALPHAD modeling\", **33(2)** (2009).\n", + "\n", + "52\\. A. T. Dinsdale, \"SGTE Data for Pure Elements\", *CALPHAD* **15**\n", + "(1991) 317-425.\n", + "\n", + "53\\. Y. Wang, S. Curtarolo, C. Jiang, R. Arroyave, T. Wang, G. Ceder, L.\n", + "Q. Chen and Z. K. Liu, \"Ab initio lattice stability in comparison with\n", + "CALPHAD lattice stability\", *Calphad-Comput. Coupling Ph. Diagrams\n", + "Thermochem.* **28** (2004) 79-90.\n", + "\n", + "54\\. V. Ozolins, \"First-Principles Calculations of Free Energies of\n", + "Unstable Phases: The Case of fcc W\", *Phys. Rev. Lett.* **102** (2009)\n", + "065702.\n", + "\n", + "55\\. Y. Wang, L. G. Hector, H. Zhang, S. L. Shang, L. Q. Chen and Z. K.\n", + "Liu, \"Thermodynamics of the Ce gamma-alpha transition:\n", + "Density-functional study\", *Phys. Rev. B* **78** (2008) 104113.\n", + "\n", + "56\\. B. Sundman, I. Ohnuma, N. Dupin, U. R. Kattner and S. G. Fries, \"An\n", + "assessment of the entire Al-Fe system including D0(3) ordering\", *Acta\n", + "Mater.* **57** (2009) 2896-2908.\n", + "\n", + "57\\. A. Kusoffsky, N. Dupin and B. Sundman, \"On the compound energy\n", + "formalism applied to fcc ordering\", *Calphad-Comput. Coupling Ph.\n", + "Diagrams Thermochem.* **25** (2001) 549-565.\n", + "\n", + "58\\. T. Abe and B. Sundman, \"A description of the effect of short range\n", + "ordering in the compound energy formalism\", *Calphad-Comput. Coupling\n", + "Ph. Diagrams Thermochem.* **27** (2003) 403-408.\n", + "\n", + "59\\. Scientific Group Thermodata Europe (SGTE), *Thermodynamic\n", + "Properties of Inorganic Materials*. Lehrstuhl f\u00fcr Theoretische\n", + "H\u00fcttenkunde, Ed. Landolt-Boernstein New Series, Group IV, Springer,\n", + "Verlag Berlin Heidelberg, 1999, vol. 19.\n", + "\n", + "60\\. J. O. Andersson, T. Helander, L. H. Hoglund, P. F. Shi and B.\n", + "Sundman, \"THERMO-CALC & DICTRA, computational tools for materials\n", + "science\", **26** (2002) 273-312.\n", + "\n", + "61\\. D. D. Macdonald, \"Passivity - the key to our metals-based\n", + "civilization\", *Pure Appl. Chem.* **71** (1999) 951-978.\n", + "\n", + "62\\. J. Larcin, W. C. Maskell and F. L. Tye, \"Leclanche cell\n", + "investigations .1. Zn(NH3)(2)Cl-2 solubility and the formation of ZnCl2\n", + "center dot 4Zn(OH)(2)center dot H2O\", *Electrochim. Acta* **42** (1997)\n", + "2649-2658.\n", + "\n", + "63\\. Z. K. Liu, Y. Wang and S. L. Shang, \"Origin of negative thermal\n", + "expansion phenomenon in solids\", *Scr. Mater.* **65** (2011) 664-667.\n", + "\n", + "64\\. Y. Wang, L. G. Hector, H. Zhang, S. L. Shang, L. Q. Chen and Z. K.\n", + "Liu, \"A thermodynamic framework for a system with itinerant-electron\n", + "magnetism\", *J. Phys.-Condes. Matter* **21** (2009) 326003.\n", + "\n", + "65\\. S. L. Dudarev, G. A. Botton, S. Y. Savrasov, C. J. Humphreys and A.\n", + "P. Sutton, \"Electron-energy-loss spectra and the structural stability of\n", + "nickel oxide: An LSDA+U study\", *Phys. Rev. B* **57** (1998) 1505-1509.\n", + "\n", + "66\\. Z.-K. Liu, Y. Wang and S. Shang, \"Thermal Expansion Anomaly\n", + "Regulated by Entropy\", **4** (2014).\n", + "\n", + "67\\. Y. Wang, S. L. Shang, H. Zhang, L. Q. Chen and Z. K. Liu,\n", + "\"Thermodynamic fluctuations in magnetic states: Fe3Pt as a prototype\",\n", + "*Phil. Mag. Lett.* **90** (2010) 851-859.\n", + "\n", + "68\\. National Science and Technology Council, \u201cMaterials Genome\n", + "Initiative for Global Competitiveness\u201d,\n", + "*[http://www.whitehouse.gov/sites/default/files/microsites/ostp/materials_genome_initiative-final.pdf]()\n", + "Office of Science and Technology Policy, Washington DC*, June, 2011.\n", + "\n", + "69\\. L. Kaufman and J. Agren, \"CALPHAD, first and second generation -\n", + "Birth of the materials genome\", **70** (2014) 3-6.\n", + "\n", + "70\\. Z. K. Liu, \"Perspective on Materials Genome\u00ae\", *Chin. Sci. Bull.*\n", + "**59** (2014) 1619-1623.\n" + ], + "metadata": {} + } + ] +} \ No newline at end of file