## FCSys.Chemistry

Chemical reactions and related models

### Information

Extends from Icons.ChemistryPackage (Icon for packages containing chemical models).

### Package Content

Name | Description
--- | ---
Examples | Examples
Electrochemistry | Models associated with electrochemical reactions
HOR | Hydrogen oxidation reaction
ORR | Oxygen reduction reaction
SurfaceTension | Surface tension
CapillaryVolume | Volume with capillary pressure applied to the liquid

## FCSys.Chemistry.HOR

Hydrogen oxidation reaction

### Information

H2 ⇌ 2e- + 2H+

Extends from FCSys.Icons.Names.Top2.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | n_trans |  | Number of components of translational momentum

### Connectors

Type | Name | Description
--- | --- | ---
Chemical | 'cheme-' | Connector for e-
Chemical | 'chemH+' | Connector for H+
Chemical | chemH2 | Connector for H2

### Modelica definition

    model HOR "Hydrogen oxidation reaction"
      extends FCSys.Icons.Names.Top2;

      constant Integer n_trans(min=0, max=3)
        "Number of components of translational momentum";
      // Note:  This must be a constant rather than a parameter due to errors in
      // Dymola 2014.
      Conditions.Adapters.ChemicalReaction 'e-'(
        final n_trans=n_trans,
        m=Characteristics.'e-'.Gas.m,
        n=-2);
      Conditions.Adapters.ChemicalReaction 'H+'(
        final n_trans=n_trans,
        m=Characteristics.'H+'.Gas.m,
        n=-2);
      Conditions.Adapters.ChemicalReaction H2(
        final n_trans=n_trans,
        m=Characteristics.H2.Gas.m,
        n=1);

      Connectors.Chemical 'cheme-'(redeclare final constant Integer n_trans=n_trans)
        "Connector for e-";
      Connectors.Chemical 'chemH+'(redeclare final constant Integer n_trans=n_trans)
        "Connector for H+";
      Connectors.Chemical chemH2(redeclare final constant Integer n_trans=n_trans)
        "Connector for H2";
      // Note:  These redeclarations are necessary due to errors in Dymola 2014.

    equation
      connect(chemH2, H2.chemical);
      connect('e-'.chemical, 'cheme-');
      connect('H+'.chemical, 'chemH+');
      connect(H2.reaction, 'e-'.reaction);
      connect('H+'.reaction, H2.reaction);
    end HOR;

## FCSys.Chemistry.ORR

Oxygen reduction reaction

### Information

4e- + 4H+ + O2 ⇌ 2H2O

Extends from FCSys.Icons.Names.Top2.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | n_trans |  | Number of components of translational momentum

### Connectors

Type | Name | Description
--- | --- | ---
Chemical | 'cheme-' | Connector for e-
Chemical | 'chemH+' | Connector for H+
Chemical | chemO2 | Connector for O2
Chemical | chemH2O | Connector for H2O

### Modelica definition

    model ORR "Oxygen reduction reaction"
      extends FCSys.Icons.Names.Top2;

      constant Integer n_trans(min=0, max=3)
        "Number of components of translational momentum";
      // Note:  This must be a constant rather than a parameter due to errors in
      // Dymola 2014.
      Conditions.Adapters.ChemicalReaction 'e-'(
        final n_trans=n_trans,
        m=Characteristics.'e-'.Gas.m,
        n=4,
        reaction(Ndot(stateSelect=StateSelect.prefer)));
      Conditions.Adapters.ChemicalReaction 'H+'(
        final n_trans=n_trans,
        m=Characteristics.'H+'.Gas.m,
        n=4);
      Conditions.Adapters.ChemicalReaction O2(
        final n_trans=n_trans,
        m=Characteristics.O2.Gas.m,
        n=1);
      Conditions.Adapters.ChemicalReaction H2O(
        final n_trans=n_trans,
        m=Characteristics.H2O.Gas.m,
        n=-2);

      Connectors.Chemical 'cheme-'(redeclare final constant Integer n_trans=n_trans)
        "Connector for e-";
      Connectors.Chemical 'chemH+'(redeclare final constant Integer n_trans=n_trans)
        "Connector for H+";
      Connectors.Chemical chemO2(redeclare final constant Integer n_trans=n_trans)
        "Connector for O2";
      Connectors.Chemical chemH2O(redeclare final constant Integer n_trans=n_trans)
        "Connector for H2O";
      // Note:  These redeclarations are necessary due to errors in Dymola 2014.

    equation
      connect('H+'.chemical, 'chemH+');
      connect('e-'.chemical, 'cheme-');
      connect(O2.chemical, chemO2);
      connect(H2O.chemical, chemH2O);
      connect('e-'.reaction, H2O.reaction);
      connect('H+'.reaction, H2O.reaction);
      connect(O2.reaction, H2O.reaction);
    end ORR;

## FCSys.Chemistry.SurfaceTension

Surface tension

### Information

The characteristic radius (R) is the harmonic mean of the (2) principle radii of the liquid volume.

The default surface tension (γ = 0.0663 N/m) is for saturated water at 60 °C, interpolated from [Incropera2002, pp. 924]. Note that the surface tension in [Wang2001] is incorrect (likely unit conversion error).

Extends from FCSys.Icons.Names.Top2.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Geometry
LengthReciprocal | overR | 1/U.mm | Reciprocal of characteristic radius [1/L]
Material properties
SurfaceTension | gamma | 0.0663*U.N/U.m | Surface tension [M/T2]

### Connectors

Type | Name | Description
--- | --- | ---
Amagat | wetting | Interface to the wetting phase
Amagat | nonwetting | Interface to the nonwetting phase

### Modelica definition

    model SurfaceTension "Surface tension"

      extends FCSys.Icons.Names.Top2;

      // Geometry
      Q.LengthReciprocal overR=1/U.mm "Reciprocal of characteristic radius";

      // Material properties
      parameter Q.SurfaceTension gamma=0.0663*U.N/U.m "Surface tension";

      // Auxiliary variables (for analysis only)
      Q.Pressure Deltap=wetting.p - nonwetting.p if environment.analysis
        "Pressure difference due to surface tension";

      Connectors.Amagat wetting "Interface to the wetting phase";
      Connectors.Amagat nonwetting "Interface to the nonwetting phase";

    protected
      outer Conditions.Environment environment "Environmental conditions";

    equation
      // Pressure relation
      nonwetting.p = wetting.p + 2*gamma*overR "Young-Laplace equation";

      // Conservation (without storage)
      0 = wetting.V + nonwetting.V "Volume";

    end SurfaceTension;

## FCSys.Chemistry.CapillaryVolume

Volume with capillary pressure applied to the liquid

### Information

The default surface tension (γ = 0.0663 N/m) is for saturated water at 60 °C, interpolated from [Incropera2002, pp. 924]. Note that the surface tension in [Wang2001] is incorrect (likely unit conversion error).

The default permeability (κ = 6.46×10-5 mm2) is based on the air permeability of SGL Carbon Group Sigracet® 10 BA [SGL2007]. Wang et al. use κ = 10-5 mm2 [Wang2001].

The default contact angle (θ = 140°) is typical of the GDL measurements listed at http://www.chem.mtu.edu/cnlm/research/Movement_of_Water-in_Fuel_Cell_Electrodes.htm (accessed Nov. 22, 2103).

Extends from FCSys.Icons.Names.Top3.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Geometry
Volume | V |  | Volume [L3]
Material properties
Boolean | inclCapillary | true | Include capillary pressure
SurfaceTension | gamma | 0.0663*U.N/U.m | Surface tension [M/T2]
Area | kappa | 6.46e-5*U.mm^2 | Permeability [L2]
Angle | theta | 140*U.degree | Contact angle [A]
replaceable function J | FCSys.Characteristics.H2O.J_… | Leverett J function
Included phases
Boolean | inclGas | true | Gas
Boolean | inclLiquid | true | Liquid
Boolean | inclSolid | true | Solid

### Connectors

Type | Name | Description
--- | --- | ---
Amagat | gas | Interface to the gas phase
Amagat | liquid | Interface to the liquid phase
Amagat | solid | Interface to the solid phase
Material properties
replaceable function J | Leverett J function

### Modelica definition

    model CapillaryVolume
      "Volume with capillary pressure applied to the liquid"
      extends FCSys.Icons.Names.Top3;

      // Material properties
      parameter Q.Volume V "Volume";

      // Capillary pressure
      parameter Boolean inclCapillary=true "Include capillary pressure";
      parameter Q.SurfaceTension gamma=0.0663*U.N/U.m "Surface tension";
      parameter Q.Area kappa=6.46e-5*U.mm^2 "Permeability";
      parameter Q.Angle theta=140*U.degree "Contact angle";
      replaceable function J = FCSys.Characteristics.H2O.J_identity
        "Leverett J function";

      // Material properties
      parameter Boolean inclGas=true "Gas";
      parameter Boolean inclLiquid=true "Liquid";
      parameter Boolean inclSolid=true "Solid";

      // Auxiliary variables (for analysis)
      output Q.NumberAbsolute s(final stateSelect=StateSelect.never) = liquid.V/(
        gas.V + liquid.V) if inclLiquid and inclGas and environment.analysis
        "Liquid saturation";

      Connectors.Amagat gas if inclGas "Interface to the gas phase";
      Connectors.Amagat liquid if inclLiquid "Interface to the liquid phase";
      Connectors.Amagat solid if inclSolid "Interface to the solid phase";
      SurfaceTension surfaceTension(final gamma=gamma,final overR=cos(theta)*J(
            liquid.V/(liquid.V + gas.V))/(2*sqrt(kappa))) if inclLiquid and
        inclCapillary "Additional pressure on the liquid";

      Conditions.ByConnector.Amagat.VolumeFixed volume(final V=V) if inclGas or
        inclLiquid or inclSolid "Fixed volume";

    protected
      outer Conditions.Environment environment "Environmental conditions";

    equation
      if not inclCapillary then
        connect(gas, liquid)
          "Directly connect gas and liquid (not shown in diagram)";
      end if;

      connect(surfaceTension.wetting, liquid);
      connect(solid, volume.amagat);
      connect(volume.amagat, gas);
      connect(surfaceTension.nonwetting, volume.amagat);
    end CapillaryVolume;