Skip to content

Commit

Permalink
git history cleaned up
Browse files Browse the repository at this point in the history
git history squashed

sucessful dummy updateThermo

covdep initThermo() included

initThermo() compiled

for cpp test_script

linear model enthalpy tested

linearly dependent entropy

v0 of C++ CovDepSurfPhase Thermo

tested Python interface

branch ready for a pull request

uncommented covdepsurf alias in ThermoFactory

reference coverage, heat capacity, and polynomial model added
  • Loading branch information
jongyoonbae committed Nov 14, 2021
1 parent 4570f3e commit 7d51c66
Show file tree
Hide file tree
Showing 9 changed files with 2,354 additions and 7 deletions.
617 changes: 617 additions & 0 deletions include/cantera/thermo/CoverageDependentSurfPhase.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions include/cantera/thermo/SurfPhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class SurfPhase : public ThermoPhase
*
* This routine normalizes the theta's to 1, before application
*/
void setCoverages(const doublereal* theta);
virtual void setCoverages(const doublereal* theta);

//! Set the surface site fractions to a specified state.
/*!
Expand All @@ -387,7 +387,7 @@ class SurfPhase : public ThermoPhase
* @param theta This is the surface site fraction for the kth species in
* the surface phase. This is a dimensionless quantity.
*/
void setCoveragesNoNorm(const doublereal* theta);
virtual void setCoveragesNoNorm(const doublereal* theta);

//! Set the coverages from a string of colon-separated name:value pairs.
/*!
Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/_cantera.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ include "yamlwriter.pyx"
include "mixture.pyx"
include "reactor.pyx"
include "onedim.pyx"
include "reactionpath.pyx"
include "reactionpath.pyx"
11 changes: 7 additions & 4 deletions interfaces/cython/cantera/thermo.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1578,11 +1578,15 @@ cdef class ThermoPhase(_SolutionBase):


cdef class InterfacePhase(ThermoPhase):
""" A class representing a surface or edge phase"""
"""
A class representing a surface, edge phase,
or coverage-dependent surface
"""
def __cinit__(self, *args, **kwargs):
if pystr(self.thermo.type()) not in ("Surf", "Edge"):
if pystr(self.thermo.type()) in ("Surf", "Edge", "CovDepSurf"):
self.surf = <CxxSurfPhase*>(self.thermo)
else:
raise TypeError('Underlying ThermoPhase object is of the wrong type.')
self.surf = <CxxSurfPhase*>(self.thermo)

property site_density:
"""
Expand Down Expand Up @@ -1630,7 +1634,6 @@ cdef class InterfacePhase(ThermoPhase):
" Got {}, expected {}.".format(len(cov), self.n_species))
self.surf.setCoveragesNoNorm(&data[0])


cdef class PureFluid(ThermoPhase):
"""
A pure substance that can be a gas, a liquid, a mixed gas-liquid fluid,
Expand Down
772 changes: 772 additions & 0 deletions src/thermo/CoverageDependentSurfPhase.cpp

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/thermo/ThermoFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "cantera/thermo/RedlichKwongMFTP.h"
#include "cantera/thermo/PengRobinson.h"
#include "cantera/thermo/SurfPhase.h"
#include "cantera/thermo/CoverageDependentSurfPhase.h"
#include "cantera/thermo/EdgePhase.h"
#include "cantera/thermo/MetalPhase.h"
#include "cantera/thermo/StoichSubstance.h"
Expand Down Expand Up @@ -53,6 +54,9 @@ ThermoFactory::ThermoFactory()
reg("ideal-surface", []() { return new SurfPhase(); });
addAlias("ideal-surface", "Surface");
addAlias("ideal-surface", "Surf");
reg("coverage-dependent-surface", []() { return new CoverageDependentSurfPhase(); });
addAlias("coverage-dependent-surface", "CoverageDependentSurface");
addAlias("coverage-dependent-surface", "CovDepSurf");
reg("edge", []() { return new EdgePhase(); });
addAlias("edge", "Edge");
reg("electron-cloud", []() { return new MetalPhase(); });
Expand Down
Loading

0 comments on commit 7d51c66

Please sign in to comment.