/*
 * evans_droplet.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 12 2026, 08:40 by COMSOL 6.4.0.418. */
public class evans_droplet {

  public static Model run() {
    Model model = ModelUtil.create("Model");

//    From the File menu, choose New.
//    In the New window, click Model Wizard.
//    In the Model Wizard window, click 2D Axisymmetric.
//    In the Select Physics tree, select Electrochemistry > Aqueous Electrolyte Transport (aqt).
//    Click Add.
//    Click Study.
//    In the Select Study tree, select Preset Studies for Selected Physics Interfaces > Time Dependent with Initialization.
//    Click Done.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 2);
    model.component("comp1").geom("geom1").axisymmetric(true);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").physics().create("aqt", "AqueousElectrolyteTransport", "geom1");

    model.study().create("std1");
    model.study("std1").create("cdi", "CurrentDistributionInitialization");
    model.study("std1").feature("cdi").set("solnum", "auto");
    model.study("std1").feature("cdi").set("notsolnum", "auto");
    model.study("std1").feature("cdi").set("outputmap", new String[]{});
    model.study("std1").feature("cdi").set("ngenAUX", "1");
    model.study("std1").feature("cdi").set("goalngenAUX", "1");
    model.study("std1").feature("cdi").set("ngenAUX", "1");
    model.study("std1").feature("cdi").set("goalngenAUX", "1");
    model.study("std1").create("time", "Transient");
    model.study("std1").feature("time").set("initialtime", "0");
    model.study("std1").feature("time").set("solnum", "auto");
    model.study("std1").feature("time").set("notsolnum", "auto");
    model.study("std1").feature("time").set("outputmap", new String[]{});

//    Load the model parameters form a text file.
//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, locate the Parameters section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file evans_droplet_parameters.txt.
//    To import content from file, use:
//    model.param().loadFile("FILENAME");
    model.param().set("a", "0.0071550[m]", "Droplet radius");
    model.param().set("b", "0.0037306[m]", "Droplet height");
    model.param().set("c_unit", "1000[mol/m^3]", "Unit activity concentration");
    model.param().set("cCO20", "KCO2*PCO2*1e3*0.7[mol/m^3]", "Initial concentration of CO2");
    model.param().set("cNaCl0", "0.5[M]", "Initial concentration of NaCl");
    model.param().set("cO2_sol", "1.22[mM]", "Oxygen solubility");
    model.param().set("cO20", "cO2s", "Initial oxygen concentration");
    model.param().set("cO2s", "cO2_sol*0.21*0.7", "Oxygen concentration at the drop's surface");
    model.param()
         .set("ctot_mdis", "1e-5[mol/m^2]", "Total molar availability per surface area and monolayer for corrosion product precipitation");
    model.param().set("DCl", "2.03e-9[m^2/s]", "Diffusion coefficient of Cl");
    model.param().set("DFe", "0.72e-9[m^2/s]", "Diffusion coefficient of Fe2");
    model.param().set("DNa", "1.33e-9[m^2/s]", "Diffusion coefficient of Na");
    model.param().set("DO2", "1.96e-9[m^2/s]", "Diffusion coefficient of O2");
    model.param().set("Eeq_ref_Fe", "-0.47[V]", "Reference equilibrium potential for iron dissolution reaction");
    model.param().set("Eeq_ref_O2", "0.401[V]", "Reference equilibrium potential for oxygen reduction reaction");
    model.param().set("i0_ref_Fe", "1[A/m^2]", "Reference exchange current density for iron dissolution reaction");
    model.param().set("i0_ref_O2", "1e-7[A/m^2]", "Reference exchange current density for oxygen reduction reaction");
    model.param().set("alphaa_Fe", "1.5", "Anodic transfer coefficient for iron dissolution reaction");
    model.param().set("alphaa_O2", "3.5", "Anodic transfer coefficient for oxygen reduction reaction");
    model.param()
         .set("KCO2", "0.0454*(1.6616-5.736e-2*(T[1/K]-273)+1.031e-3*(T[1/K]-273)^2-9.68e-6*(T[1/K]-273)^3+4.471e-8*(T[1/K]-273)^4-7.912e-11*(T[1/K]-273)^5)", "Henry's constant");
    model.param().set("KFeCO3", "10^6.57", "Equilibrium constant for aqueous FeCO3 dissociation");
    model.param().set("KFeOH", "10^-9.5", "Equilibrium constant for FeOH formation");
    model.param().set("KFeOH2", "10^-11.1", "Equilibrium constant for second step of Fe++ hydrolysis");
    model.param().set("kfFeCO3", "1e7[mol/m^3/s]", "Reaction rate constant for FeCO3 precipitation");
    model.param().set("kfFeOH2", "1e6[mol/m^3/s]", "Reaction rate constant for FeOH2 precipitation");
    model.param().set("KspFeCO3", "10^-10.7", "Equilibrium constant, FeCO3 dissolution");
    model.param().set("KspFeOH2", "8e-16", "Equilibrium constant, FeOH2 dissolution");
    model.param().set("M_FeCO3", "115.854[g/mol]", "Molecular weight of FeCO3");
    model.param().set("M_FeOH2", "89.86[g/mol]", "Molecular weight of FeOH2");
    model.param().set("PCO2", "400[ppm]", "Partial pressure of CO2 in bar");
    model.param().set("phil0", "0.5[V]", "Initial electrolyte potential");
    model.param().set("rho_FeCO3", "4.03[g/cm^3]", "Density of FeCO3");
    model.param().set("rho_FeOH2", "3.4[g/cm^3]", "Density of FeOH2");
    model.param().set("T", "298 [K]", "Temperature");
    model.param().set("zCl", "-1", "Charge number of CO3");
    model.param().set("zFe", "2", "Charge number of Fe");
    model.param().set("zFeOH", "1", "Charge number of FeOH");
    model.param().set("zNa", "1", "Charge number of Na");
    model.param().set("k_O2", "1000[m/s]", "Mass Transfer Coefficient O2");
    model.param().set("k_CO2", "0.1[m/s]", "Mass Transfer Coefficient CO2");

//    The geometry consists of a sector of an ellipse.
//    In the Geometry toolbar, click Ellipse.

    model.component("comp1").geom("geom1").create("e1", "Ellipse");

//    In the Settings window for Ellipse, locate the Size and Shape section.
//    In the a-semiaxis text field, type a.

    model.component("comp1").geom("geom1").feature("e1").set("semiaxes", new String[]{"a", "1"});

//    In the b-semiaxis text field, type b.

    model.component("comp1").geom("geom1").feature("e1").set("semiaxes", new String[]{"a", "b"});

//    In the Sector angle text field, type 90.

    model.component("comp1").geom("geom1").feature("e1").set("angle", 90);

//    Click Build All Objects.

    model.component("comp1").geom("geom1").runPre("fin");

//    Load the model variables from a text file. These include precipitation and passivation definitions.
//    In the Model Builder window, expand the Component 1 (comp1) > Definitions node.
//    Right-click Definitions and choose Local Variables.

    model.component("comp1").variable().create("var1");

    model.component("comp1").geom("geom1").run();

//    In the Settings window for Variables, locate the Variables section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file evans_droplet_variables.txt.
//    To import content from file, use:
//    model.component("comp1").variable("var1").loadFile("FILENAME");
    model.component("comp1").variable("var1")
         .set("rFeCO3", "kfFeCO3*b*max(aqt.c3_Fe*aqt.c1_H2CO3[M^-2]-KspFeCO3,0)", "Reaction rate for FeCO3 precipitation");
    model.component("comp1").variable("var1")
         .set("rFeOH2", "kfFeOH2*b*max(aqt.c3_Fe*aqt.cOH^2[M^-3]-KspFeOH2,0)", "Reaction rate for FeOH2 precipitation");
    model.component("comp1").variable("var1")
         .set("theta", "1-exp(-aqt.es1.ctot/ctot_mdis)", "Corrosion-product coverage degree");

//    Add all aqueous species in the Electrolyte feature. This includes Carbonic acid, which encompasses CO2 and all associated species, as well as the iron species, supporting electrolyte, and dissolved oxygen.
//    In the Model Builder window, under Component 1 (comp1) > Aqueous Electrolyte Transport (aqt), click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Carbonic Acid.

    model.component("comp1").physics("aqt").feature("el1").create("carb1", "CarbonicAcid", 2);

//    In the Model Builder window, click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Ampholyte.

    model.component("comp1").physics("aqt").feature("el1").create("amph1", "Ampholyte", 2);

//    In the Settings window for Ampholyte, type Ampholyte - Fe in the Label text field.

    model.component("comp1").physics("aqt").feature("el1").feature("amph1").label("Ampholyte - Fe");

//    Locate the Ampholyte section.
//    In the Species name text field, type Fe.

    model.component("comp1").physics("aqt").feature("el1").feature("amph1").set("speciesname", "Fe");

//    In the table, enter the following settings:

    model.component("comp1").physics("aqt").feature("el1").feature("amph1").setIndex("pKa", "-log10(KFeOH)", 0, 0);
    model.component("comp1").physics("aqt").feature("el1").feature("amph1").setIndex("pKa", "-log10(KFeOH2)", 1, 0);

//    In the \[z_\textrm{0}\] text field, type 0.

    model.component("comp1").physics("aqt").feature("el1").feature("amph1").set("z0", 0);

//    Locate the Diffusion and Migration section.
//    In the \[D\] text field, type DFe.

    model.component("comp1").physics("aqt").feature("el1").feature("amph1").set("D", "DFe");

//    In the Model Builder window, click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Uncharged Species.

    model.component("comp1").physics("aqt").feature("el1").create("uns1", "UnchargedSpecies", 2);

//    In the Settings window for Uncharged Species, type Uncharged Species - O2 in the Label text field.

    model.component("comp1").physics("aqt").feature("el1").feature("uns1").label("Uncharged Species - O2");

//    Locate the Uncharged Species section.
//    In the Species name text field, type O2.

    model.component("comp1").physics("aqt").feature("el1").feature("uns1").set("speciesname", "O2");

//    Locate the Diffusion section.
//    In the \[D\] text field, type DO2.

    model.component("comp1").physics("aqt").feature("el1").feature("uns1").set("D", "DO2");

//    In the Model Builder window, click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Fully Dissociated Species.

    model.component("comp1").physics("aqt").feature("el1").create("fds1", "FullyDissociatedSpecies", 2);

//    In the Settings window for Fully Dissociated Species, type Fully Dissociated Species - Na in the Label text field.

    model.component("comp1").physics("aqt").feature("el1").feature("fds1").label("Fully Dissociated Species - Na");

//    Locate the Fully Dissociated Species section.
//    In the Species name text field, type Na.

    model.component("comp1").physics("aqt").feature("el1").feature("fds1").set("speciesname", "Na");

//    In the \[z\] text field, type zNa.

    model.component("comp1").physics("aqt").feature("el1").feature("fds1").set("z", "zNa");

//    Locate the Diffusion and Migration section.
//    In the \[D\] text field, type DNa.

    model.component("comp1").physics("aqt").feature("el1").feature("fds1").set("D", "DNa");

//    In the Model Builder window, click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Fully Dissociated Species.

    model.component("comp1").physics("aqt").feature("el1").create("fds2", "FullyDissociatedSpecies", 2);

//    In the Settings window for Fully Dissociated Species, type Fully Dissociated Species - Cl in the Label text field.

    model.component("comp1").physics("aqt").feature("el1").feature("fds2").label("Fully Dissociated Species - Cl");

//    Locate the Fully Dissociated Species section.
//    In the Species name text field, type Cl.

    model.component("comp1").physics("aqt").feature("el1").feature("fds2").set("speciesname", "Cl");

//    In the \[z\] text field, type zCl.

    model.component("comp1").physics("aqt").feature("el1").feature("fds2").set("z", "zCl");

//    Locate the Diffusion and Migration section.
//    In the \[D\] text field, type DCl.

    model.component("comp1").physics("aqt").feature("el1").feature("fds2").set("D", "DCl");

//    In the Model Builder window, click Electrolyte 1.
//    In the Physics toolbar, click Attributes and choose Complex Species.

    model.component("comp1").physics("aqt").feature("el1").create("coms1", "ComplexSpecies", 2);

//    In the Settings window for Complex Species, type Complex Species - FeCO3 in the Label text field.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").label("Complex Species - FeCO3");

//    Locate the Diffusion section.
//    In the \[D\] text field, type DFe.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").set("D_comp", "DFe");

//    Locate the Equilibrium Constant section.
//    In the \[K_{\textrm{eq}}\] text field, type KFeCO3.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").set("item.Keq", "KFeCO3");

//    Locate the Stoichiometric Coefficients section.
//    Select the CO3 checkbox.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").setIndex("isActive", true, 0);

//    In the \[\nu_{\textrm{CO}_\textrm{3}^\textrm{2-}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").setIndex("nu", -1, 0);

//    Select the Fe (+2) checkbox.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").setIndex("isActive", true, 6);

//    In the \[\nu_{\textrm{Fe}^\textrm{2+}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("el1").feature("coms1").setIndex("nu", -1, 6);

//    Set the initial concentration of dissolved species here. Note that the species H2CO3 is the total concentration of all carbon dioxide-related species.
//    In the Model Builder window, under Component 1 (comp1) > Aqueous Electrolyte Transport (aqt), click Initial Values 1.
//    In the Settings window for Initial Values, locate the Electrolyte Potential section.
//    In the \[\phi_{\textrm l,0}\] text field, type phil0.

    model.component("comp1").physics("aqt").feature("init1").set("initphil", "phil0");

//    Locate the Concentration section.
//    In the \[c_{\textrm{H2CO3,0}}\] text field, type cCO20.

    model.component("comp1").physics("aqt").feature("init1").set("initc_H2CO3", "cCO20");

//    In the \[c_{\textrm{O2,0}}\] text field, type cO20.

    model.component("comp1").physics("aqt").feature("init1").set("initc_O2", "cO20");

//    In the \[c_{\textrm{Na,0}}\] text field, type cNaCl0.

    model.component("comp1").physics("aqt").feature("init1").set("initc_Na", "cNaCl0");

//    In the \[c_{\textrm{Cl,0}}\] text field, type cNaCl0.

    model.component("comp1").physics("aqt").feature("init1").set("initc_Cl", "cNaCl0");

//    In the Physics toolbar, click Boundaries and choose Flux.

    model.component("comp1").physics("aqt").create("flux1", "FluxBoundary", 1);

//    Set high fluxes of carbon dioxide and oxygen in to the droplet to maintain a constant surface concentration of dissolved gases.
//    Select Boundary 3.

    model.component("comp1").physics("aqt").feature("flux1").selection().set(3);

//    In the Settings window for Flux, locate the Inward Species Fluxes section.
//    In the \[N_{\textrm{CO}_\textrm{2}(aq)}\] text field, type -k_CO2*(aqt.c4_H2CO3-cCO20).

    model.component("comp1").physics("aqt").feature("flux1").setIndex("N0_4_H2CO3", "-k_CO2*(aqt.c4_H2CO3-cCO20)", 0);

//    In the \[N_{\textrm{O}_\textrm{2}}\] text field, type -k_O2*(aqt.c_O2-cO2s).

    model.component("comp1").physics("aqt").feature("flux1").setIndex("N0_O2", "-k_O2*(aqt.c_O2-cO2s)", 0);

//    In the Physics toolbar, click Boundaries and choose Electrode Surface.

    model.component("comp1").physics("aqt").create("es1", "ElectrodeSurface", 1);

//    Use the Dissolving-Depositing Species section to include precipitation of ferrous hydroxide and ferrous carbonate at the surface.
//    Select Boundary 2.

    model.component("comp1").physics("aqt").feature("es1").selection().set(2);

//    In the Settings window for Electrode Surface, click to expand the Dissolving–Depositing Species section.
//    Click Add.

    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "s1", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "10[cm^3/mol]", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("c0", "0[mol/m^2]", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "s1", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "10[cm^3/mol]", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("c0", "0[mol/m^2]", 0, 0);

//    In the table, enter the following settings:

    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "FeOH2", 0, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "M_FeOH2/rho_FeOH2", 0, 0);

//    Click Add.

    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "s1", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "10[cm^3/mol]", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("c0", "0[mol/m^2]", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "s1", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "10[cm^3/mol]", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("c0", "0[mol/m^2]", 1, 0);

//    In the table, enter the following settings:

    model.component("comp1").physics("aqt").feature("es1").setIndex("DisDepSpeciesName", "FeCO3", 1, 0);
    model.component("comp1").physics("aqt").feature("es1").setIndex("Vm", "M_FeCO3/rho_FeCO3", 1, 0);

//    Now set up all four reactions happening at the electrode surface, two electrochemical reactions and two precipitation reactions.
//    In the Model Builder window, under Component 1 (comp1) > Aqueous Electrolyte Transport (aqt) > Electrode Surface 1, click Electrode Reaction 1.
//    In the Settings window for Electrode Reaction, type Electrode Reaction - Fe Dissolution in the Label text field.

    model.component("comp1").physics("aqt").feature("es1").feature("er1")
         .label("Electrode Reaction - Fe Dissolution");

//    Locate the Stoichiometric Coefficients section.
//    In the \[\nu_{\textrm{Fe}^\textrm{2+}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("es1").feature("er1").setIndex("nu0_3_Fe", -1, 0);

//    Locate the Equilibrium Potential section.
//    In the \[E_{\textrm{eq,ref}}\left(T\right)\] text field, type Eeq_ref_Fe.

    model.component("comp1").physics("aqt").feature("es1").feature("er1").set("Eeq_ref", "Eeq_ref_Fe");

//    Locate the Electrode Kinetics section.
//    In the \[i_{\textrm{0,ref}}\left(T\right)\] text field, type i0_ref_Fe*(1-theta).

    model.component("comp1").physics("aqt").feature("es1").feature("er1").set("i0_ref", "i0_ref_Fe*(1-theta)");

//    In the \[\alpha_{\textrm{a}}\] text field, type alphaa_Fe.

    model.component("comp1").physics("aqt").feature("es1").feature("er1").set("alphaa", "alphaa_Fe");

//    In the Model Builder window, click Electrode Surface 1.
//    In the Physics toolbar, click Attributes and choose Electrode Reaction.

    model.component("comp1").physics("aqt").feature("es1").create("er2", "ElectrodeReaction", 1);

//    In the Model Builder window, under Global Definitions, click Default Model Inputs.
//    In the Settings window for Default Model Inputs, locate the Browse Model Inputs section.
//    In the tree, select General > Temperature (K) - minput.T.
//    Find the Expression for remaining selection subsection.
//    In the Temperature text field, type T.

    model.common("cminpt").set("modified", new String[][]{{"temperature", "T"}});

//    In the Model Builder window, under Component 1 (comp1) > Aqueous Electrolyte Transport (aqt) > Electrode Surface 1, click Electrode Reaction 2.
//    In the Settings window for Electrode Reaction, type Electrode Reaction - Oxygen Reduction in the Label text field.

    model.component("comp1").physics("aqt").feature("es1").feature("er2")
         .label("Electrode Reaction - Oxygen Reduction");

//    Locate the Stoichiometric Coefficients section.
//    In the \[\nu_{\textrm{O}_\textrm{2}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").setIndex("nu0_O2", -1, 0);

//    In the \[\nu_{{\textrm{OH}}^{\textrm{-}}}\] text field, type 4.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").set("nu0OH", 4);

//    Locate the Equilibrium Potential section.
//    In the \[E_{\textrm{eq,ref}}\left(T\right)\] text field, type Eeq_ref_O2.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").set("Eeq_ref", "Eeq_ref_O2");

//    Click to expand the Reference Concentrations section.
//    In the \[c_{\textrm{ref,}\textrm{O}_\textrm{2}}\] text field, type cO2_sol.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").setIndex("cref_O2", "cO2_sol", 0);

//    Locate the Electrode Kinetics section.
//    In the \[i_{\textrm{0,ref}}\left(T\right)\] text field, type i0_ref_O2.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").set("i0_ref", "i0_ref_O2");

//    In the \[\alpha_{\textrm{a}}\] text field, type alphaa_O2.

    model.component("comp1").physics("aqt").feature("es1").feature("er2").set("alphaa", "alphaa_O2");

//    In the Model Builder window, click Electrode Surface 1.
//    In the Physics toolbar, click Attributes and choose Reaction.

    model.component("comp1").physics("aqt").feature("es1").create("reac1", "Reaction", 1);

//    In the Settings window for Reaction, type Reaction - FeOH2 in the Label text field.

    model.component("comp1").physics("aqt").feature("es1").feature("reac1").label("Reaction - FeOH2");

//    Locate the Reaction Rate section.
//    In the \[R\] text field, type rFeOH2.

    model.component("comp1").physics("aqt").feature("es1").feature("reac1").set("RN", "rFeOH2");

//    Locate the Stoichiometric Coefficients section.
//    In the \[\nu_{\textrm{Fe}^\textrm{2+}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("es1").feature("reac1").setIndex("nu0_3_Fe", -1, 0);

//    In the \[\nu_{\textrm{OH}^{\textrm{-}}}\] text field, type -2.

    model.component("comp1").physics("aqt").feature("es1").feature("reac1").set("nu0OH", -2);

//    Find the Stoichiometric coefficients for dissolving–depositing species subsection.
//    In the table, enter the following settings:

    model.component("comp1").physics("aqt").feature("es1").feature("reac1").setIndex("nudep", 1, 0, 0);

//    In the Model Builder window, click Electrode Surface 1.
//    In the Physics toolbar, click Attributes and choose Reaction.

    model.component("comp1").physics("aqt").feature("es1").create("reac2", "Reaction", 1);

//    In the Settings window for Reaction, type Reaction - FeCO3 in the Label text field.

    model.component("comp1").physics("aqt").feature("es1").feature("reac2").label("Reaction - FeCO3");

//    Locate the Reaction Rate section.
//    In the \[R\] text field, type rFeCO3.

    model.component("comp1").physics("aqt").feature("es1").feature("reac2").set("RN", "rFeCO3");

//    Locate the Stoichiometric Coefficients section.
//    In the \[\nu_{\textrm{CO}_\textrm{3}^\textrm{2-}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("es1").feature("reac2").setIndex("nu0_1_H2CO3", -1, 0);

//    In the \[\nu_{\textrm{Fe}^\textrm{2+}}\] text field, type -1.

    model.component("comp1").physics("aqt").feature("es1").feature("reac2").setIndex("nu0_3_Fe", -1, 0);

//    Find the Stoichiometric coefficients for dissolving–depositing species subsection.
//    In the table, enter the following settings:

    model.component("comp1").physics("aqt").feature("es1").feature("reac2").setIndex("nudep", 1, 1, 0);

//    Build a mesh using a finer resolution at the electrode surface, gas-liquid boundary, and corner.
//    In the Model Builder window, under Component 1 (comp1), click Mesh 1.
//    In the Settings window for Mesh, locate the Sequence Type section.
//    From the list, select User-controlled mesh.

    model.component("comp1").mesh("mesh1").automatic(false);

//    In the Model Builder window, under Component 1 (comp1) > Mesh 1, click Size.
//    In the Settings window for Size, locate the Element Size section.
//    From the Predefined list, select Normal.

    model.component("comp1").mesh("mesh1").feature("size").set("hauto", 5);

//    Click to expand the Element Size Parameters section.
//    In the Model Builder window, right-click Free Triangular 1 and choose Distribution.

    model.component("comp1").mesh("mesh1").feature("ftri1").create("dis1", "Distribution");

//    Select Boundaries 2, 3.

    model.component("comp1").mesh("mesh1").feature("ftri1").feature("dis1").selection().set(2, 3);

//    In the Settings window for Distribution, locate the Distribution section.
//    From the Distribution type list, select Predefined.

    model.component("comp1").mesh("mesh1").feature("ftri1").feature("dis1").set("type", "predefined");

//    In the Number of elements text field, type 200.

    model.component("comp1").mesh("mesh1").feature("ftri1").feature("dis1").set("elemcount", 200);

//    In the Element ratio text field, type 10.

    model.component("comp1").mesh("mesh1").feature("ftri1").feature("dis1").set("elemratio", 10);

//    In the Model Builder window, under Study 1, click Step 2: Time Dependent.
//    In the Settings window for Time Dependent, locate the Study Settings section.
//    In the Output times text field, type range(0,10,300).

    model.study("std1").feature("time").set("tlist", "range(0,10,300)");

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").set("data", "dset1");
    model.result("pg1").create("surf1", "Surface");
    model.result("pg1").feature("surf1").set("expr", new String[]{"aqt.pH"});
    model.result("pg1").label("pH (aqt)");
    model.result().create("pg2", "PlotGroup2D");
    model.result("pg2").set("data", "dset1");
    model.result("pg2").create("surf1", "Surface");
    model.result("pg2").feature("surf1").set("expr", new String[]{"aqt.sigmal"});
    model.result("pg2").label("Electrolyte Conductivity (aqt)");
    model.result().create("pg3", "PlotGroup2D");
    model.result("pg3").set("data", "dset1");
    model.result("pg3").create("surf1", "Surface");
    model.result("pg3").feature("surf1").set("expr", new String[]{"aqt.phil"});
    model.result("pg3").create("arws1", "ArrowSurface");
    model.result("pg3").feature("arws1").set("expr", new String[]{"aqt.Ilr", "aqt.Ilz"});
    model.result("pg3").feature("arws1").set("arrowbase", "center");
    model.result("pg3").feature("arws1").set("color", "black");
    model.result("pg3").label("Electrolyte Potential (aqt)");
    model.result().create("pg4", "PlotGroup2D");
    model.result("pg4").set("data", "dset1");
    model.result("pg4").create("surf1", "Surface");
    model.result("pg4").feature("surf1").set("expr", new String[]{"aqt.c_H2CO3"});
    model.result("pg4").create("arws1", "ArrowSurface");
    model.result("pg4").feature("arws1").set("arrowbase", "center");
    model.result("pg4").feature("arws1").set("color", "black");
    model.result("pg4").label("Molar Concentration - H2CO3 (aqt)");
    model.result().create("pg5", "PlotGroup2D");
    model.result("pg5").set("data", "dset1");
    model.result("pg5").create("surf1", "Surface");
    model.result("pg5").feature("surf1").set("expr", new String[]{"aqt.c_Fe"});
    model.result("pg5").create("arws1", "ArrowSurface");
    model.result("pg5").feature("arws1").set("arrowbase", "center");
    model.result("pg5").feature("arws1").set("color", "black");
    model.result("pg5").label("Molar Concentration - Fe (aqt)");
    model.result().create("pg6", "PlotGroup2D");
    model.result("pg6").set("data", "dset1");
    model.result("pg6").create("surf1", "Surface");
    model.result("pg6").feature("surf1").set("expr", new String[]{"aqt.c_O2"});
    model.result("pg6").create("arws1", "ArrowSurface");
    model.result("pg6").feature("arws1").set("arrowbase", "center");
    model.result("pg6").feature("arws1").set("color", "black");
    model.result("pg6").label("Molar Concentration - O2 (aqt)");
    model.result().create("pg7", "PlotGroup2D");
    model.result("pg7").set("data", "dset1");
    model.result("pg7").create("surf1", "Surface");
    model.result("pg7").feature("surf1").set("expr", new String[]{"aqt.c_Na"});
    model.result("pg7").create("arws1", "ArrowSurface");
    model.result("pg7").feature("arws1").set("arrowbase", "center");
    model.result("pg7").feature("arws1").set("color", "black");
    model.result("pg7").label("Molar Concentration - Na (aqt)");
    model.result().create("pg8", "PlotGroup2D");
    model.result("pg8").set("data", "dset1");
    model.result("pg8").create("surf1", "Surface");
    model.result("pg8").feature("surf1").set("expr", new String[]{"aqt.c_Cl"});
    model.result("pg8").create("arws1", "ArrowSurface");
    model.result("pg8").feature("arws1").set("arrowbase", "center");
    model.result("pg8").feature("arws1").set("color", "black");
    model.result("pg8").label("Molar Concentration - Cl (aqt)");
    model.result("pg1").run();

//    Several plots are added by default. The following steps add additional useful plots, some of which appear in the Results and Discussion Section:
//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg9", "PlotGroup2D");
    model.result("pg9").run();

//    Start with a 2D image of the total Corrosion Product Precipitation.
//    In the Settings window for 2D Plot Group, type Total Corrosion Product Precipitation in the Label text field.

    model.result("pg9").label("Total Corrosion Product Precipitation");

//    Right-click Total Corrosion Product Precipitation and choose Line.

    model.result("pg9").create("line1", "Line");
    model.result("pg9").feature("line1").set("evaluationsettings", "parent");

//    Click the Zoom Extents button in the Graphics toolbar.
//    In the Settings window for Line, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Aqueous Electrolyte Transport > Dissolving–depositing species > aqt.es1.ctot - Total molar concentration - mol/m².

    model.result("pg9").feature("line1").set("expr", "aqt.es1.ctot");
    model.result("pg9").feature("line1").set("descr", "Total molar concentration");

//    In the Total Corrosion Product Precipitation toolbar, click Plot.

    model.result("pg9").run();

//    In the Results toolbar, click 3D Plot Group.

    model.result().create("pg10", "PlotGroup3D");
    model.result("pg10").run();

//    The next plot shows the precipitated FeCO3 Fraction in 3D; it is also the thumbnail image.
//    Right-click 3D Plot Group 10 and choose Rename.
//    In the Rename 3D Plot Group dialog, type Precipitated FeCO3 Fraction, 3D in the New label text field.
//    Click OK.

    model.result("pg10").label("Precipitated FeCO3 Fraction, 3D");

//    Right-click Precipitated FeCO3 Fraction, 3D and choose Surface.

    model.result("pg10").create("surf1", "Surface");
    model.result("pg10").feature("surf1").set("evaluationsettings", "parent");

//    In the Model Builder window, expand the Results > Datasets node.
//    Right-click Results > Datasets and choose Revolution 2D.

    model.result().dataset().create("rev1", "Revolve2D");

//    In the Settings window for Revolution 2D, click to expand the Revolution Layers section.
//    Click to expand the Advanced section.
//    In the Results toolbar, click More Datasets and choose Revolution 2D.

    model.result().dataset().create("rev2", "Revolve2D");

//    In the Settings window for Revolution 2D, locate the Revolution Layers section.

    return model;
  }

  public static Model run2(Model model) {
//    In the Start angle text field, type -90.

    model.result().dataset("rev2").set("startangle", -90);

//    In the Revolution angle text field, type 225.

    model.result().dataset("rev2").set("revangle", 225);
    model.result("pg10").run();

//    In the Model Builder window, under Results, click Precipitated FeCO3 Fraction, 3D.
//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Dataset list, select Revolution 2D 1.

    model.result("pg10").set("data", "rev1");
    model.result("pg10").run();

//    In the Model Builder window, click Surface 1.
//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type comp1.aqt.es1.ctot.

    model.result("pg10").feature("surf1").set("expr", "comp1.aqt.es1.ctot");

//    Locate the Coloring and Style section.
//    From the Color table list, select Acanthaster.

    model.result("pg10").feature("surf1").set("colortable", "Acanthaster");
    model.result("pg10").run();

//    In the Model Builder window, right-click Precipitated FeCO3 Fraction, 3D and choose Streamline.

    model.result("pg10").create("str1", "Streamline");
    model.result("pg10").feature("str1").set("revcoordsys", "cylindrical");
    model.result("pg10").feature("str1").set("evaluationsettings", "parent");

//    In the Settings window for Streamline, locate the Streamline Positioning section.
//    From the Positioning list, select Uniform density.

    model.result("pg10").feature("str1").set("posmethod", "uniform");

//    In the Density level text field, type 7.

    model.result("pg10").feature("str1").set("udensity", 7);

//    Locate the Coloring and Style section.
//    Find the Line style subsection.
//    From the Type list, select Tube.

    model.result("pg10").feature("str1").set("linetype", "tube");

//    Select the Radius scale factor checkbox.

    model.result("pg10").feature("str1").set("tuberadiusscaleactive", true);

//    In the associated text field, type 2.5e-5.

    model.result("pg10").feature("str1").set("tuberadiusscale", "2.5e-5");

//    Find the Point style subsection.
//    From the Type list, select Arrow.

    model.result("pg10").feature("str1").set("pointtype", "arrow");

//    From the Arrow length list, select Logarithmic.

    model.result("pg10").feature("str1").set("arrowlength", "logarithmic");

//    From the Color list, select Green.

    model.result("pg10").feature("str1").set("color", "green");

//    Right-click Streamline 1 and choose Color Expression.

    model.result("pg10").feature("str1").create("col1", "Color");
    model.result("pg10").run();

//    In the Settings window for Color Expression, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Aqueous Electrolyte Transport > aqt.IlMag - Electrolyte current density magnitude - A/m².

    model.result("pg10").feature("str1").feature("col1").set("expr", "aqt.IlMag");
    model.result("pg10").feature("str1").feature("col1").set("descr", "Electrolyte current density magnitude");

//    Locate the Coloring and Style section.
//    From the Color table list, select Viridis.

    model.result("pg10").feature("str1").feature("col1").set("colortable", "Viridis");

//    From the Color table transformation list, select Reverse.

    model.result("pg10").feature("str1").feature("col1").set("colortabletrans", "reverse");

//    Clear the Color legend checkbox.

    model.result("pg10").feature("str1").feature("col1").set("colorlegend", false);
    model.result("pg10").run();

//    In the Model Builder window, right-click Precipitated FeCO3 Fraction, 3D and choose Surface.

    model.result("pg10").create("surf2", "Surface");
    model.result("pg10").feature("surf2").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type 1.

    model.result("pg10").feature("surf2").set("expr", "1");

//    Right-click Surface 2 and choose Selection.

    model.result("pg10").feature("surf2").create("sel1", "Selection");

//    Select Domain 1.

    model.result("pg10").feature("surf2").feature("sel1").selection().set(1);
    model.result("pg10").run();

//    In the Model Builder window, right-click Surface 2 and choose Transparency.

    model.result("pg10").feature("surf2").create("tran1", "Transparency");
    model.result("pg10").run();

//    In the Settings window for Transparency, locate the Transparency section.
//    Find the Transparency subsection.
//    In the Transparency text field, type 0.85.

    model.result("pg10").feature("surf2").feature("tran1").set("transparency", 0.85);
    model.result("pg10").run();

//    Right-click Surface 2 and choose Material Appearance.

    model.result("pg10").feature("surf2").create("mtrl1", "MaterialAppearance");
    model.result("pg10").run();

//    In the Settings window for Material Appearance, locate the Appearance section.
//    From the Appearance list, select Custom.

    model.result("pg10").feature("surf2").feature("mtrl1").set("appearance", "custom");

//    From the Material type list, select Water.

    model.result("pg10").feature("surf2").feature("mtrl1").set("family", "water");

//    In the Precipitated FeCO3 Fraction, 3D toolbar, click Plot.

    model.result("pg10").run();
    model.result("pg10").run();

//    In the Model Builder window, under Results, click Precipitated FeCO3 Fraction, 3D.
//    Click Plot.

    model.result("pg10").run();

//    In the Results toolbar, click 3D Plot Group.

    model.result().create("pg11", "PlotGroup3D");
    model.result("pg11").run();

//    Next, plot the pH in 3D.
//    Right-click 3D Plot Group 11 and choose Rename.
//    In the Rename 3D Plot Group dialog, type pH, 3D in the New label text field.
//    Click OK.

    model.result("pg11").label("pH, 3D");

//    Right-click pH, 3D and choose Surface.

    model.result("pg11").create("surf1", "Surface");
    model.result("pg11").feature("surf1").set("evaluationsettings", "parent");
    model.result("pg11").run();

//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Dataset list, select Revolution 2D 2.

    model.result("pg11").set("data", "rev2");

//    In the pH, 3D toolbar, click Plot.

    model.result("pg11").run();

//    From the Time (s) list, select 10.

    model.result("pg11").setIndex("looplevel", 2, 0);

//    In the pH, 3D toolbar, click Plot.

    model.result("pg11").run();

//    From the Time (s) list, select 300.

    model.result("pg11").setIndex("looplevel", 31, 0);

//    In the pH, 3D toolbar, click Plot.

    model.result("pg11").run();

//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg12", "PlotGroup1D");
    model.result("pg12").run();

//    Plot the local current density and surface coverage at the electrode surface in 1D as a function of the spatial dimension r.
//    In the Settings window for 1D Plot Group, type Local Current Density and Coverage in the Label text field.

    model.result("pg12").label("Local Current Density and Coverage");

//    Click to expand the Title section.
//    From the Title type list, select None.

    model.result("pg12").set("titletype", "none");

//    Locate the Data section.
//    From the Time selection list, select Last.

    model.result("pg12").setIndex("looplevelinput", "last", 0);

//    Locate the Plot Settings section.
//    Select the Two y-axes checkbox.

    model.result("pg12").set("twoyaxes", true);

//    Locate the Legend section.
//    From the Position list, select Middle left.

    model.result("pg12").set("legendpos", "middleleft");

//    Locate the Plot Settings section.
//    Select the y-axis label checkbox.

    model.result("pg12").set("ylabelactive", true);

//    In the associated text field, type Local current density (A/m<sup>2</sup>).

    model.result("pg12").set("ylabel", "Local current density (A/m<sup>2</sup>)");

//    Select the Secondary y-axis label checkbox.

    model.result("pg12").set("yseclabelactive", true);

//    In the associated text field, type Corrosion-product coverage degree.

    model.result("pg12").set("yseclabel", "Corrosion-product coverage degree");

//    Select the x-axis label checkbox.

    model.result("pg12").set("xlabelactive", true);

//    In the associated text field, type Spatial coordinates, r-component (m).

    model.result("pg12").set("xlabel", "Spatial coordinates, r-component (m)");

//    Right-click Local Current Density and Coverage and choose Line Graph.

    model.result("pg12").create("lngr1", "LineGraph");
    model.result("pg12").feature("lngr1").set("markerpos", "datapoints");
    model.result("pg12").feature("lngr1").set("linewidth", "preference");
    model.result("pg12").feature("lngr1").set("evaluationsettings", "parent");

//    Select Boundary 2.

    model.result("pg12").feature("lngr1").selection().set(2);

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type aqt.es1.er1.iloc.

    model.result("pg12").feature("lngr1").set("expr", "aqt.es1.er1.iloc");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg12").feature("lngr1").set("xdata", "expr");

//    In the Expression text field, type r.

    model.result("pg12").feature("lngr1").set("xdataexpr", "r");

//    Click to expand the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select Dashed.

    model.result("pg12").feature("lngr1").set("linestyle", "dashed");

//    Click to expand the Legends section.
//    Select the Show legends checkbox.

    model.result("pg12").feature("lngr1").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg12").feature("lngr1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg12").feature("lngr1").setIndex("legends", "Iron dissolution", 0);
    model.result("pg12").run();

//    In the Model Builder window, right-click Local Current Density and Coverage and choose Line Graph.

    model.result("pg12").create("lngr2", "LineGraph");
    model.result("pg12").feature("lngr2").set("markerpos", "datapoints");
    model.result("pg12").feature("lngr2").set("linewidth", "preference");
    model.result("pg12").feature("lngr2").set("evaluationsettings", "parent");

//    Select Boundary 2.

    model.result("pg12").feature("lngr2").selection().set(2);

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type aqt.es1.er2.iloc.

    model.result("pg12").feature("lngr2").set("expr", "aqt.es1.er2.iloc");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg12").feature("lngr2").set("xdata", "expr");

//    In the Expression text field, type r.

    model.result("pg12").feature("lngr2").set("xdataexpr", "r");

//    Locate the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select Dotted.

    model.result("pg12").feature("lngr2").set("linestyle", "dotted");

//    From the Color list, select Cycle (reset).

    model.result("pg12").feature("lngr2").set("linecolor", "cyclereset");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg12").feature("lngr2").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg12").feature("lngr2").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg12").feature("lngr2").setIndex("legends", "Oxygen reduction", 0);
    model.result("pg12").run();

//    Right-click Local Current Density and Coverage and choose Line Graph.

    model.result("pg12").create("lngr3", "LineGraph");
    model.result("pg12").feature("lngr3").set("markerpos", "datapoints");
    model.result("pg12").feature("lngr3").set("linewidth", "preference");
    model.result("pg12").feature("lngr3").set("evaluationsettings", "parent");

//    Select Boundary 2.

    model.result("pg12").feature("lngr3").selection().set(2);

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type aqt.itot.

    model.result("pg12").feature("lngr3").set("expr", "aqt.itot");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg12").feature("lngr3").set("xdata", "expr");

//    In the Expression text field, type r.

    model.result("pg12").feature("lngr3").set("xdataexpr", "r");

//    Locate the Coloring and Style section.
//    From the Color list, select Cycle (reset).

    model.result("pg12").feature("lngr3").set("linecolor", "cyclereset");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg12").feature("lngr3").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg12").feature("lngr3").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg12").feature("lngr3").setIndex("legends", "Total", 0);
    model.result("pg12").run();

//    Right-click Local Current Density and Coverage and choose Line Graph.

    model.result("pg12").create("lngr4", "LineGraph");
    model.result("pg12").feature("lngr4").set("markerpos", "datapoints");
    model.result("pg12").feature("lngr4").set("linewidth", "preference");
    model.result("pg12").feature("lngr4").set("evaluationsettings", "parent");

//    Select Boundary 2.

    model.result("pg12").feature("lngr4").selection().set(2);

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type theta.

    model.result("pg12").feature("lngr4").set("expr", "theta");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg12").feature("lngr4").set("xdata", "expr");

//    In the Expression text field, type r.

    model.result("pg12").feature("lngr4").set("xdataexpr", "r");

//    Locate the Coloring and Style section.
//    From the Color list, select Cycle (reset).

    model.result("pg12").feature("lngr4").set("linecolor", "cyclereset");

//    Find the Line markers subsection.
//    From the Marker list, select Circle.

    model.result("pg12").feature("lngr4").set("linemarker", "circle");

//    From the Positioning list, select Interpolated.

    model.result("pg12").feature("lngr4").set("markerpos", "interp");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg12").feature("lngr4").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg12").feature("lngr4").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg12").feature("lngr4").setIndex("legends", "Coverage", 0);
    model.result("pg12").run();

//    In the Model Builder window, click Local Current Density and Coverage.
//    In the Settings window for 1D Plot Group, locate the Plot Settings section.
//    In the table, enter the following settings:

    model.result("pg12").setIndex("plotonsecyaxis", true, 3, 1);

//    In the Local Current Density and Coverage toolbar, click Plot.

    model.result("pg12").run();

//    In the Results toolbar, click 3D Plot Group.

    model.result().create("pg13", "PlotGroup3D");
    model.result("pg13").run();

//    Finish with two 3D plots of the local Fe and CO2 concentration.
//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Dataset list, select Revolution 2D 2.

    model.result("pg13").set("data", "rev2");

//    In the Label text field, type Concentration, Fe, 3D.

    model.result("pg13").label("Concentration, Fe, 3D");

//    Right-click Concentration, Fe, 3D and choose Surface.

    model.result("pg13").create("surf1", "Surface");
    model.result("pg13").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type aqt.c3_Fe.

    model.result("pg13").feature("surf1").set("expr", "aqt.c3_Fe");

//    In the Concentration, Fe, 3D toolbar, click Plot.

    model.result("pg13").run();
    model.result("pg13").run();

//    In the Model Builder window, click Concentration, Fe, 3D.
//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Time (s) list, select 10.

    model.result("pg13").setIndex("looplevel", 2, 0);

//    In the Concentration, Fe, 3D toolbar, click Plot.

    model.result("pg13").run();

//    From the Time (s) list, select 300.

    model.result("pg13").setIndex("looplevel", 31, 0);

//    In the Concentration, Fe, 3D toolbar, click Plot.

    model.result("pg13").run();

//    In the Results toolbar, click 3D Plot Group.

    model.result().create("pg14", "PlotGroup3D");
    model.result("pg14").run();

//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Dataset list, select Revolution 2D 2.

    model.result("pg14").set("data", "rev2");

//    In the Label text field, type Concentration, CO2, 3D.

    model.result("pg14").label("Concentration, CO2, 3D");

//    Right-click Concentration, CO2, 3D and choose Surface.

    model.result("pg14").create("surf1", "Surface");
    model.result("pg14").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Aqueous Electrolyte Transport > Carbonic Acid 1 > aqt.c4_H2CO3 - Dissociated species concentration, CO2(aq) - mol/m³.

    model.result("pg14").feature("surf1").set("expr", "aqt.c4_H2CO3");
    model.result("pg14").feature("surf1").set("descr", "Dissociated species concentration, CO2(aq)");

//    In the Concentration, CO2, 3D toolbar, click Plot.

    model.result("pg14").run();
    model.result("pg14").run();

//    In the Model Builder window, click Concentration, CO2, 3D.
//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Time (s) list, select 10.

    model.result("pg14").setIndex("looplevel", 2, 0);

//    In the Concentration, CO2, 3D toolbar, click Plot.

    model.result("pg14").run();

//    From the Time (s) list, select 300.

    model.result("pg14").setIndex("looplevel", 31, 0);

//    In the Concentration, CO2, 3D toolbar, click Plot.

    model.result("pg14").run();

    model.title("Corrosion Under an Evans Droplet");

    model
         .description("This example simulates atmospheric general corrosion of steel under a droplet of aqueous sodium chloride solution. The model accounts for mass transport together with homogeneous reactions and atmospheric oxygen and carbon dioxide interactions. The model computes the transient and spatial distribution of species within the droplet, including passivating corrosion products formed in precipitation reactions at the electrode surface.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    run2(model);
  }

}
