Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecating ConstDensityThermo class #645

Merged
merged 3 commits into from
Jun 12, 2019

Conversation

decaluwe
Copy link
Member

@decaluwe decaluwe commented Jun 12, 2019

As previously discussed, the incompressible_solid cti phase actually points to the ConstDensityThermo class. This is misleading to a user, and moreover, a thermo class which enforces constant mass density has both dubious physical underpinning and marginal utility for a user. It is therefore appropriate to deprecate and remove this class, and refer interested users to either the IdealSolidSolnPhase or Lattice thermo classes, which are appropriate replacements.

Changes proposed in this pull request:

  • Marks ConstDensityThermo thermo class for deprecation, as of release 2.5, and for removal, thereafter.
  • Adds appropriate messages to ctml_writer.py parsing routine, ConstDensityThermo.cpp, and ConstDensityThermo.h to indicate as much, and suggest use of Lattice or IdealSolidSolnPhase classes as alternates
  • Removes the incompressible_solid phase in sofc.cti (which is used for the sofc example, and which aliases to the ConstDensityThermo class) and replaces it with an equivalent Lattice phase.
  • Changes the cython test in test_convert.py which interrogates the incompressible_solid phase mass density in sofc.cti so that it instead interrogates the Lattice phase molar density.

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

Merging #645 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #645      +/-   ##
=========================================
- Coverage   68.53%   68.5%   -0.04%     
=========================================
  Files         368     368              
  Lines       40027   40027              
=========================================
- Hits        27433   27419      -14     
- Misses      12594   12608      +14
Impacted Files Coverage Δ
include/cantera/thermo/ConstDensityThermo.h 0% <ø> (-8.34%) ⬇️
src/thermo/ConstDensityThermo.cpp 0% <0%> (-28%) ⬇️
src/transport/GasTransport.cpp 90.98% <0%> (+0.2%) ⬆️
include/cantera/thermo/LatticePhase.h 100% <0%> (+40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ed2b38...7325d5e. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

Merging #645 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #645      +/-   ##
=========================================
- Coverage   68.53%   68.5%   -0.04%     
=========================================
  Files         368     368              
  Lines       40027   40027              
=========================================
- Hits        27433   27419      -14     
- Misses      12594   12608      +14
Impacted Files Coverage Δ
include/cantera/thermo/ConstDensityThermo.h 0% <ø> (-8.34%) ⬇️
src/thermo/ConstDensityThermo.cpp 0% <0%> (-28%) ⬇️
src/transport/GasTransport.cpp 90.98% <0%> (+0.2%) ⬆️
include/cantera/thermo/LatticePhase.h 100% <0%> (+40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ed2b38...88ac987. Read the comment docs.

@@ -2295,15 +2304,14 @@ def __init__(self,
initial_state, options)
self._tr = transport
self._n = site_density
self._species = species

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As minor as it is, I'd suggest that this fix for lattice be done in a separate commit, since it serves a distinct purpose, and 'Enable instantiation of lattice class in CTI files` is a nice thing to see in the commit log.

Removes references to incompressible_solid phase in the codebase.
This phase type references ConstDensityThermo phase, which is a
non-physical model and is to be deprecated, with Cantera 2.5. In
order to enable deprecation, the following changes are hereby made:

- Changes oxide_bulk phase type from incompressible_solid to lattice in sofc.cti
- Changes test_convert.py so that it interrogates the density_mole of the bulk_oxide, rather than density_mass
The thermophase ConstDensityThermo instantiates a class with
constant density_mass  Such a model is of dubious physical
validity/applicability and has minimal foreseeable use cases.
This commit marks it for deprecation, and adds a message in
ctml_writer.py (where the model has the misleading alias
'incompressible_solid') refering the interested user to consider
appropriate alternate thermophase classes 'lattice' or
'IdealSolidSoln.'
@speth speth merged commit ba8ac1d into Cantera:master Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants