Skip to content

PEM Fuel Cell

Represents a PEM Fuel Cell modelled with the Amphlett static polarisation curve, computed by AmphlettStaticModel, a .NET port of the OPEM static model.

DWSIM.UnitOperations.UnitOperations.PEMFC_Amphlett
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← PEMFuelCellUnitOpBase ← PEMFC_Amphlett

At a glance

PEM Fuel Cell in the example flowsheet

Port Index Connected in the example
Inlet, material 0 H2
Inlet, material 1 Air
Outlet, material 0 Exhaust
Outlet, energy 1 FC-1 power

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("FuelCellExample")
      .WithCompounds("Hydrogen", "Oxygen", "Nitrogen", "Water")
      .WithPropertyPackage(PropertyPackages.PengRobinson))

h2 = (fs.AddMaterialStream("H2")
      .At(Q.Celsius(70.0), Q.Bar(2.0))
      .SetCompoundMolarFlow("Hydrogen", 0.05))      # mol/s
air = (fs.AddMaterialStream("Air")
       .At(Q.Celsius(70.0), Q.Bar(2.0))
       .SetCompoundMolarFlow("Oxygen", 0.05)
       .SetCompoundMolarFlow("Nitrogen", 0.188))
exhaust = fs.AddMaterialStream("Exhaust")
power = fs.AddEnergyStream("FC-1 power")

fc = fs.AddPEMFuelCell("FC-1")
fc.Object.CreateConnectors()                 # the canvas creates the ports on first draw

# Amphlett model inputs (OPEM names); the stack runs at the last current of the sweep
p = fc.Object.InputParameters
p["N"].Value = 100.0                         # cells in the stack
p["A"].Value = 50.6                          # active area, cm2
p["i-start"].Value = 0.1                     # A
p["i-stop"].Value = 40.0                     # A
p["i-step"].Value = 0.1                      # A

fc.ConnectFeed(h2, 0).ConnectFeed(air, 1).ConnectProduct(exhaust, 0)
# electric power leaves through outlet port 1
fc.ConnectEnergyProduct(power, 1)

fs.AutoLayout()
fs.Solve()

r = fc.Object.OutputParameters
print(f"Current            = {r['I'].Value:.1f} A")
print(f"Stack voltage      = {r['V'].Value:.2f} V")
print(f"Electric power     = {power.Object.EnergyFlow:.3f} kW")
print(f"Heat released      = {r['Ph'].Value / 1000:.3f} kW")
print(f"Hydrogen used      = {0.05 - exhaust.Object.Phases[0].Compounds['Hydrogen'].MolarFlow:.5f} mol/s")
print(f"Nitrogen in exhaust = {exhaust.Object.Phases[0].Compounds['Nitrogen'].MolarFlow:.3f} mol/s")
print(f"Mass in / out      = {h2.MassFlowKgPerSecond + air.MassFlowKgPerSecond:.6f} / {exhaust.MassFlowKgPerSecond:.6f} kg/s")

Output

Current            = 39.9 A
Stack voltage      = 51.41 V
Electric power     = 2.051 kW
Heat released      = 2.856 kW
Hydrogen used      = 0.02068 mol/s
Nitrogen in exhaust = 0.188 mol/s
Mass in / out      = 0.006967 / 0.006967 kg/s

DWSIM 10.2.11.0, generated 2026-10-08.

Properties

IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.

ID Name Unit (SI) Input
i-start A yes
i-stop A yes
i-step A yes
A cm2 yes
l cm yes
lambda yes
R ohm yes
JMax A/cm2 yes
N yes
I A result
P W result
Ph W result
EFF result
V V result
VE V result

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

PEMFC_Amphlett(): Initializes a new default instance with Amphlett-model input parameters.

Initializes a new default instance with Amphlett-model input parameters.

public PEMFC_Amphlett()
Public Sub New()

Properties

Prefix: Gets or sets the default name prefix for this unit operation.

Gets or sets the default name prefix for this unit operation.

public override string Prefix { get; set; }
Public Overrides Property Prefix As String

Methods

AddDefaultInputParameters(): Populates the input parameter dictionary with default Amphlett model values.

Populates the input parameter dictionary with default Amphlett model values.

public override void AddDefaultInputParameters()
Public Overrides Sub AddDefaultInputParameters()

Calculate(object): Performs the Amphlett PEM fuel-cell calculation.

Performs the Amphlett PEM fuel-cell calculation.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy via XML serialization.

Creates a deep copy via XML serialization.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

GetDisplayDescription(): Returns the display description for this unit operation.

Returns the display description for this unit operation.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the display name for this unit operation.

Returns the display name for this unit operation.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetIconBitmapBytes(): Returns the icon bitmap as a byte array.

Returns the icon bitmap as a byte array.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the fuel-cell results.

Generates a plain-text report of the fuel-cell results.

Parameter Type Description
su IUnitsOfMeasure
ci CultureInfo
nf String
public override string GetReport(IUnitsOfMeasure su, CultureInfo ci, string nf)
Public Overrides Function GetReport(su As IUnitsOfMeasure, ci As CultureInfo, nf As String) As String

PopulateEditorPanel(object): Populates the cross-platform editor panel with controls.

Populates the cross-platform editor panel with controls.

Parameter Type Description
ctner Object
public override void PopulateEditorPanel(object ctner)
Public Overrides Sub PopulateEditorPanel(ctner As Object)

ReturnInstance(string): Creates and returns a new instance for deserialization.

Creates and returns a new instance for deserialization.

Parameter Type Description
typename String
public override object ReturnInstance(string typename)
Public Overrides Function ReturnInstance(typename As String) As Object