From e4c45b642906bcbd65f0adaa778eff37cd76cdd6 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 31 Jul 2015 13:08:17 -0400 Subject: [PATCH] General whitespace cleanup Remove unnecessary blank lines and trailing whitespace. Replace tabs with spaces. --- License.txt | 6 +- data/inputs/air.cti | 36 +-- data/inputs/airNASA9.cti | 6 +- data/inputs/argon.cti | 8 +- data/inputs/diamond.cti | 2 +- data/inputs/graphite.cti | 4 +- data/inputs/methane_pox_on_pt.cti | 104 ++++---- data/inputs/ptcombust.cti | 76 +++--- data/inputs/silane.cti | 4 +- data/inputs/silicon.cti | 4 +- data/inputs/silicon_carbide.cti | 4 +- data/inputs/water.cti | 4 +- doc/sphinx/cti/input-files.rst | 20 +- doc/sphinx/cti/species.rst | 2 +- doc/sphinx/cxx-guide/compiling.rst | 4 +- doc/sphinx/cxx-guide/demo1a.cpp | 2 - doc/sphinx/cxx-guide/demoequil.cpp | 1 - doc/sphinx/cxx-guide/equil-example.rst | 38 +-- doc/sphinx/cxx-guide/index.rst | 2 +- doc/sphinx/cxx-guide/thermo.rst | 10 +- doc/sphinx/language-interfaces.rst | 2 +- doc/sphinx/reactors.rst | 226 +++++++++--------- include/cantera/Edge.h | 5 +- include/cantera/IdealGasMix.h | 8 +- include/cantera/IncompressibleSolid.h | 5 +- include/cantera/Metal.h | 5 +- include/cantera/base/Array.h | 2 - include/cantera/base/FactoryBase.h | 2 - include/cantera/base/clockWC.h | 1 - include/cantera/base/config.h.in | 2 - include/cantera/base/ct_thread.h | 1 - include/cantera/base/logger.h | 1 - include/cantera/base/stringUtils.h | 3 - include/cantera/base/utilities.h | 3 - include/cantera/base/xml.h | 27 +-- include/cantera/equil/ChemEquil.h | 3 - include/cantera/equil/MultiPhase.h | 10 +- include/cantera/equil/vcs_VolPhase.h | 2 - include/cantera/equil/vcs_defs.h | 4 - include/cantera/equil/vcs_prob.h | 1 - include/cantera/equil/vcs_solve.h | 26 +- include/cantera/kinetics/BulkKinetics.h | 1 - include/cantera/kinetics/Falloff.h | 1 - include/cantera/kinetics/GasKinetics.h | 3 +- include/cantera/kinetics/ImplicitSurfChem.h | 1 - include/cantera/kinetics/InterfaceKinetics.h | 1 - include/cantera/kinetics/Kinetics.h | 1 - include/cantera/kinetics/KineticsFactory.h | 1 - include/cantera/kinetics/RateCoeffMgr.h | 2 - include/cantera/kinetics/ReactionPath.h | 6 +- include/cantera/kinetics/RxnRates.h | 8 +- include/cantera/kinetics/StoichManager.h | 2 - include/cantera/kinetics/importKinetics.h | 2 - include/cantera/kinetics/reaction_defs.h | 3 - include/cantera/kinetics/solveSP.h | 6 - include/cantera/numerics/BandMatrix.h | 14 -- include/cantera/numerics/CVodesIntegrator.h | 1 - include/cantera/numerics/DAE_Solver.h | 5 - include/cantera/numerics/DenseMatrix.h | 4 - include/cantera/numerics/Func1.h | 14 +- include/cantera/numerics/GeneralMatrix.h | 5 - include/cantera/numerics/IDA_Solver.h | 4 - include/cantera/numerics/Integrator.h | 2 - include/cantera/numerics/ResidEval.h | 2 - include/cantera/numerics/ResidJacEval.h | 9 - include/cantera/numerics/RootFind.h | 4 - include/cantera/numerics/ctlapack.h | 8 - include/cantera/numerics/funcs.h | 1 - include/cantera/numerics/polyfit.h | 10 - include/cantera/oneD/Domain1D.h | 1 - include/cantera/oneD/Inlet1D.h | 1 - include/cantera/oneD/Sim1D.h | 4 +- include/cantera/oneD/StFlow.h | 9 +- include/cantera/thermo/AdsorbateThermo.h | 2 - include/cantera/thermo/ConstCpPoly.h | 1 - include/cantera/thermo/DebyeHuckel.h | 14 -- include/cantera/thermo/HMWSoln.h | 36 --- include/cantera/thermo/IdealGasPhase.h | 3 - include/cantera/thermo/IdealMolalSoln.h | 5 +- .../cantera/thermo/IonsFromNeutralVPSSTP.h | 8 - include/cantera/thermo/LatticePhase.h | 4 +- include/cantera/thermo/LatticeSolidPhase.h | 1 - include/cantera/thermo/MargulesVPSSTP.h | 7 - .../cantera/thermo/MaskellSolidSolnPhase.h | 1 - include/cantera/thermo/MetalPhase.h | 3 - .../cantera/thermo/MixedSolventElectrolyte.h | 5 - include/cantera/thermo/MixtureFugacityTP.h | 7 - include/cantera/thermo/MolalityVPSSTP.h | 4 - include/cantera/thermo/MolarityIonicVPSSTP.h | 2 - include/cantera/thermo/NasaPoly1.h | 1 - include/cantera/thermo/PDSS.h | 3 - include/cantera/thermo/PDSS_HKFT.h | 4 - include/cantera/thermo/PDSS_IdealGas.h | 6 - include/cantera/thermo/PDSS_IonsFromNeutral.h | 7 - include/cantera/thermo/PDSS_SSVol.h | 7 - include/cantera/thermo/PDSS_Water.h | 6 - include/cantera/thermo/Phase.h | 5 +- .../cantera/thermo/PhaseCombo_Interaction.h | 8 - include/cantera/thermo/PureFluidPhase.h | 2 - include/cantera/thermo/RedlichKisterVPSSTP.h | 6 - include/cantera/thermo/RedlichKwongMFTP.h | 10 - include/cantera/thermo/SemiconductorPhase.h | 4 - include/cantera/thermo/ShomatePoly.h | 1 - include/cantera/thermo/SingleSpeciesTP.h | 2 - include/cantera/thermo/SpeciesThermo.h | 1 - .../cantera/thermo/SpeciesThermoInterpType.h | 3 - include/cantera/thermo/ThermoFactory.h | 8 - include/cantera/thermo/ThermoPhase.h | 9 - include/cantera/thermo/VPSSMgr.h | 2 - include/cantera/thermo/VPSSMgr_ConstVol.h | 3 - include/cantera/thermo/VPSSMgr_General.h | 1 - include/cantera/thermo/VPSSMgr_IdealGas.h | 2 - .../cantera/thermo/VPSSMgr_Water_ConstVol.h | 1 - include/cantera/thermo/VPSSMgr_Water_HKFT.h | 1 - include/cantera/thermo/VPStandardStateTP.h | 7 - include/cantera/thermo/WaterSSTP.h | 1 - include/cantera/thermo/speciesThermoTypes.h | 3 - include/cantera/transport/DustyGasTransport.h | 3 - .../transport/HighPressureGasTransport.h | 2 - include/cantera/transport/LTPspecies.h | 3 - .../cantera/transport/LiquidTranInteraction.h | 2 - include/cantera/transport/LiquidTransport.h | 2 - .../cantera/transport/LiquidTransportParams.h | 2 - include/cantera/transport/MixTransport.h | 1 - include/cantera/transport/Tortuosity.h | 7 - include/cantera/transport/TransportBase.h | 1 - include/cantera/transport/WaterTransport.h | 3 - include/cantera/zeroD/Reactor.h | 1 - include/cantera/zeroD/ReactorFactory.h | 3 - interfaces/cython/cantera/ctml_writer.py | 2 +- .../examples/surface_chemistry/sofc.cti | 63 +---- .../transport/multiprocessing_viscosity.py | 12 +- samples/cxx/NASA_coeffs/NASA_coeffs.cpp | 3 - samples/cxx/bvp/BoundaryValueProblem.h | 21 +- samples/cxx/bvp/blasius.cpp | 13 - samples/cxx/combustor/combustor.cpp | 7 +- samples/cxx/demo.cpp | 2 - samples/cxx/kinetics1/kinetics1.cpp | 5 +- samples/cxx/rankine/rankine.cpp | 2 - samples/f90/demo.f90 | 4 +- samples/matlab/catcomb.m | 56 ++--- samples/matlab/diffflame.m | 31 +-- samples/matlab/equil.m | 3 +- samples/matlab/flame.m | 14 +- samples/matlab/flame1.m | 33 +-- samples/matlab/flame2.m | 23 +- samples/matlab/ignite.m | 12 +- samples/matlab/ignite_hp.m | 4 +- samples/matlab/ignite_uv.m | 3 +- samples/matlab/isentropic.m | 10 +- samples/matlab/periodic_cstr.m | 11 +- samples/matlab/prandtl1.m | 2 +- samples/matlab/prandtl2.m | 7 +- samples/matlab/rankine.m | 10 +- samples/matlab/reactor1.m | 4 +- samples/matlab/reactor2.m | 4 +- samples/matlab/surfreactor.m | 8 +- samples/matlab/transport1.m | 3 +- samples/matlab/tut1.m | 23 +- samples/matlab/tut2.m | 3 +- samples/matlab/tut3.m | 2 +- samples/matlab/tut4.m | 2 +- samples/matlab/tut5.m | 15 +- samples/matlab/tut6.m | 5 +- samples/matlab/tut7.m | 8 +- src/base/application.cpp | 4 - src/base/application.h | 1 - src/base/ctml.cpp | 1 - src/base/units.h | 3 - src/base/xml.cpp | 2 - src/clib/ctfunc.cpp | 2 - src/clib/ctonedim.cpp | 1 - src/clib/ctreactor.cpp | 3 - src/clib/ctxml.cpp | 1 - src/clib/ctxml.h | 1 - src/equil/BasisOptimize.cpp | 1 - src/equil/ChemEquil.cpp | 19 -- src/equil/MultiPhase.cpp | 5 - src/equil/MultiPhaseEquil.cpp | 24 +- src/equil/vcs_MultiPhaseEquil.cpp | 35 --- src/equil/vcs_VolPhase.cpp | 15 -- src/equil/vcs_inest.cpp | 1 - src/equil/vcs_phaseStability.cpp | 63 ++--- src/equil/vcs_prep.cpp | 1 - src/equil/vcs_prob.cpp | 5 - src/equil/vcs_report.cpp | 4 - src/equil/vcs_rxnadj.cpp | 12 - src/equil/vcs_setMolesLinProg.cpp | 5 - src/equil/vcs_solve.cpp | 27 --- src/equil/vcs_solve_TP.cpp | 55 +---- src/equil/vcs_solve_phaseStability.cpp | 8 - src/equil/vcs_species_thermo.cpp | 1 - src/fortran/cantera_funcs.f90 | 2 +- src/fortran/cantera_kinetics.f90 | 2 +- src/fortran/fct.cpp | 4 - src/kinetics/BulkKinetics.cpp | 2 - src/kinetics/GasKinetics.cpp | 2 - src/kinetics/Group.cpp | 1 - src/kinetics/ImplicitSurfChem.cpp | 7 - src/kinetics/InterfaceKinetics.cpp | 19 +- src/kinetics/Kinetics.cpp | 7 - src/kinetics/KineticsFactory.cpp | 1 - src/kinetics/Reaction.cpp | 11 - src/kinetics/ReactionPath.cpp | 24 -- src/kinetics/RxnRates.cpp | 22 +- src/kinetics/importKinetics.cpp | 5 - src/kinetics/solveSP.cpp | 16 -- src/matlab/ctfunctions.cpp | 1 - src/matlab/ctmethods.cpp | 1 - src/matlab/flowdevicemethods.cpp | 1 - src/matlab/kineticsmethods.cpp | 3 - src/matlab/mixturemethods.cpp | 2 - src/matlab/onedimmethods.cpp | 24 +- src/matlab/phasemethods.cpp | 2 +- src/matlab/reactormethods.cpp | 4 - src/matlab/reactornetmethods.cpp | 3 - src/matlab/surfmethods.cpp | 6 - src/matlab/transportmethods.cpp | 3 +- src/matlab/wallmethods.cpp | 2 - src/matlab/xmlmethods.cpp | 1 - src/numerics/CVodeInt.cpp | 1 - src/numerics/CVodeInt.h | 1 - src/numerics/CVodesIntegrator.cpp | 4 - src/numerics/DAE_solvers.cpp | 1 - src/numerics/IDA_Solver.cpp | 7 - src/numerics/ODE_integrators.cpp | 1 - src/numerics/ResidJacEval.cpp | 10 +- src/numerics/RootFind.cpp | 10 - src/numerics/SquareMatrix.cpp | 7 - src/numerics/funcs.cpp | 8 - src/oneD/Domain1D.cpp | 1 - src/oneD/MultiJac.cpp | 5 +- src/oneD/MultiNewton.cpp | 9 +- src/oneD/OneDim.cpp | 1 - src/oneD/Sim1D.cpp | 12 - src/oneD/StFlow.cpp | 30 --- src/oneD/boundaries1D.cpp | 4 - src/thermo/DebyeHuckel.cpp | 19 -- src/thermo/FixedChemPotSSTP.cpp | 1 - src/thermo/GeneralSpeciesThermo.cpp | 2 - src/thermo/HMWSoln.cpp | 84 ------- src/thermo/HMWSoln_input.cpp | 24 -- src/thermo/IdealMolalSoln.cpp | 15 -- src/thermo/IdealSolnGasVPSS.cpp | 2 - src/thermo/IonsFromNeutralVPSSTP.cpp | 48 ---- src/thermo/LatticePhase.cpp | 3 - src/thermo/LatticeSolidPhase.cpp | 1 - src/thermo/MargulesVPSSTP.cpp | 9 +- src/thermo/MaskellSolidSolnPhase.cpp | 1 - src/thermo/MetalSHEelectrons.cpp | 1 - src/thermo/MineralEQ3.cpp | 1 - src/thermo/MixedSolventElectrolyte.cpp | 25 -- src/thermo/MixtureFugacityTP.cpp | 26 -- src/thermo/MolalityVPSSTP.cpp | 8 - src/thermo/MolarityIonicVPSSTP.cpp | 12 - src/thermo/Mu0Poly.cpp | 2 - src/thermo/Nasa9Poly1.cpp | 1 - src/thermo/Nasa9PolyMultiTempRegion.cpp | 1 - src/thermo/PDSS.cpp | 1 - src/thermo/PDSS_ConstVol.cpp | 3 - src/thermo/PDSS_HKFT.cpp | 117 ++------- src/thermo/PDSS_IdealGas.cpp | 1 - src/thermo/PDSS_IonsFromNeutral.cpp | 4 - src/thermo/PDSS_SSVol.cpp | 3 - src/thermo/PDSS_Water.cpp | 4 - src/thermo/Phase.cpp | 2 - src/thermo/PhaseCombo_Interaction.cpp | 22 -- src/thermo/RedlichKisterVPSSTP.cpp | 14 -- src/thermo/RedlichKwongMFTP.cpp | 58 ----- src/thermo/SemiconductorPhase.cpp | 2 - src/thermo/Species.cpp | 1 - src/thermo/SpeciesThermoFactory.cpp | 5 - src/thermo/SurfPhase.cpp | 1 - src/thermo/ThermoFactory.cpp | 8 - src/thermo/ThermoPhase.cpp | 9 +- src/thermo/VPSSMgr.cpp | 4 - src/thermo/VPSSMgrFactory.cpp | 5 - src/thermo/VPSSMgrFactory.h | 7 - src/thermo/VPSSMgr_ConstVol.cpp | 3 - src/thermo/VPSSMgr_General.cpp | 4 - src/thermo/VPSSMgr_IdealGas.cpp | 1 - src/thermo/VPSSMgr_Water_ConstVol.cpp | 3 - src/thermo/VPSSMgr_Water_HKFT.cpp | 9 +- src/thermo/VPStandardStateTP.cpp | 4 - src/thermo/WaterProps.cpp | 30 --- src/thermo/WaterPropsIAPWS.cpp | 17 -- src/thermo/WaterPropsIAPWSphi.cpp | 40 ---- src/thermo/WaterSSTP.cpp | 3 - src/tpx/CarbonDioxide.cpp | 13 - src/tpx/HFC134a.cpp | 2 - src/tpx/Heptane.cpp | 11 - src/tpx/Hydrogen.cpp | 2 - src/tpx/Methane.cpp | 1 - src/tpx/Nitrogen.cpp | 3 - src/tpx/Oxygen.cpp | 3 - src/tpx/Sub.cpp | 19 -- src/tpx/lk.cpp | 1 - src/tpx/lk.h | 4 - src/transport/DustyGasTransport.cpp | 10 - src/transport/GasTransport.cpp | 18 -- src/transport/HighPressureGasTransport.cpp | 22 +- src/transport/LTPspecies.cpp | 5 - src/transport/LiquidTranInteraction.cpp | 45 ---- src/transport/LiquidTransport.cpp | 49 +--- src/transport/LiquidTransportData.cpp | 1 - src/transport/LiquidTransportParams.cpp | 1 - src/transport/MMCollisionInt.h | 4 - src/transport/MixTransport.cpp | 7 - src/transport/MultiTransport.cpp | 22 -- src/transport/SimpleTransport.cpp | 36 +-- src/transport/SolidTransport.cpp | 7 - src/transport/SolidTransportData.cpp | 1 - src/transport/TransportBase.cpp | 1 - src/transport/TransportFactory.cpp | 221 ++++++++--------- src/transport/WaterTransport.cpp | 3 - src/zeroD/ConstPressureReactor.cpp | 1 - src/zeroD/FlowReactor.cpp | 4 - src/zeroD/Reactor.cpp | 5 - src/zeroD/ReactorFactory.cpp | 5 - src/zeroD/ReactorNet.cpp | 3 - test/SConscript | 2 +- .../cathermo/DH_graph_1/DH_graph_1.cpp | 1 - .../cathermo/HMW_dupl_test/HMW_dupl_test.cpp | 1 - .../HMW_graph_CpvT/HMW_graph_CpvT.cpp | 1 - .../cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp | 1 - .../cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp | 1 - .../cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp | 1 - .../cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp | 1 - test_problems/cathermo/wtWater/wtWater.cpp | 1 - test_problems/cxx_ex/equil_example1.cpp | 1 - test_problems/cxx_ex/kinetics_example1.cpp | 2 - test_problems/cxx_ex/kinetics_example3.cpp | 1 - test_problems/cxx_ex/rxnpath_example1.cpp | 1 - test_problems/diamondSurf/diamond.cti | 8 +- test_problems/rankine_democxx/rankine.cpp | 1 - .../simpleTransport/simpleTransportTest.cpp | 2 - test_problems/surfSolverTest/haca2.cti | 8 +- .../surfSolverTest/surfaceSolver.cpp | 1 - .../surfSolverTest/surfaceSolver2.cpp | 1 - test_problems/surfkin/surfdemo.cpp | 1 - 340 files changed, 625 insertions(+), 2692 deletions(-) diff --git a/License.txt b/License.txt index e3551b07b..6d6f000ca 100644 --- a/License.txt +++ b/License.txt @@ -2,8 +2,8 @@ Copyright (c) 2001-2009, California Institute of Technology All rights reserved. -Copyright (c) 2009 Sandia Corporation. Under the terms of -Contract AC04-94AL85000 with Sandia Corporation, the U.S. Government +Copyright (c) 2009 Sandia Corporation. Under the terms of +Contract AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. Redistribution and use in source and binary forms, with or without @@ -18,7 +18,7 @@ met: documentation and/or other materials provided with the distribution. - Neither the name of the California Institute of Technology, Sandia - Corporation nor the names of other contributors may be used to + Corporation nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/data/inputs/air.cti b/data/inputs/air.cti index 8cfaf95c0..349a4a1aa 100644 --- a/data/inputs/air.cti +++ b/data/inputs/air.cti @@ -19,16 +19,16 @@ ideal_gas(name = "air", #------------------------------------------------------------------------------- -# Species data +# Species data #------------------------------------------------------------------------------- species(name = "O", atoms = " O:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 3.168267100E+00, -3.279318840E-03, + NASA( [ 200.00, 1000.00], [ 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, 2.112659710E-12, 2.912225920E+04, 2.051933460E+00] ), - NASA( [ 1000.00, 3500.00], [ 2.569420780E+00, -8.597411370E-05, + NASA( [ 1000.00, 3500.00], [ 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, 1.228336910E-15, 2.921757910E+04, 4.784338640E+00] ) ), @@ -42,10 +42,10 @@ species(name = "O", species(name = "O2", atoms = " O:2 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 3.782456360E+00, -2.996734160E-03, + NASA( [ 200.00, 1000.00], [ 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, 3.243728370E-12, -1.063943560E+03, 3.657675730E+00] ), - NASA( [ 1000.00, 3500.00], [ 3.282537840E+00, 1.483087540E-03, + NASA( [ 1000.00, 3500.00], [ 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, -2.167177940E-14, -1.088457720E+03, 5.453231290E+00] ) ), @@ -61,10 +61,10 @@ species(name = "O2", species(name = "N", atoms = " N:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 200.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 5.610463700E+04, 4.193908700E+00] ), - NASA( [ 1000.00, 6000.00], [ 2.415942900E+00, 1.748906500E-04, + NASA( [ 1000.00, 6000.00], [ 2.415942900E+00, 1.748906500E-04, -1.190236900E-07, 3.022624500E-11, -2.036098200E-15, 5.613377300E+04, 4.649609600E+00] ) ), @@ -78,10 +78,10 @@ species(name = "N", species(name = "NO", atoms = " N:1 O:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 4.218476300E+00, -4.638976000E-03, + NASA( [ 200.00, 1000.00], [ 4.218476300E+00, -4.638976000E-03, 1.104102200E-05, -9.336135400E-09, 2.803577000E-12, 9.844623000E+03, 2.280846400E+00] ), - NASA( [ 1000.00, 6000.00], [ 3.260605600E+00, 1.191104300E-03, + NASA( [ 1000.00, 6000.00], [ 3.260605600E+00, 1.191104300E-03, -4.291704800E-07, 6.945766900E-11, -4.033609900E-15, 9.920974600E+03, 6.369302700E+00] ) ), @@ -97,10 +97,10 @@ species(name = "NO", species(name = "NO2", atoms = " N:1 O:2 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 3.944031200E+00, -1.585429000E-03, + NASA( [ 200.00, 1000.00], [ 3.944031200E+00, -1.585429000E-03, 1.665781200E-05, -2.047542600E-08, 7.835056400E-12, 2.896617900E+03, 6.311991700E+00] ), - NASA( [ 1000.00, 6000.00], [ 4.884754200E+00, 2.172395600E-03, + NASA( [ 1000.00, 6000.00], [ 4.884754200E+00, 2.172395600E-03, -8.280690600E-07, 1.574751000E-10, -1.051089500E-14, 2.316498300E+03, -1.174169500E-01] ) ), @@ -115,10 +115,10 @@ species(name = "NO2", species(name = "N2O", atoms = " N:2 O:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ 2.257150200E+00, 1.130472800E-02, + NASA( [ 200.00, 1000.00], [ 2.257150200E+00, 1.130472800E-02, -1.367131900E-05, 9.681980600E-09, -2.930718200E-12, 8.741774400E+03, 1.075799200E+01] ), - NASA( [ 1000.00, 6000.00], [ 4.823072900E+00, 2.627025100E-03, + NASA( [ 1000.00, 6000.00], [ 4.823072900E+00, 2.627025100E-03, -9.585087400E-07, 1.600071200E-10, -9.775230300E-15, 8.073404800E+03, -2.201720700E+00] ) ), @@ -133,10 +133,10 @@ species(name = "N2O", species(name = "N2", atoms = " N:2 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 3.298677000E+00, 1.408240400E-03, + NASA( [ 300.00, 1000.00], [ 3.298677000E+00, 1.408240400E-03, -3.963222000E-06, 5.641515000E-09, -2.444854000E-12, -1.020899900E+03, 3.950372000E+00] ), - NASA( [ 1000.00, 5000.00], [ 2.926640000E+00, 1.487976800E-03, + NASA( [ 1000.00, 5000.00], [ 2.926640000E+00, 1.487976800E-03, -5.684760000E-07, 1.009703800E-10, -6.753351000E-15, -9.227977000E+02, 5.980528000E+00] ) ), @@ -152,10 +152,10 @@ species(name = "N2", species(name = "AR", atoms = " Ar:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02, 4.366000000E+00] ), - NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02, 4.366000000E+00] ) ), @@ -169,7 +169,7 @@ species(name = "AR", #------------------------------------------------------------------------------- -# Reaction data +# Reaction data #------------------------------------------------------------------------------- # Reaction 1 diff --git a/data/inputs/airNASA9.cti b/data/inputs/airNASA9.cti index b33a7ccf4..e2e4dcbc3 100644 --- a/data/inputs/airNASA9.cti +++ b/data/inputs/airNASA9.cti @@ -7,7 +7,7 @@ units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol") ideal_gas(name = "airNASA9", elements = " O N E ", - species = """ N2 O2 NO N O N2+ O2+ NO+ N+ O+ + species = """ N2 O2 NO N O N2+ O2+ NO+ N+ O+ e- """, reactions = "all", initial_state = state(temperature = 300.0, @@ -16,7 +16,7 @@ ideal_gas(name = "airNASA9", #------------------------------------------------------------------------------- -# Species data +# Species data #------------------------------------------------------------------------------- species(name = "N2", @@ -198,5 +198,5 @@ species(name = "e-", #------------------------------------------------------------------------------- -# Reaction data +# Reaction data #------------------------------------------------------------------------------- diff --git a/data/inputs/argon.cti b/data/inputs/argon.cti index 583597123..513a7f9e7 100644 --- a/data/inputs/argon.cti +++ b/data/inputs/argon.cti @@ -18,16 +18,16 @@ ideal_gas(name = "argon", #------------------------------------------------------------------------------- -# Species data +# Species data #------------------------------------------------------------------------------- species(name = "AR", atoms = " Ar:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02, 4.366000000E+00] ), - NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02, 4.366000000E+00] ) ), @@ -41,5 +41,5 @@ species(name = "AR", #------------------------------------------------------------------------------- -# Reaction data +# Reaction data #------------------------------------------------------------------------------- diff --git a/data/inputs/diamond.cti b/data/inputs/diamond.cti index 88a41c7d8..e7d3f95b9 100644 --- a/data/inputs/diamond.cti +++ b/data/inputs/diamond.cti @@ -21,7 +21,7 @@ ideal_interface(name = 'diamond_100', species = 'c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B ', reactions = 'all', phases = 'gas diamond', - site_density = (3.0e-9, 'mol/cm2'), + site_density = (3.0e-9, 'mol/cm2'), initial_state = state(temperature = 1200.0, coverages = 'c6H*:0.1, c6HH:0.9')) diff --git a/data/inputs/graphite.cti b/data/inputs/graphite.cti index f6eb6a5b3..fd176280a 100644 --- a/data/inputs/graphite.cti +++ b/data/inputs/graphite.cti @@ -10,10 +10,10 @@ stoichiometric_solid(name = "graphite", species(name = "C(gr)", atoms = " C:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ -3.108720720E-01, 4.403536860E-03, + NASA( [ 200.00, 1000.00], [ -3.108720720E-01, 4.403536860E-03, 1.903941180E-06, -6.385469660E-09, 2.989642480E-12, -1.086507940E+02, 1.113829530E+00] ), - NASA( [ 1000.00, 5000.00], [ 1.455718290E+00, 1.717022160E-03, + NASA( [ 1000.00, 5000.00], [ 1.455718290E+00, 1.717022160E-03, -6.975627860E-07, 1.352770320E-10, -9.675906520E-15, -6.951388140E+02, -8.525830330E+00] ) ) diff --git a/data/inputs/methane_pox_on_pt.cti b/data/inputs/methane_pox_on_pt.cti index 5e4739142..2582cf85a 100644 --- a/data/inputs/methane_pox_on_pt.cti +++ b/data/inputs/methane_pox_on_pt.cti @@ -2,11 +2,11 @@ # SURFACE MECHANISM OF POX of CH4 on PT wire gauze # #*********************************************************************** -#**** * -#**** CH4-O2 SURFACE MECHANISM ON PT * -#**** * +#**** * +#**** CH4-O2 SURFACE MECHANISM ON PT * +#**** * #**** Version 1.0 Spring 2005 * -#**** * +#**** * #**** Raul Quiceno, Olaf Deutschmann, IWR, Heidelberg University, * #**** Germany * #**** Contact: mail@detchem.com (O. Deutschmann) * @@ -30,8 +30,8 @@ units(length = "cm", time = "s", quantity = "mol", act_energy = "J/mol") # # Define a gas mixture. This contains only major species, and no -# gas-phase reactions. -# +# gas-phase reactions. +# ideal_gas(name = "gas", elements = "O H C N Ar", species = """H2 O2 H2O CH4 CO CO2 AR""", @@ -43,7 +43,7 @@ ideal_gas(name = "gas", # -# The platinum surface. +# The platinum surface. ideal_interface(name = "Pt_surf", elements = " Pt H O C ", species = """ PT(S) H(S) @@ -53,7 +53,7 @@ ideal_interface(name = "Pt_surf", site_density = 2.72e-9, reactions = "all", options = ['skip_undeclared_elements', - 'skip_undeclared_species'], + 'skip_undeclared_species'], initial_state = state(temperature = 900.0, coverages = 'O(S):0.00, PT(S):0.01, H(S):0.99') ) @@ -61,16 +61,16 @@ ideal_interface(name = "Pt_surf", #------------------------------------------------------------------------------- -# Species data +# Species data #------------------------------------------------------------------------------- species(name = "CH4", atoms = " C:1 H:4 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 7.787414790E-01, 1.747668350E-02, + NASA( [ 300.00, 1000.00], [ 7.787414790E-01, 1.747668350E-02, -2.783409040E-05, 3.049708040E-08, -1.223930680E-11, -9.825228520E+03, 1.372219470E+01] ), - NASA( [ 1000.00, 5000.00], [ 1.683478830E+00, 1.023723560E-02, + NASA( [ 1000.00, 5000.00], [ 1.683478830E+00, 1.023723560E-02, -3.875128640E-06, 6.785584870E-10, -4.503423120E-14, -1.008078710E+04, 9.623394970E+00] ) ) @@ -79,10 +79,10 @@ species(name = "CH4", species(name = "O2", atoms = " O:2 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 3.783713500E+00, -3.023363400E-03, + NASA( [ 300.00, 1000.00], [ 3.783713500E+00, -3.023363400E-03, 9.949275100E-06, -9.818910100E-09, 3.303182500E-12, -1.063810700E+03, 3.641634500E+00] ), - NASA( [ 1000.00, 5000.00], [ 3.612213900E+00, 7.485316600E-04, + NASA( [ 1000.00, 5000.00], [ 3.612213900E+00, 7.485316600E-04, -1.982064700E-07, 3.374900800E-11, -2.390737400E-15, -1.197815100E+03, 3.670330700E+00] ) ) @@ -91,10 +91,10 @@ species(name = "O2", species(name = "CO", atoms = " C:1 O:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 3.262451650E+00, 1.511940850E-03, + NASA( [ 300.00, 1000.00], [ 3.262451650E+00, 1.511940850E-03, -3.881755220E-06, 5.581944240E-09, -2.474951230E-12, -1.431053910E+04, 4.848896980E+00] ), - NASA( [ 1000.00, 5000.00], [ 3.025078060E+00, 1.442688520E-03, + NASA( [ 1000.00, 5000.00], [ 3.025078060E+00, 1.442688520E-03, -5.630827790E-07, 1.018581330E-10, -6.910951560E-15, -1.426834960E+04, 6.108217720E+00] ) ) @@ -103,10 +103,10 @@ species(name = "CO", species(name = "CO2", atoms = " C:1 O:2 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 2.275724650E+00, 9.922072290E-03, + NASA( [ 300.00, 1000.00], [ 2.275724650E+00, 9.922072290E-03, -1.040911320E-05, 6.866686780E-09, -2.117280090E-12, -4.837314060E+04, 1.018848800E+01] ), - NASA( [ 1000.00, 5000.00], [ 4.453622820E+00, 3.140168730E-03, + NASA( [ 1000.00, 5000.00], [ 4.453622820E+00, 3.140168730E-03, -1.278410540E-06, 2.393996670E-10, -1.669033190E-14, -4.896696090E+04, -9.553958770E-01] ) ) @@ -115,10 +115,10 @@ species(name = "CO2", species(name = "H2", atoms = " H:2 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 3.355351400E+00, 5.013614400E-04, + NASA( [ 300.00, 1000.00], [ 3.355351400E+00, 5.013614400E-04, -2.300690800E-07, -4.790532400E-10, 4.852258500E-13, -1.019162600E+03, -3.547722800E+00] ), - NASA( [ 1000.00, 5000.00], [ 3.066709500E+00, 5.747375500E-04, + NASA( [ 1000.00, 5000.00], [ 3.066709500E+00, 5.747375500E-04, 1.393831900E-08, -2.548351800E-11, 2.909857400E-15, -8.654741200E+02, -1.779842400E+00] ) ) @@ -127,10 +127,10 @@ species(name = "H2", species(name = "H2O", atoms = " H:2 O:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 4.167723400E+00, -1.811497000E-03, + NASA( [ 300.00, 1000.00], [ 4.167723400E+00, -1.811497000E-03, 5.947128800E-06, -4.869202100E-09, 1.529199100E-12, -3.028996900E+04, -7.313547400E-01] ), - NASA( [ 1000.00, 5000.00], [ 2.611047200E+00, 3.156313000E-03, + NASA( [ 1000.00, 5000.00], [ 2.611047200E+00, 3.156313000E-03, -9.298543800E-07, 1.333153800E-10, -7.468935100E-15, -2.986816700E+04, 7.209126800E+00] ) ) @@ -139,10 +139,10 @@ species(name = "H2O", species(name = "AR", atoms = " Ar:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 300.00, 1000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453749800E+02, 4.366000600E+00] ), - NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, + NASA( [ 1000.00, 5000.00], [ 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750200E+02, 4.366000600E+00] ) ) @@ -152,10 +152,10 @@ species(name = "AR", species(name = "PT(S)", atoms = " Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 0.000000000E+00, 0.000000000E+00, + NASA( [ 300.00, 1000.00], [ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00] ), - NASA( [ 1000.00, 3000.00], [ 0.000000000E+00, 0.000000000E+00, + NASA( [ 1000.00, 3000.00], [ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00] ) ) @@ -164,10 +164,10 @@ species(name = "PT(S)", species(name = "H(S)", atoms = " H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -1.302987700E+00, 5.417319900E-03, + NASA( [ 300.00, 1000.00], [ -1.302987700E+00, 5.417319900E-03, 3.127797200E-07, -3.232853300E-09, 1.136282000E-12, -4.227707500E+03, 5.874323800E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.069699600E+00, 1.543223000E-03, + NASA( [ 1000.00, 3000.00], [ 1.069699600E+00, 1.543223000E-03, -1.550092200E-07, -1.657316500E-10, 3.835934700E-14, -5.054612800E+03, -7.155523800E+00] ) ) @@ -176,10 +176,10 @@ species(name = "H(S)", species(name = "H2O(S)", atoms = " O:1 H:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -2.765155300E+00, 1.331511500E-02, + NASA( [ 300.00, 1000.00], [ -2.765155300E+00, 1.331511500E-02, 1.012769500E-06, -7.182008300E-09, 2.281377600E-12, -3.639805500E+04, 1.209814500E+01] ), - NASA( [ 1000.00, 3000.00], [ 2.580305100E+00, 4.957082700E-03, + NASA( [ 1000.00, 3000.00], [ 2.580305100E+00, 4.957082700E-03, -4.689405600E-07, -5.263313700E-10, 1.199832200E-13, -3.830223400E+04, -1.740632200E+01] ) ) @@ -188,10 +188,10 @@ species(name = "H2O(S)", species(name = "OH(S)", atoms = " O:1 H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -2.034088100E+00, 9.366268300E-03, + NASA( [ 300.00, 1000.00], [ -2.034088100E+00, 9.366268300E-03, 6.627521400E-07, -5.207488700E-09, 1.708873500E-12, -2.531994900E+04, 8.986318600E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.824997300E+00, 3.250156500E-03, + NASA( [ 1000.00, 3000.00], [ 1.824997300E+00, 3.250156500E-03, -3.119754100E-07, -3.460320600E-10, 7.917147200E-14, -2.668549200E+04, -1.228089100E+01] ) ) @@ -200,10 +200,10 @@ species(name = "OH(S)", species(name = "CO(S)", atoms = " C:1 O:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 4.890746600E+00, 6.813423500E-05, + NASA( [ 300.00, 1000.00], [ 4.890746600E+00, 6.813423500E-05, 1.976881400E-07, 1.238866900E-09, -9.033924900E-13, -3.229783600E+04, -1.745316100E+01] ), - NASA( [ 1000.00, 3000.00], [ 4.708377800E+00, 9.603729700E-04, + NASA( [ 1000.00, 3000.00], [ 4.708377800E+00, 9.603729700E-04, -1.180527900E-07, -7.688382600E-11, 1.823200000E-14, -3.231172300E+04, -1.671959300E+01] ) ) @@ -212,10 +212,10 @@ species(name = "CO(S)", species(name = "CO2(S)", atoms = " C:1 O:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 4.690000000E-01, 6.266200000E-03, + NASA( [ 300.00, 1000.00], [ 4.690000000E-01, 6.266200000E-03, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -5.045870000E+04, -4.555000000E+00] ), - NASA( [ 1000.00, 3000.00], [ 4.690000000E-01, 6.266000000E-03, + NASA( [ 1000.00, 3000.00], [ 4.690000000E-01, 6.266000000E-03, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -5.045870000E+04, -4.555000000E+00] ) ) @@ -224,10 +224,10 @@ species(name = "CO2(S)", species(name = "CH3(S)", atoms = " C:1 H:3 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 1.291921700E+00, 7.267560300E-03, + NASA( [ 300.00, 1000.00], [ 1.291921700E+00, 7.267560300E-03, 9.817947600E-07, -2.047129400E-09, 9.083271700E-14, -2.574561000E+03, -1.198303700E+00] ), - NASA( [ 1000.00, 3000.00], [ 3.001616500E+00, 5.408450500E-03, + NASA( [ 1000.00, 3000.00], [ 3.001616500E+00, 5.408450500E-03, -4.053805800E-07, -5.342246600E-10, 1.145188700E-13, -3.275272200E+03, -1.096598400E+01] ) ) @@ -236,10 +236,10 @@ species(name = "CH3(S)", species(name = "CH2(S)", atoms = " C:1 H:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -1.487640400E-01, 5.139628900E-03, + NASA( [ 300.00, 1000.00], [ -1.487640400E-01, 5.139628900E-03, 1.121107500E-06, -8.275545200E-10, -4.457234500E-13, 1.087870000E+04, 5.745188200E+00] ), - NASA( [ 1000.00, 3000.00], [ 7.407612200E-01, 4.803253300E-03, + NASA( [ 1000.00, 3000.00], [ 7.407612200E-01, 4.803253300E-03, -3.282563300E-07, -4.777978600E-10, 1.007345200E-13, 1.044375200E+04, 4.084208600E-01] ) ) @@ -248,10 +248,10 @@ species(name = "CH2(S)", species(name = "CH(S)", atoms = " C:1 H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 8.415748500E-01, 1.309538000E-03, + NASA( [ 300.00, 1000.00], [ 8.415748500E-01, 1.309538000E-03, 2.846457500E-07, 6.386290400E-10, -4.276665800E-13, 2.233280100E+04, 1.145230500E+00] ), - NASA( [ 1000.00, 3000.00], [ -4.824247200E-03, 3.044623900E-03, + NASA( [ 1000.00, 3000.00], [ -4.824247200E-03, 3.044623900E-03, -1.606609900E-07, -2.904170000E-10, 5.799992400E-14, 2.259521900E+04, 5.667781800E+00] ) ) @@ -260,10 +260,10 @@ species(name = "CH(S)", species(name = "C(S)", atoms = " C:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 5.892401900E-01, 2.501284200E-03, + NASA( [ 300.00, 1000.00], [ 5.892401900E-01, 2.501284200E-03, -3.422949800E-07, -1.899434600E-09, 1.019040600E-12, 1.023692300E+04, 2.193701700E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.579282400E+00, 3.652870100E-04, + NASA( [ 1000.00, 3000.00], [ 1.579282400E+00, 3.652870100E-04, -5.065767200E-08, -3.488485500E-11, 8.808969900E-15, 9.953575200E+03, -3.024049500E+00] ) ) @@ -272,17 +272,17 @@ species(name = "C(S)", species(name = "O(S)", atoms = " O:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -9.498690400E-01, 7.404230500E-03, + NASA( [ 300.00, 1000.00], [ -9.498690400E-01, 7.404230500E-03, -1.045142400E-06, -6.112042000E-09, 3.378799200E-12, -1.320991200E+04, 3.613790500E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.945418000E+00, 9.176164700E-04, + NASA( [ 1000.00, 3000.00], [ 1.945418000E+00, 9.176164700E-04, -1.122671900E-07, -9.909962400E-11, 2.430769900E-14, -1.400518700E+04, -1.153166300E+01] ) ) ) #------------------------------------------------------------------------------- -# Reaction data +# Reaction data #------------------------------------------------------------------------------- # Adsorption reactions @@ -316,12 +316,12 @@ surface_reaction( "CO + PT(S) => CO(S)", # Desorption reactions -surface_reaction( "2 H(S) => H2 + 2 PT(S)", - Arrhenius(3.70000E+21, 0, 67400, +surface_reaction( "2 H(S) => H2 + 2 PT(S)", + Arrhenius(3.70000E+21, 0, 67400, coverage = ['H(S)', 0.0, 0.0, -10000.0])) -surface_reaction( "2 O(S) => O2 + 2 PT(S)", - Arrhenius(3.70000E+21, 0, 235500, +surface_reaction( "2 O(S) => O2 + 2 PT(S)", + Arrhenius(3.70000E+21, 0, 235500, coverage = ['O(S)', 0.0, 0.0, -188300.0]) ) surface_reaction( "H2O(S) => H2O + PT(S)", [4.50000E+12, 0, 41800]) @@ -355,7 +355,7 @@ surface_reaction( "CO2(S) + PT(S) => CO(S) + O(S)", surface_reaction( "CO(S) + OH(S) => CO2(S) + H(S)", Arrhenius(1.0000E+19, 0, 38700, - coverage = ['CO(S)', 0.0, 0.0, -30000])) + coverage = ['CO(S)', 0.0, 0.0, -30000])) surface_reaction( "CO2(S) + H(S) => CO(S) + OH(S)", Arrhenius(1.0000E+19, 0, 8400)) @@ -369,7 +369,7 @@ surface_reaction( "CH2(S) + H(S) => CH3(S) + PT(S)", surface_reaction( "CH2(S) + PT(S) => CH(S) + H(S)", Arrhenius(7.3100E+22, 0, 58900, - coverage = ['C(S)', 0.0, 0.0, 50000])) + coverage = ['C(S)', 0.0, 0.0, 50000])) surface_reaction( "CH(S) + H(S) => CH2(S) + PT(S)", Arrhenius(3.0900E+22, 0, 0, coverage = ['H(S)', 0.0, 0.0, -2800])) diff --git a/data/inputs/ptcombust.cti b/data/inputs/ptcombust.cti index ef9c6b5ed..bfa614c95 100644 --- a/data/inputs/ptcombust.cti +++ b/data/inputs/ptcombust.cti @@ -1,5 +1,5 @@ # -# see http://reaflow.iwr.uni-heidelberg.de/~Olaf.Deutschmann/ for +# see http://reaflow.iwr.uni-heidelberg.de/~Olaf.Deutschmann/ for # more about this mechanism # #---------------------------------------------------------------------! @@ -22,7 +22,7 @@ # pp. 1747-1754 #---------------------------------------------------------------------- # -# Converted to Cantera format +# Converted to Cantera format # by ck2cti on Thu Aug 21 07:58:45 2003 # #---------------------------------------------------------------------- @@ -35,13 +35,13 @@ units(length = "cm", time = "s", quantity = "mol", act_energy = "J/mol") # Reactions will be imported from GRI-Mech 3.0, as long as they # don't involve species not declared here. Transport properties # will be computed using a mixture-averaged model. -# +# ideal_gas(name = "gas", elements = "O H C N Ar", - species = """gri30: H2 H O O2 OH - H2O HO2 H2O2 - C CH CH2 CH2(S) CH3 CH4 CO CO2 - HCO CH2O CH2OH CH3O CH3OH C2H C2H2 C2H3 + species = """gri30: H2 H O O2 OH + H2O HO2 H2O2 + C CH CH2 CH2(S) CH3 CH4 CO CO2 + HCO CH2O CH2OH CH3O CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH AR N2""", transport = 'Mix', reactions = 'gri30: all', @@ -74,10 +74,10 @@ ideal_interface(name = "Pt_surf", species(name = "PT(S)", atoms = " Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 0.000000000E+00, 0.000000000E+00, + NASA( [ 300.00, 1000.00], [ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00] ), - NASA( [ 1000.00, 3000.00], [ 0.000000000E+00, 0.000000000E+00, + NASA( [ 1000.00, 3000.00], [ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00] ) ) @@ -86,10 +86,10 @@ species(name = "PT(S)", species(name = "H(S)", atoms = " H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -1.302987700E+00, 5.417319900E-03, + NASA( [ 300.00, 1000.00], [ -1.302987700E+00, 5.417319900E-03, 3.127797200E-07, -3.232853300E-09, 1.136282000E-12, -4.227707500E+03, 5.874323800E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.069699600E+00, 1.543223000E-03, + NASA( [ 1000.00, 3000.00], [ 1.069699600E+00, 1.543223000E-03, -1.550092200E-07, -1.657316500E-10, 3.835934700E-14, -5.054612800E+03, -7.155523800E+00] ) ) @@ -98,10 +98,10 @@ species(name = "H(S)", species(name = "H2O(S)", atoms = " O:1 H:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -2.765155300E+00, 1.331511500E-02, + NASA( [ 300.00, 1000.00], [ -2.765155300E+00, 1.331511500E-02, 1.012769500E-06, -7.182008300E-09, 2.281377600E-12, -3.639805500E+04, 1.209814500E+01] ), - NASA( [ 1000.00, 3000.00], [ 2.580305100E+00, 4.957082700E-03, + NASA( [ 1000.00, 3000.00], [ 2.580305100E+00, 4.957082700E-03, -4.689405600E-07, -5.263313700E-10, 1.199832200E-13, -3.830223400E+04, -1.740632200E+01] ) ) @@ -110,10 +110,10 @@ species(name = "H2O(S)", species(name = "OH(S)", atoms = " O:1 H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -2.034088100E+00, 9.366268300E-03, + NASA( [ 300.00, 1000.00], [ -2.034088100E+00, 9.366268300E-03, 6.627521400E-07, -5.207488700E-09, 1.708873500E-12, -2.531994900E+04, 8.986318600E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.824997300E+00, 3.250156500E-03, + NASA( [ 1000.00, 3000.00], [ 1.824997300E+00, 3.250156500E-03, -3.119754100E-07, -3.460320600E-10, 7.917147200E-14, -2.668549200E+04, -1.228089100E+01] ) ) @@ -122,10 +122,10 @@ species(name = "OH(S)", species(name = "CO(S)", atoms = " C:1 O:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 4.890746600E+00, 6.813423500E-05, + NASA( [ 300.00, 1000.00], [ 4.890746600E+00, 6.813423500E-05, 1.976881400E-07, 1.238866900E-09, -9.033924900E-13, -3.229783600E+04, -1.745316100E+01] ), - NASA( [ 1000.00, 3000.00], [ 4.708377800E+00, 9.603729700E-04, + NASA( [ 1000.00, 3000.00], [ 4.708377800E+00, 9.603729700E-04, -1.180527900E-07, -7.688382600E-11, 1.823200000E-14, -3.231172300E+04, -1.671959300E+01] ) ) @@ -134,10 +134,10 @@ species(name = "CO(S)", species(name = "CO2(S)", atoms = " C:1 O:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 4.690000000E-01, 6.266200000E-03, + NASA( [ 300.00, 1000.00], [ 4.690000000E-01, 6.266200000E-03, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -5.045870000E+04, -4.555000000E+00] ), - NASA( [ 1000.00, 3000.00], [ 4.690000000E-01, 6.266000000E-03, + NASA( [ 1000.00, 3000.00], [ 4.690000000E-01, 6.266000000E-03, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -5.045870000E+04, -4.555000000E+00] ) ) @@ -146,10 +146,10 @@ species(name = "CO2(S)", species(name = "CH3(S)", atoms = " C:1 H:3 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 1.291921700E+00, 7.267560300E-03, + NASA( [ 300.00, 1000.00], [ 1.291921700E+00, 7.267560300E-03, 9.817947600E-07, -2.047129400E-09, 9.083271700E-14, -2.574561000E+03, -1.198303700E+00] ), - NASA( [ 1000.00, 3000.00], [ 3.001616500E+00, 5.408450500E-03, + NASA( [ 1000.00, 3000.00], [ 3.001616500E+00, 5.408450500E-03, -4.053805800E-07, -5.342246600E-10, 1.145188700E-13, -3.275272200E+03, -1.096598400E+01] ) ) @@ -158,10 +158,10 @@ species(name = "CH3(S)", species(name = "CH2(S)s", atoms = " C:1 H:2 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -1.487640400E-01, 5.139628900E-03, + NASA( [ 300.00, 1000.00], [ -1.487640400E-01, 5.139628900E-03, 1.121107500E-06, -8.275545200E-10, -4.457234500E-13, 1.087870000E+04, 5.745188200E+00] ), - NASA( [ 1000.00, 3000.00], [ 7.407612200E-01, 4.803253300E-03, + NASA( [ 1000.00, 3000.00], [ 7.407612200E-01, 4.803253300E-03, -3.282563300E-07, -4.777978600E-10, 1.007345200E-13, 1.044375200E+04, 4.084208600E-01] ) ) @@ -170,10 +170,10 @@ species(name = "CH2(S)s", species(name = "CH(S)", atoms = " C:1 H:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 8.415748500E-01, 1.309538000E-03, + NASA( [ 300.00, 1000.00], [ 8.415748500E-01, 1.309538000E-03, 2.846457500E-07, 6.386290400E-10, -4.276665800E-13, 2.233280100E+04, 1.145230500E+00] ), - NASA( [ 1000.00, 3000.00], [ -4.824247200E-03, 3.044623900E-03, + NASA( [ 1000.00, 3000.00], [ -4.824247200E-03, 3.044623900E-03, -1.606609900E-07, -2.904170000E-10, 5.799992400E-14, 2.259521900E+04, 5.667781800E+00] ) ) @@ -182,10 +182,10 @@ species(name = "CH(S)", species(name = "C(S)", atoms = " C:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ 5.892401900E-01, 2.501284200E-03, + NASA( [ 300.00, 1000.00], [ 5.892401900E-01, 2.501284200E-03, -3.422949800E-07, -1.899434600E-09, 1.019040600E-12, 1.023692300E+04, 2.193701700E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.579282400E+00, 3.652870100E-04, + NASA( [ 1000.00, 3000.00], [ 1.579282400E+00, 3.652870100E-04, -5.065767200E-08, -3.488485500E-11, 8.808969900E-15, 9.953575200E+03, -3.024049500E+00] ) ) @@ -194,10 +194,10 @@ species(name = "C(S)", species(name = "O(S)", atoms = " O:1 Pt:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -9.498690400E-01, 7.404230500E-03, + NASA( [ 300.00, 1000.00], [ -9.498690400E-01, 7.404230500E-03, -1.045142400E-06, -6.112042000E-09, 3.378799200E-12, -1.320991200E+04, 3.613790500E+00] ), - NASA( [ 1000.00, 3000.00], [ 1.945418000E+00, 9.176164700E-04, + NASA( [ 1000.00, 3000.00], [ 1.945418000E+00, 9.176164700E-04, -1.122671900E-07, -9.909962400E-11, 2.430769900E-14, -1.400518700E+04, -1.153166300E+01] ) ) @@ -206,16 +206,16 @@ species(name = "O(S)", #------------------------------------------------------------------------------- -# Reaction data +# Reaction data #------------------------------------------------------------------------------- # Reaction 1 -surface_reaction("H2 + 2 PT(S) => 2 H(S)", [4.45790E+10, 0.5, 0], +surface_reaction("H2 + 2 PT(S) => 2 H(S)", [4.45790E+10, 0.5, 0], order = "PT(S):1") # Reaction 2 -surface_reaction( "2 H(S) => H2 + 2 PT(S)", - Arrhenius(3.70000E+21, 0, 67400, +surface_reaction( "2 H(S) => H2 + 2 PT(S)", + Arrhenius(3.70000E+21, 0, 67400, coverage = ['H(S)', 0.0, 0.0, -6000.0])) # Reaction 3 @@ -230,8 +230,8 @@ surface_reaction( "O2 + 2 PT(S) => 2 O(S)", stick(2.30000E-02, 0, 0), options = 'duplicate') # Reaction 6 -surface_reaction( "2 O(S) => O2 + 2 PT(S)", - Arrhenius(3.70000E+21, 0, 213200, +surface_reaction( "2 O(S) => O2 + 2 PT(S)", + Arrhenius(3.70000E+21, 0, 213200, coverage = ['O(S)', 0.0, 0.0, -60000.0]) ) # Reaction 7 @@ -259,7 +259,7 @@ surface_reaction( "H(S) + OH(S) <=> H2O(S) + PT(S)", [3.70000E+21, 0, 17400]) surface_reaction( "OH(S) + OH(S) <=> H2O(S) + O(S)", [3.70000E+21, 0, 48200]) # Reaction 15 -surface_reaction( "CO + PT(S) => CO(S)", [1.61800E+20, 0.5, 0], +surface_reaction( "CO + PT(S) => CO(S)", [1.61800E+20, 0.5, 0], order = "PT(S):2") # Reaction 16 @@ -273,7 +273,7 @@ surface_reaction( "CO(S) + O(S) => CO2(S) + PT(S)", [3.70000E+21, 0, 105000]) # Reaction 19 surface_reaction( "CH4 + 2 PT(S) => CH3(S) + H(S)", [4.63340E+20, 0.5, 0], - order = "PT(S):2.3") + order = "PT(S):2.3") # Reaction 20 surface_reaction( "CH3(S) + PT(S) => CH2(S)s + H(S)", @@ -294,7 +294,7 @@ surface_reaction( "CO(S) + PT(S) => C(S) + O(S)", [1.00000E+18, 0, 184000]) # Reaction 25 (12/28/2009 HKM added: This is a fictious rxn that is added for numerical stability. # The issue is that if multiple surface species have a negative concentration, the # Jacobian for the surface problem will go singular due to the way negative concentrations -# are truncated within Cantera. Adding in unimolecular desorption rxns with neglibigle real +# are truncated within Cantera. Adding in unimolecular desorption rxns with neglibigle real # effects alleviates the problem.) surface_reaction( "C(S) => C + PT(S)", [3.7E7, 0, 62800]) diff --git a/data/inputs/silane.cti b/data/inputs/silane.cti index 46c1da372..2c5d75ad3 100644 --- a/data/inputs/silane.cti +++ b/data/inputs/silane.cti @@ -2,8 +2,8 @@ units(length='cm', time='s', quantity='mol', act_energy='cal/mol') ideal_gas(name='gas', elements="Si H He", - species="""H2 H HE SIH4 SI - SIH SIH2 SIH3 H3SISIH SI2H6 + species="""H2 H HE SIH4 SI + SIH SIH2 SIH3 H3SISIH SI2H6 H2SISIH2 SI3H8 SI2 SI3""", reactions='all', initial_state=state(temperature=300.0, pressure=OneAtm)) diff --git a/data/inputs/silicon.cti b/data/inputs/silicon.cti index fe519c079..cc295ad37 100644 --- a/data/inputs/silicon.cti +++ b/data/inputs/silicon.cti @@ -13,10 +13,10 @@ stoichiometric_solid(name = "silicon", species(name = "Si(cr)", atoms = " Si:1 ", thermo = ( - NASA( [ 200.00, 1000.00], [ -1.291769120E-01, 1.472031390E-02, + NASA( [ 200.00, 1000.00], [ -1.291769120E-01, 1.472031390E-02, -2.765101600E-05, 2.418782510E-08, -7.934529120E-12, -4.155164170E+02, -3.595700080E-01] ), - NASA( [ 1000.00, 1690.00], [ 1.755473820E+00, 3.172854970E-03, + NASA( [ 1000.00, 1690.00], [ 1.755473820E+00, 3.172854970E-03, -2.782364020E-06, 1.264580650E-09, -2.171284640E-13, -6.286573630E+02, -8.553411770E+00] ) ) diff --git a/data/inputs/silicon_carbide.cti b/data/inputs/silicon_carbide.cti index 76be0dc6a..25996b7ec 100644 --- a/data/inputs/silicon_carbide.cti +++ b/data/inputs/silicon_carbide.cti @@ -13,10 +13,10 @@ stoichiometric_solid(name = "silicon_carbide", species(name = "SiC(b)", atoms = " Si:1 C:1 ", thermo = ( - NASA( [ 300.00, 1000.00], [ -2.471590700E+00, 3.069378300E-02, + NASA( [ 300.00, 1000.00], [ -2.471590700E+00, 3.069378300E-02, -4.926308500E-05, 3.862638900E-08, -1.176162100E-11, -9.069126000E+03, 8.800921400E+00] ), - NASA( [ 1000.00, 4000.00], [ 3.797480900E+00, 3.187288600E-03, + NASA( [ 1000.00, 4000.00], [ 3.797480900E+00, 3.187288600E-03, -1.450233400E-06, 3.154974400E-10, -2.615899100E-14, -1.029193700E+04, -2.106779100E+01] ) ) diff --git a/data/inputs/water.cti b/data/inputs/water.cti index 734b9bf7a..86b935817 100644 --- a/data/inputs/water.cti +++ b/data/inputs/water.cti @@ -24,7 +24,7 @@ stoichiometric_liquid(name = "liquid_water", species(name = "H2O(S)", atoms = " H:2 O:1 ", thermo = ( - NASA( [ 200.00, 273.15], [ 5.296779700E+00, -6.757492470E-02, + NASA( [ 200.00, 273.15], [ 5.296779700E+00, -6.757492470E-02, 5.169421090E-04, -1.438533600E-06, 1.525647940E-09, -3.622665570E+04, -1.792204280E+01] ) ) @@ -33,7 +33,7 @@ species(name = "H2O(S)", species(name = "H2O(L)", atoms = " H:2 O:1 ", thermo = ( - NASA( [ 273.15, 600.00], [ 7.255750050E+01, -6.624454020E-01, + NASA( [ 273.15, 600.00], [ 7.255750050E+01, -6.624454020E-01, 2.561987460E-03, -4.365919230E-06, 2.781789810E-09, -4.188654990E+04, -2.882801370E+02] ) ) diff --git a/doc/sphinx/cti/input-files.rst b/doc/sphinx/cti/input-files.rst index 699bdae48..636472641 100644 --- a/doc/sphinx/cti/input-files.rst +++ b/doc/sphinx/cti/input-files.rst @@ -61,10 +61,10 @@ approximated as constant, then the following definition could be used:: species(name='C(gr)', atoms='C:1', - thermo=const_cp(t0=298.15, - h0=0.0, - s0=(5.6, 'J/mol/K'), # NIST - cp0=(8.43, 'J/mol/K'))) # Taylor and Groot (1980) + thermo=const_cp(t0=298.15, + h0=0.0, + s0=(5.6, 'J/mol/K'), # NIST + cp0=(8.43, 'J/mol/K'))) # Taylor and Groot (1980) Note that the thermo field is assigned an embedded entry of type :class:`const_cp`. Entries are stored as they are encountered when the file is @@ -337,7 +337,7 @@ in the input file is translated by the preprocessor to the following CTML text: O + HCCO [=] H + 2 CO - 1.000000E+14 + 1.000000E+14 0 0.000000 @@ -419,17 +419,17 @@ would terminate. :: Traceback (most recent call last): File "", line 1, in File "/some/path/Cantera/importFromFile.py", line 18, in importPhase - return importPhases(file, [name], loglevel, debug)[0] + return importPhases(file, [name], loglevel, debug)[0] File "/some/path/Cantera/importFromFile.py", line 25, in importPhases - s.append(solution.Solution(src=file,id=nm,loglevel=loglevel,debug=debug)) + s.append(solution.Solution(src=file,id=nm,loglevel=loglevel,debug=debug)) File "/some/path/solution.py", line 39, in __init__ - preprocess = 1, debug = debug) + preprocess = 1, debug = debug) File "/some/path/Cantera/XML.py", line 35, in __init__ - self._xml_id = _cantera.xml_get_XML_File(src, debug) + self._xml_id = _cantera.xml_get_XML_File(src, debug) cantera.error: ************************************************ - Cantera Error! + Cantera Error! ************************************************ Procedure: ct2ctml diff --git a/doc/sphinx/cti/species.rst b/doc/sphinx/cti/species.rst index d2d6c9a53..c6a1c7a8a 100644 --- a/doc/sphinx/cti/species.rst +++ b/doc/sphinx/cti/species.rst @@ -162,7 +162,7 @@ ranges. This can be specified by assigning the ``thermo`` field of the atoms = " O:2 ", thermo = ( NASA( [ 200.00, 1000.00], [ 3.782456360E+00, -2.996734160E-03, - 9.847302010E-06, -9.681295090E-09, 3.243728370E-12, + 9.847302010E-06, -9.681295090E-09, 3.243728370E-12, -1.063943560E+03, 3.657675730E+00] ), NASA( [ 1000.00, 3500.00], [ 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, -2.167177940E-14, diff --git a/doc/sphinx/cxx-guide/compiling.rst b/doc/sphinx/cxx-guide/compiling.rst index 3e163e728..a995a69e3 100644 --- a/doc/sphinx/cxx-guide/compiling.rst +++ b/doc/sphinx/cxx-guide/compiling.rst @@ -50,9 +50,9 @@ look like this:: env = Environment() env.Append(CCFLAGS='-g', - CPPPATH=['/usr/local/cantera/include', + CPPPATH=['/usr/local/cantera/include', '/usr/local/sundials/include'], - LIBS=['cantera', 'sundials_cvodes', 'sundials_ida', + LIBS=['cantera', 'sundials_cvodes', 'sundials_ida', 'sundials_nvecserial', 'lapack', 'blas'], LIBPATH=['/usr/local/cantera/lib', '/usr/local/sundials/lib'], diff --git a/doc/sphinx/cxx-guide/demo1a.cpp b/doc/sphinx/cxx-guide/demo1a.cpp index e2156d1d7..d7ea27865 100644 --- a/doc/sphinx/cxx-guide/demo1a.cpp +++ b/doc/sphinx/cxx-guide/demo1a.cpp @@ -6,7 +6,6 @@ using namespace Cantera; // can be called from the main program. void simple_demo() { - // Create a new phase ThermoPhase* gas = newPhase("h2o2.cti","ohmech"); @@ -28,7 +27,6 @@ void simple_demo() // might be thrown int main() { - try { simple_demo(); } catch (CanteraError& err) { diff --git a/doc/sphinx/cxx-guide/demoequil.cpp b/doc/sphinx/cxx-guide/demoequil.cpp index f99707fc5..551082e94 100644 --- a/doc/sphinx/cxx-guide/demoequil.cpp +++ b/doc/sphinx/cxx-guide/demoequil.cpp @@ -12,7 +12,6 @@ void equil_demo() int main() { - try { equil_demo(); } catch (CanteraError& err) { diff --git a/doc/sphinx/cxx-guide/equil-example.rst b/doc/sphinx/cxx-guide/equil-example.rst index 252992416..4725268fb 100644 --- a/doc/sphinx/cxx-guide/equil-example.rst +++ b/doc/sphinx/cxx-guide/equil-example.rst @@ -11,31 +11,31 @@ state of chemical equilibrium, holding the temperature and pressure fixed. The program output is:: - temperature 1500 K - pressure 202650 Pa - density 0.316828 kg/m^3 + temperature 1500 K + pressure 202650 Pa + density 0.316828 kg/m^3 mean mol. weight 19.4985 amu - 1 kg 1 kmol - ----------- ------------ - enthalpy -4.17903e+06 -8.149e+07 J + 1 kg 1 kmol + ----------- ------------ + enthalpy -4.17903e+06 -8.149e+07 J internal energy -4.81866e+06 -9.396e+07 J - entropy 11283.3 2.2e+05 J/K - Gibbs function -2.1104e+07 -4.115e+08 J + entropy 11283.3 2.2e+05 J/K + Gibbs function -2.1104e+07 -4.115e+08 J heat capacity c_p 1893.06 3.691e+04 J/K heat capacity c_v 1466.65 2.86e+04 J/K - X Y Chem. Pot. / RT - ------------- ------------ ------------ - H2 0.249996 0.0258462 -19.2954 - H 6.22521e-06 3.218e-07 -9.64768 - O 7.66933e-12 6.29302e-12 -26.3767 - O2 7.1586e-12 1.17479e-11 -52.7533 - OH 3.55353e-07 3.09952e-07 -36.0243 - H2O 0.499998 0.461963 -45.672 - HO2 7.30338e-15 1.2363e-14 -62.401 - H2O2 3.95781e-13 6.90429e-13 -72.0487 - AR 0.249999 0.51219 -21.3391 + X Y Chem. Pot. / RT + ------------- ------------ ------------ + H2 0.249996 0.0258462 -19.2954 + H 6.22521e-06 3.218e-07 -9.64768 + O 7.66933e-12 6.29302e-12 -26.3767 + O2 7.1586e-12 1.17479e-11 -52.7533 + OH 3.55353e-07 3.09952e-07 -36.0243 + H2O 0.499998 0.461963 -45.672 + HO2 7.30338e-15 1.2363e-14 -62.401 + H2O2 3.95781e-13 6.90429e-13 -72.0487 + AR 0.249999 0.51219 -21.3391 How can we tell that this is really a state of chemical equilibrium? Well, by diff --git a/doc/sphinx/cxx-guide/index.rst b/doc/sphinx/cxx-guide/index.rst index 0527f333d..66722af96 100644 --- a/doc/sphinx/cxx-guide/index.rst +++ b/doc/sphinx/cxx-guide/index.rst @@ -5,7 +5,7 @@ C++ Interface User's Guide .. toctree:: :maxdepth: 2 - + compiling headers thermo diff --git a/doc/sphinx/cxx-guide/thermo.rst b/doc/sphinx/cxx-guide/thermo.rst index 9a03d5d69..9276a144a 100644 --- a/doc/sphinx/cxx-guide/thermo.rst +++ b/doc/sphinx/cxx-guide/thermo.rst @@ -18,9 +18,9 @@ prints its temperature is shown below: int main(int argc, char** argv) { - Cantera::ThermoPhase* gas = Cantera::newPhase("h2o2.cti","ohmech"); - std::cout << gas->temperature() << std::endl; - return 0; + Cantera::ThermoPhase* gas = Cantera::newPhase("h2o2.cti","ohmech"); + std::cout << gas->temperature() << std::endl; + return 0; } Class :ct:`ThermoPhase` is the base class for Cantera classes that represent @@ -106,11 +106,11 @@ properties are computed and printed out: Note that the methods that compute the properties take no input parameters. The properties are computed for the state that has been previously set and stored internally within the object. - + Naming Conventions ------------------ -- methods that return *molar* properties have names that end in ``_mole``. +- methods that return *molar* properties have names that end in ``_mole``. - methods that return properties *per unit mass* have names that end in ``_mass``. - methods that write an array of values into a supplied output array have names diff --git a/doc/sphinx/language-interfaces.rst b/doc/sphinx/language-interfaces.rst index 14260c99c..f0630afa6 100644 --- a/doc/sphinx/language-interfaces.rst +++ b/doc/sphinx/language-interfaces.rst @@ -21,7 +21,7 @@ Python scripts to do calculations ranging from simple evaluation of thermodynamic or transport properties, on up to chemical equilibrium in multiphase mixtures, 1D laminar flames, reactor networks, and more. If your problem can be solved by using Cantera from Python, you'll almost certainly -solve it faster with Python than by writing programs in Fortran or C++. +solve it faster with Python than by writing programs in Fortran or C++. See http://www.python.org diff --git a/doc/sphinx/reactors.rst b/doc/sphinx/reactors.rst index 07dff227f..d063669d5 100644 --- a/doc/sphinx/reactors.rst +++ b/doc/sphinx/reactors.rst @@ -35,9 +35,9 @@ movement can be modeled depending on the pressure difference. Typically, interactions of the reactor with the environment are defined on one or multiple *walls*, *inlets*, and *outlets*. -In addition to single reactors, Cantera is also able to interconnect reactors -into a *Reactor Network*. Each reactor in a network may be connected so that -the contents of one reactor flow into another. Reactors may also be in contact +In addition to single reactors, Cantera is also able to interconnect reactors +into a *Reactor Network*. Each reactor in a network may be connected so that +the contents of one reactor flow into another. Reactors may also be in contact with one another or the environment via walls which move or conduct heat. Governing Equations for Single Reactors @@ -121,10 +121,10 @@ consistent with holding the pressure constant. Energy Conservation ------------------- -The solution of the energy equation can be enabled or disabled by changing the +The solution of the energy equation can be enabled or disabled by changing the ``energy_enabled`` flag. It is enabled by default. -The implemented formulation of the energy equation depends on which reactor +The implemented formulation of the energy equation depends on which reactor model is used. Standard Reactor @@ -164,9 +164,9 @@ Noting that `dp/dt = 0` and substituting into the energy equation yields: Ideal Gas Reactor ***************** -In case of the Ideal Gas Reactor Model, the reactor temperature `T` is used -instead of the total internal energy `U` as a state variable. For an ideal gas, -we can rewrite the total internal energy in terms of the mass fractions and +In case of the Ideal Gas Reactor Model, the reactor temperature `T` is used +instead of the total internal energy `U` as a state variable. For an ideal gas, +we can rewrite the total internal energy in terms of the mass fractions and temperature: .. math:: @@ -227,8 +227,8 @@ The total rate of heat transfer through all walls is: where `f_w = \pm 1` indicates the facing of the wall. In case of surface reactions, there is a net generation (or -destruction) of homogeneous phase species at the wall. The molar rate of -production for each species `k` on wall `w` is `\dot{s}_{k,w}` (in kmol/s/m\ +destruction) of homogeneous phase species at the wall. The molar rate of +production for each species `k` on wall `w` is `\dot{s}_{k,w}` (in kmol/s/m\ :sup:`2`). The total (mass) production rate for species `k` on all walls is: .. math:: @@ -246,14 +246,14 @@ each wall. The net mass flux from all walls is then: Reactor Networks and Devices ============================ -While reactors by themselves just define the above governing equations of the -reactor, the time integration is performed in reactor networks. A reactor +While reactors by themselves just define the above governing equations of the +reactor, the time integration is performed in reactor networks. A reactor network is therefore necessary even if only a single reactor is considered. -The advantage of reactor networks obviously is that multiple reactors can be -interconnected. Not only mass flow from one reactor into another can be -realized, but also heat can be transferred, or the wall between reactors can -move. To set up a network, the following components can be defined in addition +The advantage of reactor networks obviously is that multiple reactors can be +interconnected. Not only mass flow from one reactor into another can be +realized, but also heat can be transferred, or the wall between reactors can +move. To set up a network, the following components can be defined in addition to the reactors previously mentioned: - **Reservoir**: A reservoir can be thought of as an infinitely large volume, in @@ -281,12 +281,12 @@ to the reactors previously mentioned: The heat flux through the wall is computed from - .. math:: q = U(T_{\rm left} - T_{\rm right}) + \epsilon\sigma (T_{\rm left}^4 + .. math:: q = U(T_{\rm left} - T_{\rm right}) + \epsilon\sigma (T_{\rm left}^4 - T_{\rm right}^4) + q_0(t), where :math:`U` is the overall heat transfer coefficient for conduction/convection, and :math:`\epsilon` is the emissivity. The function - :math:`q_0(t)` is a specified function of time. The heat flux is positive when + :math:`q_0(t)` is a specified function of time. The heat flux is positive when heat flows from the reactor on the left to the reactor on the right. A heterogeneous reaction mechanism may be specified for one or both of the @@ -324,8 +324,8 @@ to the reactors previously mentioned: .. math:: \dot m = \max(\dot m_0, 0.0) - where :math:`\dot m_0` is either a constant value or a function of time. Note - that if :math:`\dot m_0 < 0`, the mass flow rate will be set to zero, since + where :math:`\dot m_0` is either a constant value or a function of time. Note + that if :math:`\dot m_0 < 0`, the mass flow rate will be set to zero, since reversal of the flow direction is not allowed. Unlike a real mass flow controller, a MassFlowController object will maintain @@ -348,9 +348,9 @@ to the reactors previously mentioned: Time Integration ---------------- -Cantera provides an ODE solver for solving the stiff equations of reacting -systems. If installed in combination with SUNDIALS, their optimized solver is -used. Starting off the current state of the system, it can be advanced in time +Cantera provides an ODE solver for solving the stiff equations of reacting +systems. If installed in combination with SUNDIALS, their optimized solver is +used. Starting off the current state of the system, it can be advanced in time by two methods: - ``step()``: The step method computes the state of the system at the a priori @@ -367,53 +367,53 @@ by two methods: Internally, several ``step()`` calls are typically performed to reach the accurate state at time `t_{\rm new}`. -The use of the ``advance`` method in a loop has the advantage that it produces -results corresponding to a predefined time series. These are associated with a -predefined memory consumption and well comparable between simulation runs with -different parameters. However, some detail (e.g. a fast ignition process) might +The use of the ``advance`` method in a loop has the advantage that it produces +results corresponding to a predefined time series. These are associated with a +predefined memory consumption and well comparable between simulation runs with +different parameters. However, some detail (e.g. a fast ignition process) might not be resolved in the output data due to the typically large time steps. -The ``step`` method results in much more data points because of the small -timesteps needed. Additionally, the absolute time has to be kept tracked of +The ``step`` method results in much more data points because of the small +timesteps needed. Additionally, the absolute time has to be kept tracked of manually. -Even though Cantera comes pre-defined with typical parameters for tolerances -and the maximum internal time step, the solution sometimes diverges. To solve -this problem, three parameters can be tuned: The absolute time stepping -tolerances, the relative time stepping tolerances, and the maximum time step. A -reduction of the latter value is particularly useful when dealing with abrupt -changes in the boundary conditions (e.g. opening/closing valves, see also +Even though Cantera comes pre-defined with typical parameters for tolerances +and the maximum internal time step, the solution sometimes diverges. To solve +this problem, three parameters can be tuned: The absolute time stepping +tolerances, the relative time stepping tolerances, and the maximum time step. A +reduction of the latter value is particularly useful when dealing with abrupt +changes in the boundary conditions (e.g. opening/closing valves, see also example :ref:`py-example-ic_engine.py`). General Usage in Cantera ======================== -In Cantera, the following steps are typically necessary to investigate a +In Cantera, the following steps are typically necessary to investigate a reactor network: -1. Define ``Solution`` objects for the fluids to be flowing through your +1. Define ``Solution`` objects for the fluids to be flowing through your reactor network. -2. Define the reactor type(s) and reservoir(s) that describe your system. Chose +2. Define the reactor type(s) and reservoir(s) that describe your system. Chose Ideal Gas (Constant Pressure) Reactor(s) if you only consider ideal gas phases. -3. *Optional:* Set up the boundary conditions and flow devices between reactors +3. *Optional:* Set up the boundary conditions and flow devices between reactors or reservoirs. 4. Define a reactor network which contains all the reactors previously created. -5. Advance the simulation in time, typically in a for- or while-loop. Note that -only the current state is stored in Cantera by default. If you want to observe +5. Advance the simulation in time, typically in a for- or while-loop. Note that +only the current state is stored in Cantera by default. If you want to observe the transient states, you manually have to keep track of them. 6. Analyze the data. -Note that Cantera always solves a transient problem. If you are interested in -steady-state conditions, you can run your simulation for a long time until the +Note that Cantera always solves a transient problem. If you are interested in +steady-state conditions, you can run your simulation for a long time until the states are converged (see e.g. example :ref:`py-example-surf_pfr.py`, :ref:`py-example-combustor.py`). -Cantera comes with a broad variety of well-commented example scrips for reactor +Cantera comes with a broad variety of well-commented example scrips for reactor networks. Please refer to them for further information (:ref:`Python `, :ref:`Matlab `). Common Reactor Types and their Implementation in Cantera @@ -422,18 +422,18 @@ Common Reactor Types and their Implementation in Cantera Batch Reactor at Constant Volume or at Constant Pressure -------------------------------------------------------- -If you are interested in how a homogeneous chemical composition changes in time -when it is left to its own, a simple batch reactor can be used. Two versions -are commonly considered: A rigid vessel with fixed volume but variable +If you are interested in how a homogeneous chemical composition changes in time +when it is left to its own, a simple batch reactor can be used. Two versions +are commonly considered: A rigid vessel with fixed volume but variable pressure, or a system idealized at constant pressure but varying volume. -In Cantera, such a simulation can be performed very easily. The initial state -of the solution can be specified by composition and a set of thermodynamic -parameters (like temperature and pressure) as a standard Cantera solution -object. Upon its base, a general (Ideal Gas) Reactor or an (Ideal Gas) Constant -Pressure Reactor can be created, depending on if a constant volume or constant -pressure batch reactor should be considered, respectively. The behavior of the -solution in time can be simulated as a very simple Reactor Network containing +In Cantera, such a simulation can be performed very easily. The initial state +of the solution can be specified by composition and a set of thermodynamic +parameters (like temperature and pressure) as a standard Cantera solution +object. Upon its base, a general (Ideal Gas) Reactor or an (Ideal Gas) Constant +Pressure Reactor can be created, depending on if a constant volume or constant +pressure batch reactor should be considered, respectively. The behavior of the +solution in time can be simulated as a very simple Reactor Network containing only the formerly created reactor. An example for such a Batch Reactor is :ref:`py-example-reactor1.py`. @@ -441,49 +441,49 @@ An example for such a Batch Reactor is :ref:`py-example-reactor1.py`. Continuously Stirred Tank Reactor --------------------------------- -A Continuously Stirred Tank Reactor (CSTR), also often referred to as -Well-Stirred Reactor (WSR), Perfectly Stirred Reactor (PSR), or Longwell -Reactor, is essentially a single Cantera reactor with an inlet, an outlet, and -constant volume. Therefore, the `Governing Equations for Single Reactors`_ +A Continuously Stirred Tank Reactor (CSTR), also often referred to as +Well-Stirred Reactor (WSR), Perfectly Stirred Reactor (PSR), or Longwell +Reactor, is essentially a single Cantera reactor with an inlet, an outlet, and +constant volume. Therefore, the `Governing Equations for Single Reactors`_ defined above apply accordingly. -Steady state solutions to CSTRs are often of interest. In this case, the mass -flow rate `\dot{m}` is constant and equal at inlet and outlet. The mass -contained in the confinement `m` divided by `\dot{m}` defines the mean +Steady state solutions to CSTRs are often of interest. In this case, the mass +flow rate `\dot{m}` is constant and equal at inlet and outlet. The mass +contained in the confinement `m` divided by `\dot{m}` defines the mean residence time of the fluid in the confinement. -At steady state, the time derivatives in the governing equations become zero, -and the system of ordinary differential equations can be reduced to a set of -coupled nonlinear algebraic equations. A Newton solver could be used to solve -this system of equations. However, a sophisticated implementation might be -required to account for the strong nonlinearities and the presence of multiple +At steady state, the time derivatives in the governing equations become zero, +and the system of ordinary differential equations can be reduced to a set of +coupled nonlinear algebraic equations. A Newton solver could be used to solve +this system of equations. However, a sophisticated implementation might be +required to account for the strong nonlinearities and the presence of multiple solutions. -Cantera does not have such a Newton solver implemented. Instead, steady CSTRs -are simulated by considering a time-dependent constant volume reactor with -specified in- and outflow conditions. Starting off at an initial solution, the -reactor network containing this reactor is advanced in time until the state of +Cantera does not have such a Newton solver implemented. Instead, steady CSTRs +are simulated by considering a time-dependent constant volume reactor with +specified in- and outflow conditions. Starting off at an initial solution, the +reactor network containing this reactor is advanced in time until the state of the solution is converged. An example for this procedure is :ref:`py-example-combustor.py`. -A problem can be the ignition of a CSTR: If the reactants are not reactive -enough, the simulation can result in the trivial solution that inflow and -outflow states are identical. To solve this problem, the reactor can be -initialized with a high temperature and/or radical concentration. A good -approach is to use the equilibrium composition of the reactants (which can be +A problem can be the ignition of a CSTR: If the reactants are not reactive +enough, the simulation can result in the trivial solution that inflow and +outflow states are identical. To solve this problem, the reactor can be +initialized with a high temperature and/or radical concentration. A good +approach is to use the equilibrium composition of the reactants (which can be computed using Cantera's ``equilibrate`` function) as an initial guess. Plug-Flow Reactor ----------------- -A Plug-Flow Reactor (PFR) represents a steady-state channel with a -cross-sectional area `A`. Typically an ideal gas flows through it at a constant -mass flow rate `\dot{m}`. Perpendicular to the flow direction, the gas is -considered to be completely homogeneous. In the axial direction `z`, the states +A Plug-Flow Reactor (PFR) represents a steady-state channel with a +cross-sectional area `A`. Typically an ideal gas flows through it at a constant +mass flow rate `\dot{m}`. Perpendicular to the flow direction, the gas is +considered to be completely homogeneous. In the axial direction `z`, the states of the gas is allowed to change. However, all diffusion processes are neglected. -Plug-Flow Reactors are often used to simulate ignition delay times, emission +Plug-Flow Reactors are often used to simulate ignition delay times, emission formation, and catalytic processes. The governing equations of Plug-Flow Reactors are [KCG2003]_: @@ -492,7 +492,7 @@ The governing equations of Plug-Flow Reactors are [KCG2003]_: .. math:: \frac{d(\rho u A)}{dz} = P' \sum_k \dot{s}_k W_k - where `u` is the axial velocity in (m/s) and `P'` is the chemically active + where `u` is the axial velocity in (m/s) and `P'` is the chemically active channel perimeter in (m) (chemically active perimeter per unit length). - Continuity equation of species `k`: @@ -507,8 +507,8 @@ The governing equations of Plug-Flow Reactors are [KCG2003]_: - P' \sum_k h_k \dot{s}_k W_k + U P (T_w - T) - where `U` is the heat transfer coefficient in (W/m/K), `P` is the perimeter of - the duct in (m), and `T_w` is the wall temperature in (K). Kinetic and + where `U` is the heat transfer coefficient in (W/m/K), `P` is the perimeter of + the duct in (m), and `T_w` is the wall temperature in (K). Kinetic and potential energies are neglected. - Momentum conservation in the axial direction: @@ -516,31 +516,31 @@ The governing equations of Plug-Flow Reactors are [KCG2003]_: .. math:: \rho u A \frac{d u}{d z} + u P' \sum_k \dot{s}_k W_k = - \frac{d (p A)}{dz} - \tau_w P - where `\tau_w` is the wall friction coefficient (which might be computed from + where `\tau_w` is the wall friction coefficient (which might be computed from Reynolds number based correlations). -Even though this problem extends geometrically in one direction, it can be -modeled via zero-dimensional reactors: Due to the neglecting of diffusion, -downstream parts of the reactor have no influence on upstream parts. Therefore, +Even though this problem extends geometrically in one direction, it can be +modeled via zero-dimensional reactors: Due to the neglecting of diffusion, +downstream parts of the reactor have no influence on upstream parts. Therefore, PFRs can be modeled by marching from the beginning to the end of the reactor. -Cantera does not (yet) provide dedicated class to solve the PFR equations (The -``FlowReactor`` class is currently under development). However, there are two -ways to simulate a PFR with the reactor elements previously presented. Both -rely on the assumption that pressure is approximately constant throughout the -Plug-Flow Reactor and that there is no friction. The momentum conservation +Cantera does not (yet) provide dedicated class to solve the PFR equations (The +``FlowReactor`` class is currently under development). However, there are two +ways to simulate a PFR with the reactor elements previously presented. Both +rely on the assumption that pressure is approximately constant throughout the +Plug-Flow Reactor and that there is no friction. The momentum conservation equation is thus neglected. PFR Modeling by Considering a Lagrangian Reactor ************************************************ -A Plug-Flow Reactor can also be described from a Lagrangian point of view: An -unsteady fluid particle is considered which travels along the axial streamline -through the PFR. Since there is no information traveling upstream, the state -change of the fluid particle can be computed by a forward (upwind) integration -in time. Using the continuity equation, the speed of the particle can be -derived. By integrating the velocity in time, the temporal information can be +A Plug-Flow Reactor can also be described from a Lagrangian point of view: An +unsteady fluid particle is considered which travels along the axial streamline +through the PFR. Since there is no information traveling upstream, the state +change of the fluid particle can be computed by a forward (upwind) integration +in time. Using the continuity equation, the speed of the particle can be +derived. By integrating the velocity in time, the temporal information can be translated into the spatial resolution of the PFR. An example for this procedure can be found in :ref:`py-example-pfr.py`. @@ -549,20 +549,20 @@ An example for this procedure can be found in :ref:`py-example-pfr.py`. PFR Modeling as a Series of CSTRs ********************************* -The Plug-Flow Reactor is spatially discretized into a large number of axially +The Plug-Flow Reactor is spatially discretized into a large number of axially distributed volumes. These volumes are modeled to be steady-state CSTRs. -The only reason to use this approach as opposed to the Lagrangian one is if you -need to include surface reactions, because the system of equations ends up +The only reason to use this approach as opposed to the Lagrangian one is if you +need to include surface reactions, because the system of equations ends up being a DAE system instead of an ODE system. -In Cantera, it is sufficient to consider a single reactor and march it forward -in time, because there is no information traveling upstream. The mass flow rate -`\dot{m}` through the PFR enters the reactor from an upstream reservoir. For -the first reactor, the reservoir conditions are the inflow boundary conditions -of the PFR. By performing a time integration as described in `Continuously -Stirred Tank Reactor`_ until the state of the reactor is converged, the -steady-state CSTR solution is computed. The state of the CSTR is the inlet +In Cantera, it is sufficient to consider a single reactor and march it forward +in time, because there is no information traveling upstream. The mass flow rate +`\dot{m}` through the PFR enters the reactor from an upstream reservoir. For +the first reactor, the reservoir conditions are the inflow boundary conditions +of the PFR. By performing a time integration as described in `Continuously +Stirred Tank Reactor`_ until the state of the reactor is converged, the +steady-state CSTR solution is computed. The state of the CSTR is the inlet boundary condition for the next CSTR downstream. An example for this procedure can be found in :ref:`py-example-pfr.py` and @@ -572,9 +572,9 @@ An example for this procedure can be found in :ref:`py-example-pfr.py` and Advanced Concepts ================= -In some cases, Cantera's solver is insufficient to describe a certain -configuration. In this situation, Cantera can still be used to provide chemical -and thermodynamic computations, but external ODE solvers can be applied. See +In some cases, Cantera's solver is insufficient to describe a certain +configuration. In this situation, Cantera can still be used to provide chemical +and thermodynamic computations, but external ODE solvers can be applied. See example :ref:`py-example-custom.py`. @@ -583,8 +583,8 @@ Literature For further reading, the following books are recommended: -.. [KCG2003] Kee, Coltrin, Glarborg: *Chemically Reacting Flow*. +.. [KCG2003] Kee, Coltrin, Glarborg: *Chemically Reacting Flow*. Wiley-Interscience, 2003 -.. [Tur2000] Turns: *An Introduction to Combustion: Concepts and Applications*, +.. [Tur2000] Turns: *An Introduction to Combustion: Concepts and Applications*, McGraw Hill, 2000 diff --git a/include/cantera/Edge.h b/include/cantera/Edge.h index f22d8ac7c..9bf9c1cd2 100644 --- a/include/cantera/Edge.h +++ b/include/cantera/Edge.h @@ -14,8 +14,8 @@ class Edge : { public: Edge(const std::string& infile, std::string id, std::vector phases) - : m_ok(false), m_r(0) { - + : m_ok(false), m_r(0) + { m_r = get_XML_File(infile); if (id == "-") { id = ""; @@ -45,5 +45,4 @@ protected: }; } - #endif diff --git a/include/cantera/IdealGasMix.h b/include/cantera/IdealGasMix.h index bd24df2f6..578027bd6 100644 --- a/include/cantera/IdealGasMix.h +++ b/include/cantera/IdealGasMix.h @@ -15,12 +15,11 @@ class IdealGasMix : public GasKinetics { public: - IdealGasMix() : m_ok(false), m_r(0) {} IdealGasMix(const std::string& infile, std::string id_="") : - m_ok(false), m_r(0) { - + m_ok(false), m_r(0) + { m_r = get_XML_File(infile); m_id = id_; if (id_ == "-") { @@ -32,7 +31,6 @@ public: "Cantera::buildSolutionFromXML returned false"); } - IdealGasMix(XML_Node& root, std::string id_) : m_ok(false), m_r(&root), m_id(id_) { m_ok = buildSolutionFromXML(root, id_, "phase", this, this); @@ -56,7 +54,6 @@ public: return s; } - protected: bool m_ok; XML_Node* m_r; @@ -64,5 +61,4 @@ protected: }; } - #endif diff --git a/include/cantera/IncompressibleSolid.h b/include/cantera/IncompressibleSolid.h index ae208e2bd..9ffe8aa03 100644 --- a/include/cantera/IncompressibleSolid.h +++ b/include/cantera/IncompressibleSolid.h @@ -12,8 +12,8 @@ class IncompressibleSolid : public ConstDensityThermo { public: IncompressibleSolid(const std::string& infile, - std::string id="") : m_ok(false), m_r(0) { - + std::string id="") : m_ok(false), m_r(0) + { m_r = get_XML_File(infile); if (id == "-") { id = ""; @@ -36,5 +36,4 @@ protected: }; } - #endif diff --git a/include/cantera/Metal.h b/include/cantera/Metal.h index c195038e2..f0eec81d2 100644 --- a/include/cantera/Metal.h +++ b/include/cantera/Metal.h @@ -11,8 +11,8 @@ namespace Cantera class Metal : public MetalPhase { public: - Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0) { - + Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0) + { m_r = get_XML_File(infile); if (id == "-") { id = ""; @@ -35,5 +35,4 @@ protected: }; } - #endif diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index dcc2901dc..bc3d0b71e 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -3,7 +3,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef CT_ARRAY_H #define CT_ARRAY_H @@ -251,7 +250,6 @@ public: return value(i,j); } - //! Allows retrieving elements using the syntax x = A(i,j). /*! * @param i Index for the row to be retrieved diff --git a/include/cantera/base/FactoryBase.h b/include/cantera/base/FactoryBase.h index 5c2034261..7e7676b58 100644 --- a/include/cantera/base/FactoryBase.h +++ b/include/cantera/base/FactoryBase.h @@ -52,11 +52,9 @@ protected: virtual void deleteFactory() = 0 ; private: - //! statically held list of Factories. static std::vector s_vFactoryRegistry ; }; } #endif - diff --git a/include/cantera/base/clockWC.h b/include/cantera/base/clockWC.h index e6e98d086..360e98a5c 100644 --- a/include/cantera/base/clockWC.h +++ b/include/cantera/base/clockWC.h @@ -34,7 +34,6 @@ namespace Cantera * An example of how to use the timer is given below. timeToDoCalcs * contains the wall clock time calculated for the operation. * - * * @code * clockWC wc; * do_hefty_calculations_atLeastgreaterThanAMillisecond(); diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index 4de3b17bf..21cdb8422 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -31,7 +31,6 @@ typedef double doublereal; // Fortran double precision typedef int integer; // Fortran integer typedef int ftnlen; // Fortran hidden string length type - // Fortran compilers pass character strings in argument lists by // adding a hidden argument with the length of the string. Some // compilers add the hidden length argument immediately after the @@ -42,7 +41,6 @@ typedef int ftnlen; // Fortran hidden string length type // Visual Fortran under Windows. #define STRING_LEN_AT_END - // Define this if Fortran adds a trailing underscore to names in object files. // For linux and most unix systems, this is the case. %(FTN_TRAILING_UNDERSCORE)s diff --git a/include/cantera/base/ct_thread.h b/include/cantera/base/ct_thread.h index e288b6630..040c013b2 100644 --- a/include/cantera/base/ct_thread.h +++ b/include/cantera/base/ct_thread.h @@ -11,7 +11,6 @@ #ifdef THREAD_SAFE_CANTERA #include #include - #endif namespace Cantera diff --git a/include/cantera/base/logger.h b/include/cantera/base/logger.h index 00bc4951f..57d8f4a79 100644 --- a/include/cantera/base/logger.h +++ b/include/cantera/base/logger.h @@ -39,7 +39,6 @@ namespace Cantera class Logger { public: - //! Constructor - empty Logger() {} diff --git a/include/cantera/base/stringUtils.h b/include/cantera/base/stringUtils.h index a71796895..f93b597e6 100644 --- a/include/cantera/base/stringUtils.h +++ b/include/cantera/base/stringUtils.h @@ -101,7 +101,6 @@ compositionMap parseCompString(const std::string& ss, * atoi() is used. * * @param val String value of the integer - * * @return Returns an integer */ int intValue(const std::string& val); @@ -111,7 +110,6 @@ int intValue(const std::string& val); * No error checking is done on the conversion. * * @param val String value of the double - * * @return Returns a doublereal value */ doublereal fpValue(const std::string& val); @@ -171,7 +169,6 @@ std::string wrapString(const std::string& s, * Example: "1.0 atm" results in the number 1.01325e5. * * @param strSI string to be converted. One or two tokens - * * @return returns a converted double */ doublereal strSItoDbl(const std::string& strSI); diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index 986852729..d4fae6874 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -42,7 +42,6 @@ template struct timesConstant : public std::unary_function { /*! * @param x Variable of templated type T that will be * used in the multiplication operator - * * @return Returns a value of type double from the internal * multiplication */ @@ -71,7 +70,6 @@ inline doublereal dot4(const V& x, const V& y) return x[0]*y[0] + x[1]*y[1] + x[2]*y[2] + x[3]*y[3]; } - //! Templated Inner product of two vectors of length 5 /*! * If either \a x @@ -342,7 +340,6 @@ inline void scatter_copy(InputIter begin, InputIter end, } } - //! Multiply selected elements in an array by a contiguous //! sequence of multipliers. /*! diff --git a/include/cantera/base/xml.h b/include/cantera/base/xml.h index d4126bfa9..3eba6f203 100644 --- a/include/cantera/base/xml.h +++ b/include/cantera/base/xml.h @@ -52,7 +52,6 @@ public: * @param aline This is the input string to be searched * @param rstring Return value of the string that is found. * The quotes are stripped from the string. - * * @return Returns the integer position just after * the quoted string. */ @@ -103,7 +102,6 @@ public: //! Constructor for XML_Node, representing a tree structure /*! * @param nm Name of the node. - * * @param parent Pointer to the parent for this node in the tree. * A value of 0 indicates this is the top of the tree. */ @@ -128,7 +126,6 @@ public: * There is no copy made of the child node. The child node should not be deleted in the future * * @param node Reference to a child XML_Node object - * * @return Returns a reference to the added child node */ XML_Node& mergeAsChild(XML_Node& node); @@ -140,7 +137,6 @@ public: * A copy is made of the underlying tree * * @param node Reference to a child XML_Node object - * * @return returns a reference to the added node */ XML_Node& addChild(const XML_Node& node); @@ -151,7 +147,6 @@ public: * The node will be blank except for the specified name. * * @param sname Name of the new child - * * @return Returns a reference to the added node */ XML_Node& addChild(const std::string& sname); @@ -182,7 +177,6 @@ public: * @param name Name of the child XML_Node object * @param value Value of the XML_Node - double. * @param fmt Format of the output for value - * * @return Returns a reference to the created child XML_Node object */ XML_Node& addChild(const std::string& name, const doublereal value, @@ -298,7 +292,6 @@ public: * an attribute with that name. * * @param attr attribute string to look up - * * @return Returns a string representing the value of the attribute * within the XML node. If there is no attribute * with the given name, it returns the null string. @@ -312,7 +305,6 @@ public: * string. If no match is found, the empty string is returned. * * @param attr String containing the attribute to be searched for. - * * @return Returns If a match is found, the attribute value is returned * as a string. If no match is found, the empty string is * returned. @@ -359,7 +351,6 @@ public: //! Sets the pointer for the parent node of the current node /*! * @param p Pointer to the parent node - * * @return Returns the pointer p */ XML_Node* setParent(XML_Node* const p); @@ -367,7 +358,6 @@ public: //! Tests whether the current node has a child node with a particular name /*! * @param ch Name of the child node to test - * * @return Returns true if the child node exists, false otherwise. */ bool hasChild(const std::string& ch) const; @@ -375,7 +365,6 @@ public: //! Tests whether the current node has an attribute with a particular name /*! * @param a Name of the attribute to test - * * @return Returns true if the attribute exists, false otherwise. */ bool hasAttrib(const std::string& a) const; @@ -398,8 +387,7 @@ public: //! Return the id attribute, if present /*! - * Returns the id attribute if present. If not - * it return the empty string + * Returns the id attribute if present. If not it return the empty string */ std::string id() const; @@ -413,7 +401,6 @@ public: /*! * Each of the individual XML_Node child pointers, however, * is to a changeable XML node object. - * */ const std::vector& children() const; @@ -450,7 +437,6 @@ public: * @param nameTarget Name of the XML Node that is being searched for * @param idTarget "id" attribute of the XML Node that the routine * looks for - * * @return Returns the pointer to the XML node that fits the criteria * * @internal @@ -476,7 +462,6 @@ public: * looks for * @param index Integer describing the index. The index is an * attribute of the form index = "3" - * * @return Returns the pointer to the XML node that fits the criteria */ XML_Node* findNameIDIndex(const std::string& nameTarget, @@ -495,7 +480,6 @@ public: * @param id "id" attribute of the XML Node that the routine * looks for * @param depth Depth of the search. - * * @return Returns the pointer to the XML node that fits the criteria * * @internal @@ -511,12 +495,10 @@ public: * the attribute, the pointer to the matching XML Node is returned. If * not, 0 is returned. * - * @param attr Attribute of the XML Node that the routine - * looks for + * @param attr Attribute of the XML Node that the routine looks for * @param val Value of the attribute * @param depth Depth of the search. A value of 1 means that only the * immediate children are searched. - * * @return Returns the pointer to the XML node that fits the criteria */ XML_Node* findByAttr(const std::string& attr, const std::string& val, @@ -532,7 +514,6 @@ public: * @param nm Name of the XML node * @param depth Depth of the search. A value of 1 means that only the * immediate children are searched. - * * @return Returns the pointer to the XML node that fits the criteria */ const XML_Node* findByName(const std::string& nm, int depth = 100000) const; @@ -547,7 +528,6 @@ public: * @param nm Name of the XML node * @param depth Depth of the search. A value of 1 means that only the * immediate children are searched. - * * @return Returns the pointer to the XML node that fits the criteria */ XML_Node* findByName(const std::string& nm, int depth = 100000); @@ -589,8 +569,7 @@ public: //! Return the root of the current XML_Node tree /*! - * Returns a reference to the root of the current - * XML tree + * Returns a reference to the root of the current XML tree */ XML_Node& root() const; diff --git a/include/cantera/equil/ChemEquil.h b/include/cantera/equil/ChemEquil.h index 95d78b967..e4bfec3a6 100644 --- a/include/cantera/equil/ChemEquil.h +++ b/include/cantera/equil/ChemEquil.h @@ -63,7 +63,6 @@ class PropertyCalculator; /** * @defgroup equil Chemical Equilibrium - * */ /** @@ -146,9 +145,7 @@ public: */ EquilOpt options; - protected: - //! Pointer to the ThermoPhase object used to initialize this object. /*! * This ThermoPhase object must be compatible with the ThermoPhase diff --git a/include/cantera/equil/MultiPhase.h b/include/cantera/equil/MultiPhase.h index aed3cfdf3..77aad5e79 100644 --- a/include/cantera/equil/MultiPhase.h +++ b/include/cantera/equil/MultiPhase.h @@ -155,8 +155,7 @@ public: * fractions into array \c x. The mole fractions are * normalized to sum to one in each phase. * - * @param x vector of mole fractions. - * Length = number of global species. + * @param x vector of mole fractions. Length = number of global species. */ void getMoleFractions(doublereal* const x) const; @@ -238,7 +237,6 @@ public: * @param phaseName Phase Name * * @return returns the global index - * * If the species or phase name is not recognized, this routine throws * a CanteraError. */ @@ -318,10 +316,8 @@ public: * * @param not_mu Value of the chemical potential to set species in phases, * for which the thermo data is not valid - * * @param mu Vector of chemical potentials. length = Global species, * units = J kmol-1 - * * @param standard If this method is called with \a standard set to true, * then the composition-independent standard chemical * potentials are returned instead of the composition- @@ -442,7 +438,6 @@ public: //! Returns the phase index of the Kth "global" species /*! * @param kGlob Global species index. - * * @return Returns the index of the owning phase. */ size_t speciesPhaseIndex(const size_t kGlob) const; @@ -735,8 +730,7 @@ inline std::ostream& operator<<(std::ostream& s, MultiPhase& x) * reaction matrix based on the calculated component species. If * false, this step is skipped. * @param[out] usedZeroedSpecies = If true, then a species with a zero - * concentration was used as a component. The problem may be - * converged. + * concentration was used as a component. The problem may be converged. * @param[out] formRxnMatrix * @return The number of components. * diff --git a/include/cantera/equil/vcs_VolPhase.h b/include/cantera/equil/vcs_VolPhase.h index dc1a0aee9..2d91af47c 100644 --- a/include/cantera/equil/vcs_VolPhase.h +++ b/include/cantera/equil/vcs_VolPhase.h @@ -493,7 +493,6 @@ public: //! Returns the type of the species unknown /*! * @param k species index - * * @return the SpeciesUnknownType[k] = type of species * - Normal -> VCS_SPECIES_TYPE_MOLUNK (unknown is the mole number in * the phase) @@ -890,7 +889,6 @@ private: //! Return a string representing the equation of state /*! * @param EOSType : integer value of the equation of state - * * @return returns a string representing the EOS. The string is no more than 16 characters. */ std::string string16_EOSType(int EOSType); diff --git a/include/cantera/equil/vcs_defs.h b/include/cantera/equil/vcs_defs.h index 7fd44ab17..e7c016257 100644 --- a/include/cantera/equil/vcs_defs.h +++ b/include/cantera/equil/vcs_defs.h @@ -15,7 +15,6 @@ namespace Cantera { /*! * ERROR CODES - * */ //@{ #define VCS_SUCCESS 0 @@ -30,7 +29,6 @@ namespace Cantera /*! * @name Type of the underlying equilibrium solve - * * @{ */ @@ -93,7 +91,6 @@ namespace Cantera /*! * @name State of Dimensional Units for Gibbs free energies - * * @{ */ //! nondimensional @@ -336,7 +333,6 @@ namespace Cantera /*! * @name Types of Species Unknowns in the problem - * * @{ */ //! Unknown refers to mole number of a single species diff --git a/include/cantera/equil/vcs_prob.h b/include/cantera/equil/vcs_prob.h index 38f33a102..a2d3f9bcb 100644 --- a/include/cantera/equil/vcs_prob.h +++ b/include/cantera/equil/vcs_prob.h @@ -298,7 +298,6 @@ public: * @param elNameNew New name of the element * @param elType Type of the element * @param elactive boolean indicating whether the element is active - * * @return returns the index number of the new element */ size_t addElement(const char* elNameNew, int elType, int elactive); diff --git a/include/cantera/equil/vcs_solve.h b/include/cantera/equil/vcs_solve.h index 56af4607f..d9b2891a5 100644 --- a/include/cantera/equil/vcs_solve.h +++ b/include/cantera/equil/vcs_solve.h @@ -77,7 +77,6 @@ public: * * Input: * @param vprob Object containing the equilibrium Problem statement - * * @param ifunc Determines the operation to be done: Valid values: * 0 -> Solve a new problem by initializing structures * first. An initial estimate may or may not have @@ -90,14 +89,12 @@ public: * the VCS_PROB structure. * 2 -> Don't solve a problem. Destroy all the private * structures. - * * @param ipr Printing of results * ipr = 1 -> Print problem statement and final results to * standard output * 0 -> don't report on anything * @param ip1 Printing of intermediate results * IP1 = 1 -> Print intermediate results. - * * @param maxit Maximum number of iterations for the algorithm * * Output: @@ -122,7 +119,6 @@ public: * 0 -> don't report on anything * @param printDetails 1 -> Print intermediate results. * @param maxit Maximum number of iterations for the algorithm - * * @return * * 0 = Equilibrium Achieved * * 1 = Range space error encountered. The element abundance criteria @@ -169,10 +165,8 @@ public: * * @param[in] doJustComponents If true, the m_stoichCoeffRxnMatrix and * m_deltaMolNumPhase are not calculated. - * * @param[in] aw Vector of mole fractions which will be used to construct an * optimal basis from. - * * @param[in] sa Gram-Schmidt orthog work space (nc in length) sa[j] * @param[in] ss Gram-Schmidt orthog work space (nc in length) ss[j] * @param[in] sm QR matrix work space (nc*ne in length) sm[i+j*ne] @@ -222,7 +216,6 @@ public: * All evaluations are done using the "old" version of the solution. * * @param kspec Species to be evaluated - * * @return Returns the calculated species type */ int vcs_species_type(const size_t kspec) const; @@ -354,9 +347,8 @@ public: * for the input mole vector z[] in the parameter list. * Nondimensionalization is achieved by division by RT. * - * Note, for multispecies phases which are currently zeroed out, - * the chemical potential is filled out with the standard chemical - * potential. + * Note, for multispecies phases which are currently zeroed out, the + * chemical potential is filled out with the standard chemical potential. * * For species in multispecies phases whose concentration is zero, we need * to set the mole fraction to a very low value. Its chemical potential is @@ -462,7 +454,6 @@ public: * are increased. * * @param iphasePop id of the phase, which is currently zeroed, - * * @return Returns true if the phase can come into existence * and false otherwise. */ @@ -481,7 +472,6 @@ public: /*! * @param phasePopPhaseIDs Vector containing the phase ids of the phases * that will be popped this step. - * * @return returns the phase id of the phase that pops back into * existence. Returns -1 if there are no phases */ @@ -495,7 +485,6 @@ public: * for species irxn + M, where M is the number of components. * * @param iphasePop Phase id of the phase that will come into existence - * * @return Returns an int representing the status of the step * - 0 : normal return * - 1 : A single species phase species has been zeroed out @@ -523,7 +512,6 @@ public: * @param forceComponentCalc integer flagging whether a component * recalculation needs to be carried out. * @param kSpecial species number of phase being zeroed. - * * @return Returns an int representing which phase may need to be zeroed */ size_t vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial); @@ -640,7 +628,6 @@ public: * report on anything * @param printDetails 1 -> Print intermediate results. * @param maxit Maximum number of iterations for the algorithm - * * @return * - 0 = Equilibrium Achieved * - 1 = Range space error encountered. The element abundance criteria are @@ -676,7 +663,6 @@ public: * @param maxit Maximum number of iterations for the algorithm * @param T Value of the Temperature (Kelvin) * @param pres Value of the Pressure (units given by m_VCS_UnitsFormat variable - * * @return Returns an integer representing the success of the algorithm * * 0 = Equilibrium Achieved * * 1 = Range space error encountered. The element abundance criteria are @@ -788,7 +774,6 @@ public: * * @param vprob VCS_PROB pointer to the definition of the equilibrium * problem - * * @return If true, the problem is well-posed. If false, the problem * is not well posed. */ @@ -903,7 +888,6 @@ public: * * @param irxn Reaction number * @param dx_orig Original step length - * * @param ANOTE Output character string stating the conclusions of the * line search * @return Returns the optimized step length found by the search @@ -1052,7 +1036,6 @@ public: * lots of special cases and problems with zeroing out species. * * Still need to check out when we do loops over nc vs. ne. - * */ int vcs_elcorr(double aa[], double x[]); @@ -1176,7 +1159,6 @@ private: * loop. * * @param iph Phase to be deleted - * * @return Returns whether the operation was successful or not */ bool vcs_delete_multiphase(const size_t iph); @@ -1189,7 +1171,6 @@ private: * @param kspec The species index * @param delta_ptr pointer to the delta for the species. This may * change during the calculation - * * @return * 1: succeeded without change of dx * 0: Had to adjust dx, perhaps to zero, in order to do the delta. @@ -1223,7 +1204,6 @@ private: * Also, if the phase exists, then we check to see if the species * can have a mole number larger than VCS_DELETE_SPECIES_CUTOFF * (default value = 1.0E-32). - * */ int vcs_recheck_deleted(); @@ -1253,7 +1233,6 @@ private: * phases. It's an overkill for single species phases. * * @param iphase Phase index number - * * @return Returns true if the phase is currently deleted * but should be reinstated. Returns false otherwise. * @@ -1382,7 +1361,6 @@ private: * totalNumSpecies) Note this is only partially formed. Only * species in phases that participate in the reaction will be * updated - * * @return Returns the dimensionless deltaG of the reaction */ double deltaG_Recalc_Rxn(const int stateCalc, diff --git a/include/cantera/kinetics/BulkKinetics.h b/include/cantera/kinetics/BulkKinetics.h index df831eb69..28d7def1f 100644 --- a/include/cantera/kinetics/BulkKinetics.h +++ b/include/cantera/kinetics/BulkKinetics.h @@ -41,7 +41,6 @@ public: virtual void setMultiplier(size_t i, double f); - protected: virtual void addElementaryReaction(ElementaryReaction& r); virtual void modifyElementaryReaction(size_t i, ElementaryReaction& rNew); diff --git a/include/cantera/kinetics/Falloff.h b/include/cantera/kinetics/Falloff.h index 139bf7baf..566b505e2 100644 --- a/include/cantera/kinetics/Falloff.h +++ b/include/cantera/kinetics/Falloff.h @@ -58,7 +58,6 @@ public: * @param work array of size workSize() containing cached * temperature-dependent intermediate results from a prior call * to updateTemp. - * * @return Returns the value of the falloff function \f$ F \f$ defined above */ virtual doublereal F(doublereal pr, const doublereal* work) const { diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index f309255f9..daf20d353 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -1,6 +1,5 @@ /** * @file GasKinetics.h - * * @ingroup chemkinetics */ @@ -86,7 +85,7 @@ protected: //! Rate expressions for falloff reactions at the high-pressure limit Rate1 m_falloff_high_rates; - FalloffMgr m_falloffn; + FalloffMgr m_falloffn; ThirdBodyCalc m_3b_concm; ThirdBodyCalc m_falloff_concm; diff --git a/include/cantera/kinetics/ImplicitSurfChem.h b/include/cantera/kinetics/ImplicitSurfChem.h index d48fc65be..b9e06e3fb 100644 --- a/include/cantera/kinetics/ImplicitSurfChem.h +++ b/include/cantera/kinetics/ImplicitSurfChem.h @@ -104,7 +104,6 @@ public: * * @param ifuncOverride One of the values defined in @ref solvesp_methods. * The default is -1, which means that the program will decide. - * * @param timeScaleOverride When a pseudo transient is * selected this value can be used to override * the default time scale for integration which diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 15c25fb7b..871cdb109 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -1,6 +1,5 @@ /** * @file InterfaceKinetics.h - * * @ingroup chemkinetics */ // Copyright 2001 California Institute of Technology diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index b886de188..8f7279b8b 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -124,7 +124,6 @@ namespace Cantera */ class Kinetics { - public: /** * @name Constructors and General Information about Mechanism diff --git a/include/cantera/kinetics/KineticsFactory.h b/include/cantera/kinetics/KineticsFactory.h index 516b6263d..1ea6c13bb 100644 --- a/include/cantera/kinetics/KineticsFactory.h +++ b/include/cantera/kinetics/KineticsFactory.h @@ -60,7 +60,6 @@ public: * @param th Vector of phases. The first phase is the phase in which * the reactions occur, and the subsequent phases (if any) * are e.g. bulk phases adjacent to a reacting surface. - * * @return Pointer to the new kinetics manager. */ virtual Kinetics* newKinetics(XML_Node& phase, std::vector th); diff --git a/include/cantera/kinetics/RateCoeffMgr.h b/include/cantera/kinetics/RateCoeffMgr.h index e9b2ee770..7d6721968 100644 --- a/include/cantera/kinetics/RateCoeffMgr.h +++ b/include/cantera/kinetics/RateCoeffMgr.h @@ -19,9 +19,7 @@ namespace Cantera template class Rate1 { - public: - Rate1() {} virtual ~Rate1() {} diff --git a/include/cantera/kinetics/ReactionPath.h b/include/cantera/kinetics/ReactionPath.h index 7675614fa..2dc120172 100644 --- a/include/cantera/kinetics/ReactionPath.h +++ b/include/cantera/kinetics/ReactionPath.h @@ -1,6 +1,5 @@ /** * @file ReactionPath.h - * * Classes for reaction path analysis. */ @@ -95,9 +94,8 @@ public: virtual ~Path() {} /** - * Add a reaction to the path. Increment the flow from this - * reaction, the total flow, and the flow associated with this - * label. + * Add a reaction to the path. Increment the flow from this reaction, the + * total flow, and the flow associated with this label. */ void addReaction(size_t rxnNumber, doublereal value, const std::string& label = ""); diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 86f5e6a8d..57e7b9d35 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -1,10 +1,8 @@ /** * @file RxnRates.h - * */ // Copyright 2001 California Institute of Technology - #ifndef CT_RXNRATES_H #define CT_RXNRATES_H @@ -26,7 +24,6 @@ class Array2D; * \f[ * k_f = A T^b \exp (-E/RT) * \f] - * */ class Arrhenius { @@ -148,9 +145,8 @@ public: /** * Update the value the rate constant. * - * This function returns the actual value of the rate constant. - * It can be safely called for negative values of the pre-exponential - * factor. + * This function returns the actual value of the rate constant. It can be + * safely called for negative values of the pre-exponential factor. */ doublereal updateRC(doublereal logT, doublereal recipT) const { return m_A * std::exp(std::log(10.0)*m_acov + m_b*logT - diff --git a/include/cantera/kinetics/StoichManager.h b/include/cantera/kinetics/StoichManager.h index fa1ae3509..f6f9c57c4 100644 --- a/include/cantera/kinetics/StoichManager.h +++ b/include/cantera/kinetics/StoichManager.h @@ -123,7 +123,6 @@ namespace Cantera * real stoichiometric coefficients are used. Shouldn't be that * hard to do, and they occur in engineering simulations with some * regularity. - * */ static doublereal ppow(doublereal x, doublereal order) @@ -395,7 +394,6 @@ public: } private: - //! Length of the m_ic vector /*! * This is the number of species which participate in the reaction order diff --git a/include/cantera/kinetics/importKinetics.h b/include/cantera/kinetics/importKinetics.h index a562c8927..ae2155896 100644 --- a/include/cantera/kinetics/importKinetics.h +++ b/include/cantera/kinetics/importKinetics.h @@ -86,14 +86,12 @@ bool importKinetics(const XML_Node& phase, std::vector th, * * @param root pointer to the XML tree which will be searched to find the * XML phase element. - * * @param id Name of the phase to be searched for. * @param nm Name of the XML element. Should be "phase" * @param th Pointer to a bare ThermoPhase object, which will be initialized * by this operation. * @param kin Pointer to a bare Kinetics object, which will be initialized * by this operation to a homogeneous kinetics manager - * * @return * Returns true if all went well. If there are errors, it will return false. * diff --git a/include/cantera/kinetics/reaction_defs.h b/include/cantera/kinetics/reaction_defs.h index e54ffdffa..42270d198 100644 --- a/include/cantera/kinetics/reaction_defs.h +++ b/include/cantera/kinetics/reaction_defs.h @@ -91,9 +91,6 @@ const int BUTLERVOLMER_RXN = 26; //! form dependence on delta G of reaction. const int SURFACEAFFINITY_RXN = 27; - - - /** * A reaction occurring at a one-dimensional interface between two surface phases. * NOTE: This is a bit ambiguous, and will be taken out in the future diff --git a/include/cantera/kinetics/solveSP.h b/include/cantera/kinetics/solveSP.h index 200b4d4ba..8bd35bb12 100644 --- a/include/cantera/kinetics/solveSP.h +++ b/include/cantera/kinetics/solveSP.h @@ -146,7 +146,6 @@ public: /*! * @param surfChemPtr Pointer to the ImplicitSurfChem object that * defines the surface problem to be solved. - * * @param bulkFunc Integer representing how the bulk phases should be * handled. See @ref solvesp_bulkFunc. Currently, * only the default value of BULK_ETCH is supported. @@ -176,17 +175,12 @@ public: * * @param ifunc Determines the type of solution algorithm to be used. See * @ref solvesp_methods for possible values. - * * @param time_scale Time over which to integrate the surface equations, * where applicable - * * @param TKelvin Temperature (kelvin) - * * @param PGas Pressure (pascals) - * * @param reltol Relative tolerance to use * @param abstol absolute tolerance. - * * @return Returns 1 if the surface problem is successfully solved. * Returns -1 if the surface problem wasn't solved successfully. * Note the actual converged solution is returned as part of the diff --git a/include/cantera/numerics/BandMatrix.h b/include/cantera/numerics/BandMatrix.h index 2aabb43d7..03dfe7f7f 100644 --- a/include/cantera/numerics/BandMatrix.h +++ b/include/cantera/numerics/BandMatrix.h @@ -32,9 +32,7 @@ namespace Cantera */ class BandMatrix : public GeneralMatrix { - public: - //! Base Constructor /*! * * Create an \c 0 by \c 0 matrix, and initialize all elements to \c 0. @@ -91,7 +89,6 @@ public: * * @param i row * @param j column - * * @return Returns a reference to the value of the matrix entry */ doublereal& value(size_t i, size_t j); @@ -101,7 +98,6 @@ public: * This method does not alter the array. * @param i row * @param j column - * * @return Returns the value of the matrix entry */ doublereal value(size_t i, size_t j) const; @@ -110,7 +106,6 @@ public: /*! * @param i row * @param j column - * * @return Returns the index of the matrix entry */ size_t index(size_t i, size_t j) const; @@ -122,7 +117,6 @@ public: * * @param i row * @param j column - * * @return Returns the value of the matrix entry */ doublereal _value(size_t i, size_t j) const; @@ -134,7 +128,6 @@ public: * @param iStruct OUTPUT Pointer to a vector of ints that describe the structure of the matrix. * istruct[0] = kl * istruct[1] = ku - * * @return returns the number of rows and columns in the matrix. */ virtual size_t nRowsAndStruct(size_t* const iStruct = 0) const; @@ -172,7 +165,6 @@ public: /*! * @param b INPUT RHS of the problem * @param x OUTPUT solution to the problem - * * @return Return a success flag * 0 indicates a success * ~0 Some error occurred, see the LAPACK documentation @@ -185,7 +177,6 @@ public: * OUTPUT solution to the problem * @param nrhs Number of right hand sides to solve * @param ldb Leading dimension of `b`. Default is nColumns() - * * @return Return a success flag * 0 indicates a success * ~0 Some error occurred, see the LAPACK documentation @@ -223,7 +214,6 @@ public: * The matrix must have been previously factored using the LU algorithm * * @param a1norm Norm of the matrix - * * @return returns the inverse of the condition number */ virtual doublereal rcond(doublereal a1norm); @@ -255,7 +245,6 @@ public: * double a_i_j = colP_j[kl + ku + i - j]; * * @param j Value of the column - * * @return Returns a pointer to the top of the column */ virtual doublereal* ptrColumn(size_t j); @@ -276,7 +265,6 @@ public: * The smallest row is returned along with the largest coefficient in that row * * @param valueSmall OUTPUT value of the largest coefficient in the smallest row - * * @return index of the row that is most nearly zero */ virtual size_t checkRows(doublereal& valueSmall) const; @@ -287,13 +275,11 @@ public: * The smallest column is returned along with the largest coefficient in that column * * @param valueSmall OUTPUT value of the largest coefficient in the smallest column - * * @return index of the column that is most nearly zero */ virtual size_t checkColumns(doublereal& valueSmall) const; protected: - //! Matrix data vector_fp data; diff --git a/include/cantera/numerics/CVodesIntegrator.h b/include/cantera/numerics/CVodesIntegrator.h index b5dac0d89..481738d0b 100644 --- a/include/cantera/numerics/CVodesIntegrator.h +++ b/include/cantera/numerics/CVodesIntegrator.h @@ -116,7 +116,6 @@ private: //! Indicates whether the sensitivities stored in m_yS have been updated //! for at the current integrator time. bool m_sens_ok; - }; } // namespace diff --git a/include/cantera/numerics/DAE_Solver.h b/include/cantera/numerics/DAE_Solver.h index 735c04cd1..0faffc7ee 100644 --- a/include/cantera/numerics/DAE_Solver.h +++ b/include/cantera/numerics/DAE_Solver.h @@ -60,14 +60,12 @@ const int cDirect = 0; const int cKrylov = 1; - /** * Wrapper for DAE solvers */ class DAE_Solver { public: - DAE_Solver(ResidJacEval& f) : m_resid(f), m_neq(f.nEquations()), @@ -237,16 +235,13 @@ public: } protected: - doublereal m_dummy; - ResidJacEval& m_resid; //! Number of total equations in the system integer m_neq; doublereal m_time; - private: void warn(const std::string& msg) const { writelog(">>>> Warning: method "+msg+" of base class " diff --git a/include/cantera/numerics/DenseMatrix.h b/include/cantera/numerics/DenseMatrix.h index 3ab35e8fc..c9c26dd20 100644 --- a/include/cantera/numerics/DenseMatrix.h +++ b/include/cantera/numerics/DenseMatrix.h @@ -7,7 +7,6 @@ // Copyright 2001 California Institute of Technology - #ifndef CT_DENSEMATRIX_H #define CT_DENSEMATRIX_H @@ -26,7 +25,6 @@ namespace Cantera * */ - //! Exception thrown when an LAPACK error is encountered associated with inverting or solving a matrix /*! * A named error condition is used so that the calling code may differentiate this type of error @@ -35,7 +33,6 @@ namespace Cantera class CELapackError : public CanteraError { public: - //! Constructor passes through to main Cantera error handler /*! * @param routine Name of calling routine @@ -44,7 +41,6 @@ public: CELapackError(const std::string& routine, const std::string& msg) : CanteraError(routine + " LAPACK ERROR", msg) { } - }; //! A class for full (non-sparse) matrices with Fortran-compatible diff --git a/include/cantera/numerics/Func1.h b/include/cantera/numerics/Func1.h index ecd87fc56..21a31048a 100644 --- a/include/cantera/numerics/Func1.h +++ b/include/cantera/numerics/Func1.h @@ -35,8 +35,7 @@ const int ConstFuncType = 110; class TimesConstant1; /** - * Base class for 'functor' classes that evaluate a function of - * one variable. + * Base class for 'functor' classes that evaluate a function of one variable. */ class Func1 { @@ -85,7 +84,6 @@ public: virtual std::string write(const std::string& arg) const; - //! accessor function for the stored constant doublereal c() const; @@ -101,15 +99,12 @@ public: //! Return the order of the function, if it makes sense virtual int order() const; - Func1& func1_dup() const; - Func1& func2_dup() const; Func1* parent() const; - void setParent(Func1* p); protected: @@ -135,7 +130,6 @@ Func1& newPlusConstFunction(Func1& f1, doublereal c); class Sin1 : public Func1 { public: - Sin1(doublereal omega = 1.0) : Func1() { m_c = omega; @@ -312,7 +306,6 @@ public: }; - /** * Sum of two functions. */ @@ -434,7 +427,6 @@ public: } virtual std::string write(const std::string& arg) const; - }; @@ -766,10 +758,8 @@ public: } }; -// // The functors below are the old-style ones. They still work, // but can't do derivatives. -// /** * A Gaussian. @@ -852,7 +842,6 @@ public: return *this; } - virtual Func1& duplicate() const { Poly1* np = new Poly1(*this); return *((Func1*)np); @@ -1045,5 +1034,4 @@ protected: } - #endif diff --git a/include/cantera/numerics/GeneralMatrix.h b/include/cantera/numerics/GeneralMatrix.h index 33b5cb886..4871c67cb 100644 --- a/include/cantera/numerics/GeneralMatrix.h +++ b/include/cantera/numerics/GeneralMatrix.h @@ -97,7 +97,6 @@ public: * The matrix must have been previously factored using the LU algorithm * * @param a1norm Norm of the matrix - * * @return returns the inverse of the condition number */ virtual doublereal rcond(doublereal a1norm) = 0; @@ -124,7 +123,6 @@ public: //! Return the size and structure of the matrix /*! * @param iStruct OUTPUT Pointer to a vector of ints that describe the structure of the matrix. - * * @return returns the number of rows and columns in the matrix. */ virtual size_t nRowsAndStruct(size_t* const iStruct = 0) const = 0; @@ -151,7 +149,6 @@ public: //! Return a pointer to the top of column j, columns are assumed to be contiguous in memory /*! * @param j Value of the column - * * @return Returns a pointer to the top of the column */ virtual doublereal* ptrColumn(size_t j) = 0; @@ -202,7 +199,6 @@ public: * The smallest row is returned along with the largest coefficient in that row * * @param valueSmall OUTPUT value of the largest coefficient in the smallest row - * * @return index of the row that is most nearly zero */ virtual size_t checkRows(doublereal& valueSmall) const = 0; @@ -213,7 +209,6 @@ public: * The smallest column is returned along with the largest coefficient in that column * * @param valueSmall OUTPUT value of the largest coefficient in the smallest column - * * @return index of the column that is most nearly zero */ virtual size_t checkColumns(doublereal& valueSmall) const = 0; diff --git a/include/cantera/numerics/IDA_Solver.h b/include/cantera/numerics/IDA_Solver.h index 1df09e001..e57efd27a 100644 --- a/include/cantera/numerics/IDA_Solver.h +++ b/include/cantera/numerics/IDA_Solver.h @@ -40,7 +40,6 @@ class ResidData; // forward reference class IDA_Solver : public DAE_Solver { public: - //! Constructor. /*! * Default settings: dense Jacobian, no user-supplied Jacobian function, Newton iteration. @@ -97,9 +96,7 @@ public: //! Set the form of the Jacobian /*! - * * @param formJac Form of the Jacobian - * * 0 numerical Jacobian * 1 analytical Jacobian given by the evalJacobianDP() function */ @@ -136,7 +133,6 @@ public: //! Step the system to a final value of the time /*! * @param tout Final value of the time - * * @return Returns the IDASolve() return flag * * The return values for IDASolve are described below. diff --git a/include/cantera/numerics/Integrator.h b/include/cantera/numerics/Integrator.h index 99d066bc0..04b877882 100644 --- a/include/cantera/numerics/Integrator.h +++ b/include/cantera/numerics/Integrator.h @@ -202,13 +202,11 @@ public: } private: - doublereal m_dummy; void warn(const std::string& msg) const { writelog(">>>> Warning: method "+msg+" of base class " +"Integrator called. Nothing done.\n"); } - }; // defined in ODE_integrators.cpp diff --git a/include/cantera/numerics/ResidEval.h b/include/cantera/numerics/ResidEval.h index fa839ec13..8bc1c93b3 100644 --- a/include/cantera/numerics/ResidEval.h +++ b/include/cantera/numerics/ResidEval.h @@ -126,7 +126,6 @@ public: //! Return the number of equations in the equation system virtual int nEquations() const = 0; - //! Write out to a file or to standard output the current solution /*! * ievent is a description of the event that caused this @@ -162,7 +161,6 @@ public: } protected: - //! Mapping vector that stores whether a degree of freedom is a DAE or not /*! * The first index is the equation number. The second index is 1 if it is a DAE, diff --git a/include/cantera/numerics/ResidJacEval.h b/include/cantera/numerics/ResidJacEval.h index 19b01f7a5..cead2a4da 100644 --- a/include/cantera/numerics/ResidJacEval.h +++ b/include/cantera/numerics/ResidJacEval.h @@ -116,7 +116,6 @@ public: * @param t Time (input) * @param ybase Solution vector (input, output) * @param step Proposed step in the solution that will be cropped - * * @return Return the norm of the amount of filtering */ virtual doublereal filterNewStep(const doublereal t, const doublereal* const ybase, @@ -129,7 +128,6 @@ public: * * @param t Time (input) * @param y Solution vector (input, output) - * * @return Return the norm of the amount of filtering */ virtual doublereal filterSolnPrediction(const doublereal t, doublereal* const y); @@ -150,7 +148,6 @@ public: * @param delta_t The current value of the time step (input) * @param y Solution vector (input, do not modify) * @param ydot Rate of change of solution vector. (input, do not modify) - * * @return Returns a flag to indicate that operation is successful. * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation @@ -165,7 +162,6 @@ public: * * @return If true, the the time stepping is stopped. If false, then time stepping is stopped if t >= tout * Defaults to false. - * * @param t Time (input) * @param delta_t The current value of the time step (input) * @param y Solution vector (input, do not modify) @@ -188,7 +184,6 @@ public: * @param ydot Rate of change of solution vector. (input, do not modify) * @param delta_y Value of the delta to be used in calculating the numerical Jacobian * @param solnWeights Value of the solution weights that are used in determining convergence (default = 0) - * * @return Returns a flag to indicate that operation is successful. * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation @@ -219,7 +214,6 @@ public: * 1 Called at the end of every successful time step * -1 Called at the end of every unsuccessful time step * 2 Called at the end of every call to integrateRJE() - * * @param t Time (input) * @param delta_t The current value of the time step (input) * @param y Solution vector (input, do not modify) @@ -258,7 +252,6 @@ public: * @param matrix Pointer to the current Jacobian (if zero, it's already been factored) * @param nrows offsets for the matrix * @param rhs residual vector. This also needs to be LHS multiplied by M - * * @return Returns a flag to indicate that operation is successful. * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation @@ -277,7 +270,6 @@ public: * @param ydot Rate of change of solution vector. (input, do not modify) * @param J Reference to the SquareMatrix object to be calculated (output) * @param resid Value of the residual that is computed (output) - * * @return Returns a flag to indicate that operation is successful. * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation @@ -298,7 +290,6 @@ public: * @param jacobianColPts Pointer to the vector of pts to columns of the SquareMatrix * object to be calculated (output) * @param resid Value of the residual that is computed (output) - * * @return Returns a flag to indicate that operation is successful. * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation diff --git a/include/cantera/numerics/RootFind.h b/include/cantera/numerics/RootFind.h index d0bd6a2a7..e764fb8ff 100644 --- a/include/cantera/numerics/RootFind.h +++ b/include/cantera/numerics/RootFind.h @@ -126,7 +126,6 @@ namespace Cantera * * @todo Noise * @todo General Search to be done when all else fails - * */ class RootFind { @@ -186,7 +185,6 @@ private: * @param x1 First number * @param x2 second number * @param factor Multiplicative factor to multiple deltaX with - * * @return Returns a boolean indicating whether the two numbers are the same or not. */ bool theSame(doublereal x2, doublereal x1, doublereal factor = 1.0) const; @@ -209,7 +207,6 @@ public: * @param xbest Returns the x that satisfies the function * On input, xbest should contain the best estimate of the solution. * An attempt to find the solution near xbest is made. - * * @return: * 0 = ROOTFIND_SUCCESS Found function * -1 = ROOTFIND_FAILEDCONVERGENCE Failed to find the answer @@ -247,7 +244,6 @@ public: //! Set the print level from the rootfinder /*! - * * 0 -> absolutely nothing is printed for a single time step. * 1 -> One line summary per solve_nonlinear call * 2 -> short description, points of interest: Table of nonlinear solve - one line per iteration diff --git a/include/cantera/numerics/ctlapack.h b/include/cantera/numerics/ctlapack.h index b5934e41a..62429a6ff 100644 --- a/include/cantera/numerics/ctlapack.h +++ b/include/cantera/numerics/ctlapack.h @@ -79,7 +79,6 @@ extern "C" { const integer* incX, const doublereal* beta, doublereal* y, const integer* incY, ftnlen trsize); #else - int _DGEMV_(const char* transpose, ftnlen trsize, const integer* m, const integer* n, const doublereal* alpha, const doublereal* a, const integer* lda, const doublereal* x, @@ -92,18 +91,14 @@ extern "C" { integer* info); #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DGETRS_(const char* transpose, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, integer* ipiv, doublereal* b, const integer* ldb, integer* info, ftnlen trsize); - #else - int _DGETRS_(const char* transpose, ftnlen trsize, const integer* n, const integer* nrhs, const doublereal* a, const integer* lda, integer* ipiv, doublereal* b, const integer* ldb, integer* info); - #endif int _DGETRI_(const integer* n, doublereal* a, const integer* lda, @@ -189,7 +184,6 @@ extern "C" { doublereal* b, const integer* ldb, integer* info); #endif - #ifdef LAPACK_FTN_STRING_LEN_AT_END int _DGECON_(const char* norm, const integer* n, doublereal* a, const integer* lda, const doublereal* rnorm, const doublereal* rcond, @@ -200,7 +194,6 @@ extern "C" { doublereal* work, const integer* iwork, integer* info); #endif - #ifdef LAPACK_FTN_STRING_LEN_AT_END int _DGBCON_(const char* norm, const integer* n, integer* kl, integer* ku, doublereal* ab, const integer* ldab, const integer* ipiv, const doublereal* anorm, const doublereal* rcond, @@ -433,7 +426,6 @@ inline void ct_dtrtrs(ctlapack::upperlower_t uplot, ctlapack::transpose_t trans, info = f_info; } -//! /*! * @param work Must be dimensioned equal to greater than 3N * @param iwork Must be dimensioned equal to or greater than N diff --git a/include/cantera/numerics/funcs.h b/include/cantera/numerics/funcs.h index 36d6b5872..9b4d69ede 100644 --- a/include/cantera/numerics/funcs.h +++ b/include/cantera/numerics/funcs.h @@ -25,7 +25,6 @@ namespace Cantera * @param x value of the x coordinate * @param xpts value of the grid points * @param fpts value of the interpolant at the grid points - * * @return Returned value is the value of of the interpolated * function at x. */ diff --git a/include/cantera/numerics/polyfit.h b/include/cantera/numerics/polyfit.h index ab94b3a2b..29885d44c 100644 --- a/include/cantera/numerics/polyfit.h +++ b/include/cantera/numerics/polyfit.h @@ -28,29 +28,23 @@ namespace Cantera * point C. * * @param n The number of data points. - * * @param x A set of grid points on which the data is specified. * The array of values of the independent variable. These * values may appear in any order and need not all be * distinct. There are n of them. - * * @param y array of corresponding function values. There are n of them - * * @param w array of positive values to be used as weights. If * W[0] is negative, DPOLFT will set all the weights * to 1.0, which means unweighted least squares error * will be minimized. To minimize relative error, the * user should set the weights to: W(I) = 1.0/Y(I)**2, * I = 1,...,N . - * * @param maxdeg maximum degree to be allowed for polynomial fit. * MAXDEG may be any non-negative integer less than N. * Note -- MAXDEG cannot be equal to N-1 when a * statistical test is to be used for degree selection, * i.e., when input value of EPS is negative. - * * @param ndeg output degree of the fit computed. - * * @param eps Specifies the criterion to be used in determining * the degree of fit to be computed. * (1) If EPS is input negative, DPOLFT chooses the @@ -70,12 +64,10 @@ namespace Cantera * fitted polynomial. DPOLFT will increase the * degree of fit until this criterion is met or * until the maximum degree is reached. - * * @param r Output vector containing the first ndeg+1 Taylor coefficients * * P(X) = r[0] + r[1]*(X-C) + ... + r[ndeg] * (X-C)**ndeg * ( here C = 0.0) - * * @return Returned value is the value of the rms of the interpolated * function at x. */ @@ -84,5 +76,3 @@ doublereal polyfit(int n, doublereal* x, doublereal* y, doublereal* w, } #endif - - diff --git a/include/cantera/oneD/Domain1D.h b/include/cantera/oneD/Domain1D.h index 7a6761a5a..161a0a677 100644 --- a/include/cantera/oneD/Domain1D.h +++ b/include/cantera/oneD/Domain1D.h @@ -400,7 +400,6 @@ public: * the start of its variables in the global solution vector. */ void locate() { - if (m_left) { // there is a domain on the left, so the first grid point // in this domain is one more than the last one on the left diff --git a/include/cantera/oneD/Inlet1D.h b/include/cantera/oneD/Inlet1D.h index 6c6648169..0868d1911 100644 --- a/include/cantera/oneD/Inlet1D.h +++ b/include/cantera/oneD/Inlet1D.h @@ -211,7 +211,6 @@ public: class Symm1D : public Bdry1D { public: - Symm1D() : Bdry1D() { m_type = cSymmType; } diff --git a/include/cantera/oneD/Sim1D.h b/include/cantera/oneD/Sim1D.h index 88895bcc9..f954e3e20 100644 --- a/include/cantera/oneD/Sim1D.h +++ b/include/cantera/oneD/Sim1D.h @@ -18,7 +18,6 @@ namespace Cantera class Sim1D : public OneDim { public: - //! Default constructor. /*! * This constructor is provided to make the class default-constructible, @@ -39,8 +38,7 @@ public: /** * @name Setting initial values * - * These methods are used to set the initial values of - * solution components. + * These methods are used to set the initial values of solution components. */ //@{ diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index e4be1a418..37b479202 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -157,14 +157,14 @@ public: void solveEnergyEqn(size_t j=npos) { bool changed = false; - if (j == npos) + if (j == npos) { for (size_t i = 0; i < m_points; i++) { if (!m_do_energy[i]) { changed = true; } m_do_energy[i] = true; } - else { + } else { if (!m_do_energy[j]) { changed = true; } @@ -215,14 +215,14 @@ public: void fixTemperature(size_t j=npos) { bool changed = false; - if (j == npos) + if (j == npos) { for (size_t i = 0; i < m_points; i++) { if (m_do_energy[i]) { changed = true; } m_do_energy[i] = false; } - else { + } else { if (m_do_energy[j]) { changed = true; } @@ -333,7 +333,6 @@ protected: return (c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1)); } - //! @name Solution components //! @{ diff --git a/include/cantera/thermo/AdsorbateThermo.h b/include/cantera/thermo/AdsorbateThermo.h index 467e086f3..ad11e301a 100644 --- a/include/cantera/thermo/AdsorbateThermo.h +++ b/include/cantera/thermo/AdsorbateThermo.h @@ -29,7 +29,6 @@ namespace Cantera class Adsorbate : public SpeciesThermoInterpType { public: - //! Empty constructor Adsorbate() : m_nFreqs(0) { @@ -116,7 +115,6 @@ protected: doublereal _entropy_R(double T) const { return _energy_RT(T) - _free_energy_RT(T); } - }; } diff --git a/include/cantera/thermo/ConstCpPoly.h b/include/cantera/thermo/ConstCpPoly.h index a94a80ceb..dd17a9756 100644 --- a/include/cantera/thermo/ConstCpPoly.h +++ b/include/cantera/thermo/ConstCpPoly.h @@ -6,7 +6,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef CT_CONSTCPPOLY_H #define CT_CONSTCPPOLY_H diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 65120f158..9c70412e6 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -63,7 +63,6 @@ class PDSS_Water; * the \f$ \triangle \f$ symbol. The reference state symbol is now * \f$ \triangle, ref \f$. * - * * It is assumed that the reference state thermodynamics may be * obtained by a pointer to a populated species thermodynamic property * manager class (see ThermoPhase::m_spthermo). How to relate pressure @@ -133,7 +132,6 @@ class PDSS_Water; * * Individual activity coefficients of ions can not be independently measured. Instead, * only binary pairs forming electroneutral solutions can be measured. - * *

Ionic Strength

* @@ -243,7 +241,6 @@ class PDSS_Water; * assumed for the Debye-Huckel term. The model is set by the * internal parameter #m_formDH. We will now describe each category in its own section. * - * *

Debye-Huckel Dilute Limit

* * DHFORM_DILUTE_LIMIT = 0 @@ -264,7 +261,6 @@ class PDSS_Water; * \ln(a_o) = \frac{X_o - 1.0}{X_o} + \frac{ 2 A_{Debye} \tilde{M}_o}{3} (I)^{3/2} * \f] * - * *

Bdot Formulation

* * DHFORM_BDOT_AK = 1 @@ -297,7 +293,6 @@ class PDSS_Water; * Additionally, Helgeson's formulation for the water activity is offered as an * alternative. * - * *

Bdot Formulation with Uniform Size Parameter in the Denominator

* * DHFORM_BDOT_AUNIFORM = 2 @@ -317,7 +312,6 @@ class PDSS_Water; * - \frac{\log(10)}{2} \tilde{M}_o I \sum_k{ B^{dot}_k m_k} * \f] * - * *

Beta_IJ formulation

* * DHFORM_BETAIJ = 3 @@ -593,8 +587,6 @@ class PDSS_Water; O H Na Cl @endverbatim - * - * */ class DebyeHuckel : public MolalityVPSSTP { @@ -1075,7 +1067,6 @@ public: * * @param temperature Temperature in kelvin. Defaults to -1, in which * case the temperature of the phase is assumed. - * * @param pressure Pressure (Pa). Defaults to -1, in which * case the pressure of the phase is assumed. */ @@ -1092,7 +1083,6 @@ public: * * @param temperature Temperature in kelvin. Defaults to -1, in which * case the temperature of the phase is assumed. - * * @param pressure Pressure (Pa). Defaults to -1, in which * case the pressure of the phase is assumed. */ @@ -1109,7 +1099,6 @@ public: * * @param temperature Temperature in kelvin. Defaults to -1, in which * case the temperature of the phase is assumed. - * * @param pressure Pressure (Pa). Defaults to -1, in which * case the pressure of the phase is assumed. */ @@ -1126,7 +1115,6 @@ public: * * @param temperature Temperature in kelvin. Defaults to -1, in which * case the temperature of the phase is assumed. - * * @param pressure Pressure (Pa). Defaults to -1, in which * case the pressure of the phase is assumed. */ @@ -1249,7 +1237,6 @@ protected: double m_maxIionicStrength; public: - /** * If true, then the fixed for of Helgeson's activity * for water is used instead of the rigorous form @@ -1259,7 +1246,6 @@ public: */ bool m_useHelgesonFixedForm; protected: - //! Stoichiometric ionic strength on the molality scale mutable double m_IionicMolalityStoich; diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index c763af22b..6a00afcd6 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -104,7 +104,6 @@ class WaterProps; * the \f$ \triangle \f$ symbol. The reference state symbol is now * \f$ \triangle, ref \f$. * - * * It is assumed that the reference state thermodynamics may be * obtained by a pointer to a populated species thermodynamic property * manager class (see ThermoPhase::m_spthermo). How to relate pressure @@ -141,7 +140,6 @@ class WaterProps; * u^\triangle_k(T,P) = h^{\triangle,ref}_k(T) - P_{ref} \tilde{v}_k * \f] * - * * The solute standard state heat capacity and entropy are independent * of pressure. The solute standard state Gibbs free energy is obtained * from the enthalpy and entropy functions. @@ -186,7 +184,6 @@ class WaterProps; * and pressure. After this convention is applied, all other standard state * properties of ionic species contain meaningful information. * - * *

Ionic Strength

* * Most of the parameterizations within the model use the ionic strength @@ -196,7 +193,6 @@ class WaterProps; * I = \frac{1}{2} \sum_k{m_k z_k^2} * \f] * - * * \f$ m_k \f$ is the molality of the kth species. \f$ z_k \f$ is the charge * of the kth species. Note, the ionic strength is a defined units quantity. * The molality has defined units of gmol kg-1, and therefore the ionic @@ -249,7 +245,6 @@ class WaterProps; * * @endcode * - * * Because we need the concept of a weakly associated acid in order to calculated * \f$ I_s \f$ we need to * catalog all species in the phase. This is done using the following categories: @@ -289,12 +284,10 @@ class WaterProps; * * @endcode * - * * Much of the species electrolyte type information is inferred from other information in the * input file. For example, as species which is charged is given the "chargedSpecies" default * category. A neutral solute species is put into the "nonpolarNeutral" category by default. * - * *

Specification of the Excess Gibbs Free Energy

* * Pitzer's formulation may best be represented as a specification of the excess Gibbs @@ -423,7 +416,6 @@ class WaterProps; * ternary contributions, which can be independently measured in * binary or ternary subsystems. * - * *

Multicomponent Activity Coefficients for Solutes

* * The formulas for activity coefficients of solutes may be obtained by taking the @@ -499,7 +491,6 @@ class WaterProps; * \ln(\gamma_N^\triangle) = 2 \left( \sum_i m_i \lambda_{iN}\right) * \f] * - * *

Activity of the Water Solvent

* * The activity for the solvent water,\f$ a_o \f$, is not independent and must be @@ -520,7 +511,6 @@ class WaterProps; * = - \frac{n_o}{\sum_{i \neq o}n_i} \ln(a_o) * \f] * - * * The result is the following * * \f[ @@ -562,7 +552,6 @@ class WaterProps; * \Phi^{\phi}_{a{a'}} = \Phi_{a{a'}} + I \frac{d\Phi_{a{a'}}}{dI} * \f] * - * *

Temperature and Pressure Dependence of the Pitzer Parameters

* * In general most of the coefficients introduced in the previous section may @@ -682,7 +671,6 @@ class WaterProps; * \f$ \beta^{(2)}_{MX} \f$, \f$ \Theta_{cc'} \f$, \f$\Theta_{aa'} \f$, * \f$ \Psi_{c{c'}a} \f$ and \f$ \Psi_{ca{a'}} \f$. * - * *

Like-Charged Binary Ion Parameters and the Mixing Parameters

* * The previous section contained the functions, \f$ \Phi_{c{c'}} \f$, @@ -748,7 +736,6 @@ class WaterProps; @endcode * - * *

Ternary Pitzer Parameters

* * The \f$ \Psi_{c{c'}a} \f$ and \f$ \Psi_{ca{a'}} \f$ terms @@ -870,7 +857,6 @@ class WaterProps; @endverbatim * - * *

Specification of the Debye-Huckel Constant

* * In the equations above, the formula for \f$ A_{Debye} \f$ @@ -933,7 +919,6 @@ class WaterProps; * * @endcode * - * *

Temperature and Pressure Dependence of the Activity Coefficients

* * Temperature dependence of the activity coefficients leads to nonzero terms @@ -1010,7 +995,6 @@ class WaterProps; * and pressure multiplied by Mnaught (kg solvent / gmol solvent). The solvent * standard concentration is just equal to its standard state concentration. * - * * This means that the * kinetics operator essentially works on an generalized concentration basis (kmol / m3), * with units for the kinetic rate constant specified @@ -1100,7 +1084,6 @@ class WaterProps; * ThermoPhase *HMW = newPhase("HMW_NaCl.xml", "NaCl_electrolyte"); * @endcode * - * * A new HMWSoln object may be created by the following code snippets: * * @code @@ -1122,7 +1105,6 @@ class WaterProps; * importPhase(*xm, &dhphase); * @endcode * - * *
*

XML Example

*
@@ -1216,17 +1198,11 @@ class WaterProps; @endverbatim - * - * - * * @ingroup thermoprops - * */ class HMWSoln : public MolalityVPSSTP { - public: - //! Default Constructor HMWSoln(); @@ -1293,7 +1269,6 @@ public: * routine, which does most of the work. * * @param inputfile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -1317,7 +1292,6 @@ public: * point to an XML phase object, it must have * sibling nodes "speciesData" that describe * the species in the phase. - * * @param id ID of the phase. If nonnull, a check is done * to see if phaseNode is pointing to the phase * with the correct id. @@ -1701,7 +1675,6 @@ public: */ virtual void getPartialMolarEnthalpies(doublereal* hbar) const; - //! Returns an array of partial molar entropies of the species in the //! solution. Units: J/kmol/K. /*! @@ -1860,7 +1833,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1877,7 +1849,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1895,7 +1866,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1914,7 +1884,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1934,7 +1903,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1953,7 +1921,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -1970,7 +1937,6 @@ public: * * @param temperature Temperature of the derivative calculation * or -1 to indicate the current temperature - * * @param pressure Pressure of the derivative calculation * or -1 to indicate the current pressure */ @@ -2010,7 +1976,6 @@ public: void getUnscaledMolalityActivityCoefficients(doublereal* acMolality) const; private: - //! Apply the current phScale to a set of activity Coefficients /*! * See the Eq3/6 Manual for a thorough discussion. @@ -2067,7 +2032,6 @@ private: //@} private: - /** * This is the form of the Pitzer parameterization * used in this model. diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index fac66f11d..d8dae66b8 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -118,7 +118,6 @@ namespace Cantera * * In terms of the reference state, the above can be rewritten * - * * \f[ * \mu_k(T,P) = \mu^{ref}_k(T, P) + R T \log(\frac{P X_k}{P_{ref}}) * \f] @@ -147,7 +146,6 @@ namespace Cantera * \tilde{Cp}_k(T,P) = Cp^o_k(T,P) = Cp^{ref}_k(T) * \f] * - * *
*

%Application within Kinetics Managers

*
@@ -298,7 +296,6 @@ namespace Cantera * being of the type handled by the IdealGasPhase object. * * @ingroup thermoprops - * */ class IdealGasPhase: public ThermoPhase { diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 051726581..fef577284 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -97,7 +97,6 @@ namespace Cantera class IdealMolalSoln : public MolalityVPSSTP { public: - /// Constructor IdealMolalSoln(); @@ -386,8 +385,7 @@ public: * @param acMolality Output Molality-based activity coefficients. * Length: m_kk. */ - virtual void - getMolalityActivityCoefficients(doublereal* acMolality) const; + virtual void getMolalityActivityCoefficients(doublereal* acMolality) const; //@} /// @name Partial Molar Properties of the Solution @@ -478,7 +476,6 @@ public: */ virtual void getPartialMolarVolumes(doublereal* vbar) const; - //! Partial molar heat capacity of the solution:. UnitsL J/kmol/K /*! * The kth partial molar heat capacity is equal to diff --git a/include/cantera/thermo/IonsFromNeutralVPSSTP.h b/include/cantera/thermo/IonsFromNeutralVPSSTP.h index 5cf5d9fc2..4b901ac5c 100644 --- a/include/cantera/thermo/IonsFromNeutralVPSSTP.h +++ b/include/cantera/thermo/IonsFromNeutralVPSSTP.h @@ -72,7 +72,6 @@ enum IonSolnType_enumType { class IonsFromNeutralVPSSTP : public GibbsExcessVPSSTP { public: - //! @name Constructors //! @{ @@ -126,7 +125,6 @@ public: IonsFromNeutralVPSSTP(XML_Node& phaseRoot, const std::string& id = "", ThermoPhase* neutralPhase = 0); - //! Copy constructor /*! * @param b class to be copied @@ -162,7 +160,6 @@ public: * routine, which does most of the work. * * @param inputFile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -188,7 +185,6 @@ public: * point to an XML phase object, it must have * sibling nodes "speciesData" that describe * the species in the phase. - * * @param id ID of the phase. If nonnull, a check is done * to see if phaseNode is pointing to the phase * with the correct id. @@ -297,17 +293,14 @@ public: * - R T \frac{d \ln(\gamma_k) }{dT} * \f] * - * * @param sbar Output vector of species partial molar entropies. * Length: m_kk. Units: J/kmol/K */ virtual void getPartialMolarEntropies(doublereal* sbar) const; - //! Get the change in activity coefficients w.r.t. change in state (temp, mole fraction, etc.) along //! a line in parameter space or along a line in physical space /*! - * * @param dTds Input of temperature change along the path * @param dXds Input vector of changes in mole fraction along the path. length = m_kk * Along the path length it must be the case that the mole fractions sum to one. @@ -558,7 +551,6 @@ public: */ void initThermoXML(XML_Node& phaseNode, const std::string& id); - private: //! Initialize lengths of local variables after all species have //! been identified. diff --git a/include/cantera/thermo/LatticePhase.h b/include/cantera/thermo/LatticePhase.h index 2e031e97f..fb008fd84 100644 --- a/include/cantera/thermo/LatticePhase.h +++ b/include/cantera/thermo/LatticePhase.h @@ -180,7 +180,6 @@ namespace Cantera * \exp(\frac{\mu^{o}_l - \mu^{o}_j - \mu^{o}_k}{R T} ) * \f] * - * * %Kinetics managers will calculate the concentration equilibrium constant, \f$ K_c \f$, * using the second and third part of the above expression as a definition for the concentration * equilibrium constant. @@ -864,8 +863,7 @@ protected: //! Temporary storage for the reference state entropies at the current temperature mutable vector_fp m_s0_R; - //! String name for the species which represents a vacancy - //! in the lattice + //! String name for the species which represents a vacancy in the lattice /*! * This string is currently unused */ diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index 1c7d46714..9c451feb6 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -96,7 +96,6 @@ namespace Cantera * have been redefined to use this convention. * * (This object is still under construction) - * */ class LatticeSolidPhase : public ThermoPhase { diff --git a/include/cantera/thermo/MargulesVPSSTP.h b/include/cantera/thermo/MargulesVPSSTP.h index 81568f4c8..37e8b97c5 100644 --- a/include/cantera/thermo/MargulesVPSSTP.h +++ b/include/cantera/thermo/MargulesVPSSTP.h @@ -31,7 +31,6 @@ namespace Cantera //! MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs //! the Margules approximation for the excess Gibbs free energy /*! - * * MargulesVPSSTP derives from class GibbsExcessVPSSTP which is derived * from VPStandardStateTP, * and overloads the virtual methods defined there with ones that @@ -57,7 +56,6 @@ namespace Cantera * density to pressure. The variable m_Pcurrent contains the current value of the * pressure within the phase. * - * *
*

Specification of Species Standard State Properties

*
@@ -69,7 +67,6 @@ namespace Cantera * and pressure of the solution. I don't think it prevents, however, * some species from being dilute in the solution. * - * *
*

Specification of Solution Thermodynamic Properties

*
@@ -256,7 +253,6 @@ namespace Cantera */ class MargulesVPSSTP : public GibbsExcessVPSSTP { - public: //! Constructor /*! @@ -427,7 +423,6 @@ public: */ virtual void getPartialMolarCp(doublereal* cpbar) const; - //! Return an array of partial molar volumes for the //! species in the mixture. Units: m^3/kmol. /*! @@ -462,7 +457,6 @@ public: * * @param d2lnActCoeffdT2 Output vector of temperature 2nd derivatives of the * log Activity Coefficients. length = m_kk - * */ virtual void getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) const; @@ -475,7 +469,6 @@ public: * * @param dlnActCoeffdT Output vector of temperature derivatives of the * log Activity Coefficients. length = m_kk - * */ virtual void getdlnActCoeffdT(doublereal* dlnActCoeffdT) const; diff --git a/include/cantera/thermo/MaskellSolidSolnPhase.h b/include/cantera/thermo/MaskellSolidSolnPhase.h index c75414502..3e6a624a7 100644 --- a/include/cantera/thermo/MaskellSolidSolnPhase.h +++ b/include/cantera/thermo/MaskellSolidSolnPhase.h @@ -18,7 +18,6 @@ namespace Cantera { - /** * Class MaskellSolidSolnPhase represents a condensed phase * non-ideal solution with 2 species following the thermodynamic diff --git a/include/cantera/thermo/MetalPhase.h b/include/cantera/thermo/MetalPhase.h index 18e8f0abe..f6b740d0c 100644 --- a/include/cantera/thermo/MetalPhase.h +++ b/include/cantera/thermo/MetalPhase.h @@ -18,13 +18,10 @@ namespace Cantera * @ingroup thermoprops * * Class MetalPhase represents electrons in a metal. - * */ class MetalPhase : public ThermoPhase { - public: - MetalPhase() {} MetalPhase(const MetalPhase& right) { diff --git a/include/cantera/thermo/MixedSolventElectrolyte.h b/include/cantera/thermo/MixedSolventElectrolyte.h index 3092b49b8..b683c9a73 100644 --- a/include/cantera/thermo/MixedSolventElectrolyte.h +++ b/include/cantera/thermo/MixedSolventElectrolyte.h @@ -31,7 +31,6 @@ namespace Cantera //! MixedSolventElectrolyte is a derived class of GibbsExcessVPSSTP that employs //! the DH and local Marguless approximations for the excess Gibbs free energy /*! - * * MixedSolventElectrolyte derives from class GibbsExcessVPSSTP which is derived * from VPStandardStateTP, * and overloads the virtual methods defined there with ones that @@ -57,7 +56,6 @@ namespace Cantera * density to pressure. The variable m_Pcurrent contains the current value of the * pressure within the phase. * - * *
*

Specification of Species Standard State Properties

*
@@ -69,7 +67,6 @@ namespace Cantera * and pressure of the solution. I don't think it prevents, however, * some species from being dilute in the solution. * - * *
*

Specification of Solution Thermodynamic Properties

*
@@ -187,7 +184,6 @@ namespace Cantera * C_j^a = C^s a_j \mbox{\quad and \quad} C_k^a = C^s a_k * \f] * - * * \f$ C_j^a \f$ is the activity concentration of species j, and * \f$ C_k^a \f$ is the activity concentration of species k. \f$ C^s \f$ * is the standard concentration. \f$ a_j \f$ is @@ -254,7 +250,6 @@ namespace Cantera * \f$k^{-1} \f$ has units of s-1. * * @ingroup thermoprops - * */ class MixedSolventElectrolyte : public MolarityIonicVPSSTP { diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index ec20c4eac..3933002e4 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -645,7 +645,6 @@ protected: * accurate value for the saturation pressure. * * @param TKelvin temperature in kelvin - * * @return returns the estimated saturation pressure at the given temperature */ virtual doublereal psatEst(doublereal TKelvin) const; @@ -661,7 +660,6 @@ public: * @param pres Pressure in Pa. This is used as an initial guess. If the routine * needs to change the pressure to find a stable liquid state, the * new pressure is returned in this variable. - * * @return Returns the estimate of the liquid volume. If the liquid can't be found, this * routine returns -1. */ @@ -685,7 +683,6 @@ public: * * @param rhoguess Guessed density of the fluid. A value of -1.0 indicates that there * is no guessed density - * * @return We return the density of the fluid at the requested phase. If we have not found any * acceptable density we return a -1. If we have found an acceptable density at a * different phase, we return a -2. @@ -739,7 +736,6 @@ public: * @param TKelvin (input) Temperature (Kelvin) * @param molarVolGas (return) Molar volume of the gas * @param molarVolLiquid (return) Molar volume of the liquid - * * @return Returns the saturation pressure at the given temperature */ doublereal calculatePsat(doublereal TKelvin, doublereal& molarVolGas, @@ -760,7 +756,6 @@ protected: * * @param TKelvin temperature in kelvin * @param molarVol molar volume ( m3/kmol) - * * @return Returns the pressure. */ virtual doublereal pressureCalc(doublereal TKelvin, doublereal molarVol) const; @@ -771,9 +766,7 @@ protected: * * @param TKelvin temperature in kelvin * @param molarVol molar volume ( m3/kmol) - * * @param presCalc Returns the pressure. - * * @return Returns the derivative of the pressure wrt the molar volume */ virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const; diff --git a/include/cantera/thermo/MolalityVPSSTP.h b/include/cantera/thermo/MolalityVPSSTP.h index 26db5da16..c05b08ee1 100644 --- a/include/cantera/thermo/MolalityVPSSTP.h +++ b/include/cantera/thermo/MolalityVPSSTP.h @@ -138,7 +138,6 @@ namespace Cantera * term in the equation above is non-trivial. For example it's equal * to 2.38 kcal gmol-1 for water at 298 K. * - * * In order to prevent a singularity, this class includes the concept of a minimum * value for the solvent mole fraction. All calculations involving the formulation * of activity coefficients and other non-ideal solution behavior adhere to @@ -146,7 +145,6 @@ namespace Cantera * because these solution behavior were all designed and measured far away from * the zero solvent singularity condition and are not applicable in that limit. * - * * This objects add a layer that supports molality. It inherits from VPStandardStateTP. * * All objects that derive from this are assumed to have molality based standard states. @@ -180,7 +178,6 @@ namespace Cantera * State object. When molalities are needed it recalculates the molalities from * the State object's mole fraction vector. * - * * @todo Make two solvent minimum fractions. One would be for calculation of the non-ideal * factors. The other one would be for purposes of stoichiometry evaluation. the * stoichiometry evaluation one would be a 1E-13 limit. Anything less would create @@ -677,7 +674,6 @@ public: doublereal threshold=1e-14) const; protected: - virtual void getCsvReportData(std::vector& names, std::vector& data) const; diff --git a/include/cantera/thermo/MolarityIonicVPSSTP.h b/include/cantera/thermo/MolarityIonicVPSSTP.h index 9654bde57..84e8c9e62 100644 --- a/include/cantera/thermo/MolarityIonicVPSSTP.h +++ b/include/cantera/thermo/MolarityIonicVPSSTP.h @@ -53,11 +53,9 @@ namespace Cantera * One of the ions must be a "special ion" in the sense that its' thermodynamic * functions are set to zero, and the thermo functions of all other * ions are based on a valuation relative to that special ion. - * */ class MolarityIonicVPSSTP : public GibbsExcessVPSSTP { - public: /// Constructor /*! diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 83d02655f..4d22b89ec 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -1,4 +1,3 @@ - /** * @file NasaPoly1.h * Header for a single-species standard state object derived diff --git a/include/cantera/thermo/PDSS.h b/include/cantera/thermo/PDSS.h index 77c5733a4..926276b3a 100644 --- a/include/cantera/thermo/PDSS.h +++ b/include/cantera/thermo/PDSS.h @@ -505,7 +505,6 @@ public: * * @param phaseNode Reference to the phase Information for the phase * that owns this species. - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -542,10 +541,8 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param vpssmgr_ptr Pointer to the variable pressure standard state * calculator for this phase - * * @param spthermo_ptr Pointer to the optional SpeciesThermo object * that will handle the calculation of the reference * state thermodynamic coefficients. diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index 14a557fe8..caf1ae692 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -214,7 +214,6 @@ public: virtual void reportParams(size_t& kindex, int& type, doublereal* const c, doublereal& minTemp, doublereal& maxTemp, doublereal& refPressure) const; - //@} private: @@ -247,7 +246,6 @@ private: * The output of this is in units of Angstroms * * @param temp Temperature (K) - * * @param ifunc parameters specifying the desired information * - 0 function value * - 1 derivative wrt temperature @@ -261,7 +259,6 @@ private: * the output of this is unitless * * @param temp Temperature (K) - * * @param ifunc parameters specifying the desired information * - 0 function value * - 1 derivative wrt temperature @@ -319,7 +316,6 @@ private: * stable state. * * @param elemName String. Only the first 3 characters are significant - * * @return value contains the Gibbs free energy for that element * * @exception CanteraError diff --git a/include/cantera/thermo/PDSS_IdealGas.h b/include/cantera/thermo/PDSS_IdealGas.h index 0ed637fc8..8f30e5e7a 100644 --- a/include/cantera/thermo/PDSS_IdealGas.h +++ b/include/cantera/thermo/PDSS_IdealGas.h @@ -126,11 +126,8 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param inputFile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -149,12 +146,9 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param phaseNode Reference to the phase Information for the phase * that owns this species. - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index 0f70fd459..ee9d86ce8 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -141,11 +141,8 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param inputFile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -164,15 +161,11 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param speciesNode Reference to the phase Information for the species * that this standard state refers to - * * @param phaseNode Reference to the phase Information for the phase * that owns this species. - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index 4def807da..91a98289a 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -267,11 +267,8 @@ private: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param inputFile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -290,14 +287,10 @@ private: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param speciesNode XML Node containing the species information - * * @param phaseNode Reference to the phase Information for the phase * that owns this species. - * * @param spInstalled Boolean indicating whether the species is * already installed. */ diff --git a/include/cantera/thermo/PDSS_Water.h b/include/cantera/thermo/PDSS_Water.h index 629e17865..deaa9c43c 100644 --- a/include/cantera/thermo/PDSS_Water.h +++ b/include/cantera/thermo/PDSS_Water.h @@ -233,11 +233,8 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param inputFile XML file containing the description of the phase - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. @@ -257,12 +254,9 @@ public: * * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spindex Species index within the phase - * * @param phaseNode Reference to the phase Information for the phase * that owns this species. - * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index 34dc06a70..de690d06b 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -108,7 +108,6 @@ public: /*! * The XML_Node for the phase contains all of the input data used to set * up the model for the phase during its initialization. - * */ XML_Node& xml() const; @@ -275,7 +274,6 @@ public: //! which take an array pointer. void checkSpeciesArraySize(size_t kk) const; - //!@} end group Element and Species Information //! Save the current internal state of the phase @@ -500,13 +498,12 @@ public: //! Concentration of species k. //! If k is outside the valid range, an exception will be thrown. /*! - * @param[in] k Index of the species within the phase. + * @param[in] k Index of the species within the phase. * * @return Returns the concentration of species k (kmol m-3). */ doublereal concentration(const size_t k) const; - //! Set the concentrations to the specified values within the phase. //! We set the concentrations here and therefore we set the overall density //! of the phase. We hold the temperature constant during this operation. diff --git a/include/cantera/thermo/PhaseCombo_Interaction.h b/include/cantera/thermo/PhaseCombo_Interaction.h index 667d5c318..f79ef1442 100644 --- a/include/cantera/thermo/PhaseCombo_Interaction.h +++ b/include/cantera/thermo/PhaseCombo_Interaction.h @@ -58,7 +58,6 @@ namespace Cantera * can now be identically zero due to thermodynamic considerations. The phase behaves more * like a series of phases. That's why we named it PhaseCombo. * - * *
*

Specification of Species Standard State Properties

*
@@ -152,7 +151,6 @@ namespace Cantera * - R T^2 \frac{d^2 \ln(\gamma_k) }{{dT}^2} * \f] * - * *
*

%Application within Kinetics Managers

*
@@ -254,7 +252,6 @@ namespace Cantera * * \f$k^{-1} \f$ has units of s-1. * - * *
*

Instantiation of the Class

*
@@ -286,7 +283,6 @@ namespace Cantera * PhaseCombo_Interaction *LiFeS_X_solid = new PhaseCombo_Interaction(*xs); * @endcode * - * *
*

XML Example

*
@@ -328,7 +324,6 @@ namespace Cantera * being of the type handled by the PhaseCombo_Interaction object. * * @ingroup thermoprops - * */ class PhaseCombo_Interaction : public GibbsExcessVPSSTP { @@ -538,7 +533,6 @@ public: * * @param d2lnActCoeffdT2 Output vector of temperature 2nd derivatives of the * log Activity Coefficients. length = m_kk - * */ virtual void getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) const; @@ -551,7 +545,6 @@ public: * * @param dlnActCoeffdT Output vector of temperature derivatives of the * log Activity Coefficients. length = m_kk - * */ virtual void getdlnActCoeffdT(doublereal* dlnActCoeffdT) const; @@ -599,7 +592,6 @@ public: //! Get the change in activity coefficients w.r.t. change in state (temp, mole fraction, etc.) along //! a line in parameter space or along a line in physical space /*! - * * @param dTds Input of temperature change along the path * @param dXds Input vector of changes in mole fraction along the path. length = m_kk * Along the path length it must be the case that the mole fractions sum to one. diff --git a/include/cantera/thermo/PureFluidPhase.h b/include/cantera/thermo/PureFluidPhase.h index 638ee60a6..b3033df41 100644 --- a/include/cantera/thermo/PureFluidPhase.h +++ b/include/cantera/thermo/PureFluidPhase.h @@ -31,7 +31,6 @@ namespace Cantera class PureFluidPhase : public ThermoPhase { public: - //! Empty Base Constructor PureFluidPhase(); @@ -461,7 +460,6 @@ public: doublereal threshold=1e-14) const; protected: - //! Main call to the tpx level to set the state of the system /*! * @param n Integer indicating which 2 thermo components are held constant diff --git a/include/cantera/thermo/RedlichKisterVPSSTP.h b/include/cantera/thermo/RedlichKisterVPSSTP.h index 8be2943b5..b17d5e8dc 100644 --- a/include/cantera/thermo/RedlichKisterVPSSTP.h +++ b/include/cantera/thermo/RedlichKisterVPSSTP.h @@ -54,7 +54,6 @@ namespace Cantera * density to pressure. The variable m_Pcurrent contains the current value of the * pressure within the phase. * - * *
*

Specification of Species Standard State Properties

*
@@ -66,7 +65,6 @@ namespace Cantera * and pressure of the solution. I don't think it prevents, however, * some species from being dilute in the solution. * - * *
*

Specification of Solution Thermodynamic Properties

*
@@ -187,7 +185,6 @@ namespace Cantera * C_j^a = C^s a_j \mbox{\quad and \quad} C_k^a = C^s a_k * \f] * - * * \f$ C_j^a \f$ is the activity concentration of species j, and * \f$ C_k^a \f$ is the activity concentration of species k. \f$ C^s \f$ * is the standard concentration. \f$ a_j \f$ is @@ -254,7 +251,6 @@ namespace Cantera * \f$k^{-1} \f$ has units of s-1. * * @ingroup thermoprops - * */ class RedlichKisterVPSSTP : public GibbsExcessVPSSTP { @@ -269,7 +265,6 @@ public: //! Construct and initialize a RedlichKisterVPSSTP ThermoPhase object //! directly from an XML input file /*! - * * @param inputFile Name of the input file containing the phase XML data * to set up the object * @param id ID of the phase in the input file. Defaults to the @@ -507,7 +502,6 @@ public: //! Get the change in activity coefficients w.r.t. change in state (temp, mole fraction, etc.) along //! a line in parameter space or along a line in physical space /*! - * * @param dTds Input of temperature change along the path * @param dXds Input vector of changes in mole fraction along the path. length = m_kk * Along the path length it must be the case that the mole fractions sum to one. diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 622ca88dc..26c88ca7b 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -333,7 +333,6 @@ public: virtual doublereal critDensity() const; public: - //@} //! @name Initialization Methods - For Internal use /*! @@ -386,7 +385,6 @@ public: //! Initialize a ThermoPhase object, potentially reading activity //! coefficient information from an XML database. /*! - * * This routine initializes the lengths in the current object and * then calls the parent routine. * This method is provided to allow @@ -466,7 +464,6 @@ public: * @param pres Pressure in Pa. This is used as an initial guess. If the routine * needs to change the pressure to find a stable liquid state, the * new pressure is returned in this variable. - * * @return Returns the estimate of the liquid volume. */ virtual doublereal liquidVolEst(doublereal TKelvin, doublereal& pres) const; @@ -486,11 +483,8 @@ public: * a gas or liquid phase here, we will attempt to find a volume in that * part of the volume space, only, in this routine. A value of FLUID_UNDEFINED * means that we will accept anything. - * * @param rhoguess Guessed density of the fluid. A value of -1.0 indicates that there * is no guessed density - * - * * @return We return the density of the fluid at the requested phase. If we have not found any * acceptable density we return a -1. If we have found an acceptable density at a * different phase, we return a -2. @@ -517,7 +511,6 @@ public: * * @param TKelvin temperature in kelvin * @param molarVol molar volume ( m3/kmol) - * * @return Returns the pressure. */ virtual doublereal pressureCalc(doublereal TKelvin, doublereal molarVol) const; @@ -528,9 +521,7 @@ public: * * @param TKelvin temperature in kelvin * @param molarVol molar volume ( m3/kmol) - * * @param presCalc Returns the pressure. - * * @return Returns the derivative of the pressure wrt the molar volume */ virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const; @@ -556,7 +547,6 @@ public: * function. It does use the stored mole fractions in the object. * * @param temp Temperature (TKelvin) - * * @param aCalc (output) Returns the a value * @param bCalc (output) Returns the b value. */ diff --git a/include/cantera/thermo/SemiconductorPhase.h b/include/cantera/thermo/SemiconductorPhase.h index f7e972184..37fd3895a 100644 --- a/include/cantera/thermo/SemiconductorPhase.h +++ b/include/cantera/thermo/SemiconductorPhase.h @@ -26,9 +26,7 @@ const int cHole = 1; */ class SemiconductorPhase : public ThermoPhase { - public: - SemiconductorPhase() {} SemiconductorPhase(std::string infile, std::string id=""); @@ -56,7 +54,6 @@ public: return cSemiconductor; } - virtual void setPressure(doublereal pres) { m_press = pres; } @@ -64,7 +61,6 @@ public: return m_press; } - virtual void setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Semiconductor"); doublereal rho = getFloat(eosdata, "density", "-"); diff --git a/include/cantera/thermo/ShomatePoly.h b/include/cantera/thermo/ShomatePoly.h index 6caa83e28..2fc91f3bc 100644 --- a/include/cantera/thermo/ShomatePoly.h +++ b/include/cantera/thermo/ShomatePoly.h @@ -123,7 +123,6 @@ public: virtual void updateProperties(const doublereal* tt, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { - doublereal A = m_coeff[0]; doublereal Bt = m_coeff[1]*tt[0]; doublereal Ct2 = m_coeff[2]*tt[1]; diff --git a/include/cantera/thermo/SingleSpeciesTP.h b/include/cantera/thermo/SingleSpeciesTP.h index 5d6cbe8b0..f515006d3 100644 --- a/include/cantera/thermo/SingleSpeciesTP.h +++ b/include/cantera/thermo/SingleSpeciesTP.h @@ -3,7 +3,6 @@ * Header for the SingleSpeciesTP class, which is a filter class for ThermoPhase, * that eases the construction of single species phases * ( see \ref thermoprops and class \link Cantera::SingleSpeciesTP SingleSpeciesTP\endlink). - * */ /* * Copyright (2005) Sandia Corporation. Under the terms of @@ -15,7 +14,6 @@ #include "ThermoPhase.h" - namespace Cantera { diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index 76b407bd4..f36b19194 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -130,7 +130,6 @@ class SpeciesThermoInterpType; class SpeciesThermo { public: - //! Constructor SpeciesThermo() {} diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index 54bbb298c..01cf6d2d9 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -326,7 +326,6 @@ public: * @param vpssmgr_ptr Pointer to the Variable pressure standard state * manager that owns the PDSS object that will handle calls for this * object - * * @param PDSS_ptr Pointer to the PDSS object that handles calls for * this object */ @@ -348,11 +347,9 @@ public: * * @param speciesIndex species index for this object. Note, this must * agree with what was internally set before. - * * @param vpssmgr_ptr Pointer to the Variable pressure standard state * manager that owns the PDSS object that will handle calls for this * object - * * @param PDSS_ptr Pointer to the PDSS object that handles calls for * this object */ diff --git a/include/cantera/thermo/ThermoFactory.h b/include/cantera/thermo/ThermoFactory.h index d427a0ebc..fc042b80d 100644 --- a/include/cantera/thermo/ThermoFactory.h +++ b/include/cantera/thermo/ThermoFactory.h @@ -2,11 +2,9 @@ * @file ThermoFactory.h * Headers for the factory class that can create known ThermoPhase objects * (see \ref thermoprops and class \link Cantera::ThermoFactory ThermoFactory\endlink). - * */ // Copyright 2001 California Institute of Technology - #ifndef THERMO_FACTORY_H #define THERMO_FACTORY_H @@ -54,9 +52,7 @@ public: */ class ThermoFactory : public FactoryBase { - public: - //! Static function that creates a static instance of the factory. static ThermoFactory* factory() { ScopedLock lock(thermo_mutex); @@ -76,7 +72,6 @@ public: //! Create a new thermodynamic property manager. /*! * @param model String to look up the model against - * * @return * Returns a pointer to a new ThermoPhase instance matching the * model string. Returns NULL if something went wrong. @@ -100,7 +95,6 @@ private: /*! * @param model String to look up the model against * @param f ThermoFactory instance to use in matching the string - * * @return * Returns a pointer to a new ThermoPhase instance matching the * model string. Returns NULL if something went wrong. @@ -154,7 +148,6 @@ ThermoPhase* newPhase(XML_Node& phase); * @param infile name of the input file * @param id name of the phase id in the file. * If this is blank, the first phase in the file is used. - * * @return * Returns an initialized ThermoPhase object. */ @@ -223,7 +216,6 @@ ThermoPhase* newPhase(const std::string& infile, std::string id=""); * available. If not available, one will be * created. * @ingroup thermoprops - * */ void importPhase(XML_Node& phase, ThermoPhase* th); diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index bed234592..cd287dd23 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -339,7 +339,6 @@ public: * @{ */ - //! This method returns the convention used in specification //! of the activities, of which there are currently two, molar- //! and molality-based conventions. @@ -479,7 +478,6 @@ public: throw NotImplementedError("ThermoPhase::getChemPotentials_RT"); } - //! Get the species chemical potentials. Units: J/kmol. /*! * This function returns a vector of chemical potentials of the @@ -815,10 +813,8 @@ public: */ virtual void getReferenceComposition(doublereal* const x) const; - // // The methods below are not virtual, and should not // be overloaded. - // //@} //! @name Specific Properties @@ -1175,7 +1171,6 @@ private: void setState_conditional_TP(doublereal t, doublereal p, bool set_p); public: - /** * @name Chemical Equilibrium * Chemical equilibrium. @@ -1340,7 +1335,6 @@ public: //@} - //! @name Initialization Methods - For Internal Use (ThermoPhase) /*! * The following methods are used in the process of constructing @@ -1388,7 +1382,6 @@ public: //! Return a changeable reference to the calculation manager //! for species reference-state thermodynamic properties /*! - * * @param k Species id. The default is -1, meaning return the default * * @internal @@ -1513,7 +1506,6 @@ public: //! Set the initial state of the phase to the conditions //! specified in the state XML element. /*! - * * This method sets the temperature, pressure, and mole * fraction vector to a set default value. * @@ -1530,7 +1522,6 @@ public: //! Get the change in activity coefficients wrt changes in state (temp, mole fraction, etc) along //! a line in parameter space or along a line in physical space /*! - * * @param dTds Input of temperature change along the path * @param dXds Input vector of changes in mole fraction along the path. length = m_kk * Along the path length it must be the case that the mole fractions sum to one. diff --git a/include/cantera/thermo/VPSSMgr.h b/include/cantera/thermo/VPSSMgr.h index 57f68ee99..b896788d4 100644 --- a/include/cantera/thermo/VPSSMgr.h +++ b/include/cantera/thermo/VPSSMgr.h @@ -230,7 +230,6 @@ class PDSS; * This class is usually used for nearly incompressible phases. For those phases, it * makes sense to change the equation of state independent variable from * density to pressure. - * */ class VPSSMgr { @@ -525,7 +524,6 @@ public: virtual void updateRefStateThermo() const; protected: - //! Updates the standard state thermodynamic functions at the //! current T and P of the solution. /*! diff --git a/include/cantera/thermo/VPSSMgr_ConstVol.h b/include/cantera/thermo/VPSSMgr_ConstVol.h index 2c7668484..a6891bdc8 100644 --- a/include/cantera/thermo/VPSSMgr_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_ConstVol.h @@ -28,9 +28,7 @@ namespace Cantera */ class VPSSMgr_ConstVol : public VPSSMgr { - public: - //! Constructor /*! * @param vp_ptr Pointer to the owning VPStandardStateTP object @@ -61,7 +59,6 @@ public: //@{ protected: - virtual void _updateStandardStateThermo(); //@} diff --git a/include/cantera/thermo/VPSSMgr_General.h b/include/cantera/thermo/VPSSMgr_General.h index bc634ebf6..572819115 100644 --- a/include/cantera/thermo/VPSSMgr_General.h +++ b/include/cantera/thermo/VPSSMgr_General.h @@ -129,7 +129,6 @@ public: virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); - virtual PDSS_enumType reportPDSSType(int index = -1) const ; virtual VPSSMgr_enumType reportVPSSMgrType() const ; virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr); diff --git a/include/cantera/thermo/VPSSMgr_IdealGas.h b/include/cantera/thermo/VPSSMgr_IdealGas.h index 1a80b100b..7959f57db 100644 --- a/include/cantera/thermo/VPSSMgr_IdealGas.h +++ b/include/cantera/thermo/VPSSMgr_IdealGas.h @@ -50,11 +50,9 @@ public: //@} protected: - virtual void _updateStandardStateThermo(); public: - /*! @name Initialization Methods - For Internal use * The following methods are used in the process of constructing the phase * and setting its parameters from a specification in an input file. They diff --git a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h index cdfbfaac4..3aba0c3ca 100644 --- a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h @@ -60,7 +60,6 @@ private: //@} public: - /*! @name Thermodynamic Values for the Species Reference States * There are also temporary variables for holding the species reference- * state values of Cp, H, S, and V at the last temperature and reference diff --git a/include/cantera/thermo/VPSSMgr_Water_HKFT.h b/include/cantera/thermo/VPSSMgr_Water_HKFT.h index 53276b358..cb39a7056 100644 --- a/include/cantera/thermo/VPSSMgr_Water_HKFT.h +++ b/include/cantera/thermo/VPSSMgr_Water_HKFT.h @@ -30,7 +30,6 @@ public: /*! * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object * This object must have already been malloced. - * * @param spth Pointer to the optional SpeciesThermo object * that will handle the calculation of the reference * state thermodynamic coefficients. diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index 7d5ae6951..c07d78505 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -52,7 +52,6 @@ namespace Cantera */ class VPStandardStateTP : public ThermoPhase { - public: //! @name Constructors and Duplicators for VPStandardStateTP @@ -224,7 +223,6 @@ public: */ virtual void getCp_R(doublereal* cpr) const; - //! Get the molar volumes of each species in their standard //! states at the current //! T and P of the solution. @@ -284,7 +282,6 @@ public: //! Updates the standard state thermodynamic functions at the current T and P of the solution. /*! - * * If m_useTmpStandardStateStorage is true, * this function must be called for every call to functions in this * class. It checks to see whether the temperature or pressure has changed and @@ -302,7 +299,6 @@ public: * * If m_useTmpStandardStateStorage is not true, this function may be * required to be called by child classes to update internal member data. - * */ virtual void updateStandardStateThermo() const; @@ -354,12 +350,10 @@ protected: * has changed. It automatically assumes that it has changed. * If m_useTmpStandardStateStorage is not true, this function may be * required to be called by child classes to update internal member data.. - * */ virtual void _updateStandardStateThermo() const; public: - /// @name Thermodynamic Values for the Species Reference States (VPStandardStateTP) /*! * There are also temporary @@ -511,7 +505,6 @@ public: const PDSS* providePDSS(size_t k) const; protected: - //! Current value of the pressure - state variable /*! * Because we are now using the pressure as a state variable, we need to carry it diff --git a/include/cantera/thermo/WaterSSTP.h b/include/cantera/thermo/WaterSSTP.h index 7ee379c7e..597083129 100644 --- a/include/cantera/thermo/WaterSSTP.h +++ b/include/cantera/thermo/WaterSSTP.h @@ -13,7 +13,6 @@ #include "SingleSpeciesTP.h" - namespace Cantera { diff --git a/include/cantera/thermo/speciesThermoTypes.h b/include/cantera/thermo/speciesThermoTypes.h index 4b5ab5d4d..1c5d1c11a 100644 --- a/include/cantera/thermo/speciesThermoTypes.h +++ b/include/cantera/thermo/speciesThermoTypes.h @@ -4,7 +4,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef SPECIES_THERMO_TYPES_H #define SPECIES_THERMO_TYPES_H @@ -68,5 +67,3 @@ #define PDSS_TYPE 37 #endif - - diff --git a/include/cantera/transport/DustyGasTransport.h b/include/cantera/transport/DustyGasTransport.h index dba361337..f56e29ce8 100644 --- a/include/cantera/transport/DustyGasTransport.h +++ b/include/cantera/transport/DustyGasTransport.h @@ -176,7 +176,6 @@ public: friend class TransportFactory; protected: - //! Initialization routine called by TransportFactory /*! * The DustyGas model is a subordinate model to the gas phase transport model. Here we @@ -218,7 +217,6 @@ private: * * where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is * the tortuosity of the media. - * */ void updateBinaryDiffCoeffs(); @@ -343,7 +341,6 @@ private: * Note, this object owns the gastran object */ Transport* m_gastran; - }; } #endif diff --git a/include/cantera/transport/HighPressureGasTransport.h b/include/cantera/transport/HighPressureGasTransport.h index af931b2d9..abf286f35 100755 --- a/include/cantera/transport/HighPressureGasTransport.h +++ b/include/cantera/transport/HighPressureGasTransport.h @@ -27,7 +27,6 @@ namespace Cantera class HighPressureGasTransport : public MultiTransport { protected: - //! default constructor /*! * @param thermo Optional parameter for the pointer to the ThermoPhase object @@ -68,7 +67,6 @@ public: friend class TransportFactory; protected: - virtual doublereal Tcrit_i(size_t i); virtual doublereal Pcrit_i(size_t i); diff --git a/include/cantera/transport/LTPspecies.h b/include/cantera/transport/LTPspecies.h index 05c676484..ae7f03a5c 100644 --- a/include/cantera/transport/LTPspecies.h +++ b/include/cantera/transport/LTPspecies.h @@ -143,7 +143,6 @@ private: virtual void adjustCoeffsForComposition(); protected: - //! Species Name for the property that is being described std::string m_speciesName; @@ -397,7 +396,6 @@ public: //! Assignment operator /*! * @param right Object to be copied - * * @return returns a reference to the current object */ LTPspecies_Poly& operator=(const LTPspecies_Poly& right); @@ -481,7 +479,6 @@ public: //! Assignment operator /*! * @param right Object to be copied - * * @return returns a reference to the current object */ LTPspecies_ExpT& operator=(const LTPspecies_ExpT& right); diff --git a/include/cantera/transport/LiquidTranInteraction.h b/include/cantera/transport/LiquidTranInteraction.h index 698f14c37..c721c64bd 100644 --- a/include/cantera/transport/LiquidTranInteraction.h +++ b/include/cantera/transport/LiquidTranInteraction.h @@ -386,7 +386,6 @@ protected: //! This class is only valid for a common anion mixture of two //! salts with cations of equal charge. Hence the name _PPN. /** - * * This class requres you specify * * 1 - ion conductivity @@ -452,7 +451,6 @@ protected: */ class LTI_StefanMaxwell_PPN : public LiquidTranInteraction { - public: LTI_StefanMaxwell_PPN(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { diff --git a/include/cantera/transport/LiquidTransport.h b/include/cantera/transport/LiquidTransport.h index fb443a936..19b0a8355 100644 --- a/include/cantera/transport/LiquidTransport.h +++ b/include/cantera/transport/LiquidTransport.h @@ -65,7 +65,6 @@ namespace Cantera * and quantities like the electric current are computed * based on a combined electrochemical potential. * - * * @ingroup tranprops */ class LiquidTransport : public Transport @@ -1081,7 +1080,6 @@ private: * of LTPspecies held in m_lambdaTempDep_Ns. * * Length = number of species - * */ vector_fp m_lambdaSpecies; diff --git a/include/cantera/transport/LiquidTransportParams.h b/include/cantera/transport/LiquidTransportParams.h index 96f89a896..6c25c55a7 100644 --- a/include/cantera/transport/LiquidTransportParams.h +++ b/include/cantera/transport/LiquidTransportParams.h @@ -125,13 +125,11 @@ public: //! Default composition dependence of the transport properties /*! - * * Permissible types of composition dependencies * 0 - Solvent values (i.e., species 0) contributes only * 1 - linear combination of mole fractions; */ LiquidTranMixingModel compositionDepTypeDefault_; - }; } diff --git a/include/cantera/transport/MixTransport.h b/include/cantera/transport/MixTransport.h index 52d8e996b..58107ebb4 100644 --- a/include/cantera/transport/MixTransport.h +++ b/include/cantera/transport/MixTransport.h @@ -161,7 +161,6 @@ public: virtual void init(thermo_t* thermo, int mode=0, int log_level=0); private: - //! Calculate the pressure from the ideal gas law doublereal pressure_ig() const { return (m_thermo->molarDensity() * GasConstant * diff --git a/include/cantera/transport/Tortuosity.h b/include/cantera/transport/Tortuosity.h index 3b6c38cc7..407885dac 100644 --- a/include/cantera/transport/Tortuosity.h +++ b/include/cantera/transport/Tortuosity.h @@ -41,7 +41,6 @@ namespace Cantera */ class Tortuosity { - public: //! Default constructor uses Bruggeman exponent of 1.5 Tortuosity(double setPower = 1.5) : expBrug_(setPower) { @@ -74,18 +73,15 @@ public: protected: //! Bruggeman exponent: power to which the tortuosity depends on the volume fraction double expBrug_ ; - }; - /** This class implements transport coefficient corrections * appropriate for porous media where percolation theory applies. * It is derived from the Tortuosity class. */ class TortuosityPercolation : public Tortuosity { - public: //! Default constructor uses Bruggeman exponent of 1.5 TortuosityPercolation(double percolationThreshold = 0.4, double conductivityExponent = 2.0) : percolationThreshold_(percolationThreshold), conductivityExponent_(conductivityExponent) { @@ -133,7 +129,6 @@ protected: }; - /** This class implements transport coefficient corrections * appropriate for porous media with a dispersed phase. * This model goes back to Maxwell. The formula for the @@ -150,7 +145,6 @@ protected: */ class TortuosityMaxwell : public Tortuosity { - public: //! Default constructor uses Bruggeman exponent of 1.5 TortuosityMaxwell(double relativeConductivites = 0.0) : relativeConductivites_(relativeConductivites) { @@ -184,7 +178,6 @@ protected: //! Relative conductivities of the dispersed and continuous phases, //! `relativeConductivites_` \f$ = \kappa_d / \kappa_0 \f$. double relativeConductivites_; - }; } diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index 4f54bb0cb..876375f41 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -9,7 +9,6 @@ */ // Copyright 2001-2003 California Institute of Technology - /** * @defgroup tranprops Transport Properties for Species in Phases * diff --git a/include/cantera/transport/WaterTransport.h b/include/cantera/transport/WaterTransport.h index b0a099189..f635f28dd 100644 --- a/include/cantera/transport/WaterTransport.h +++ b/include/cantera/transport/WaterTransport.h @@ -19,7 +19,6 @@ const int LDIFF_MIXDIFF_FLUXCORRECTED = 1; const int LDIFF_MULTICOMP_STEFANMAXWELL = 2; //! @} - class WaterProps; class PDSS_Water; @@ -32,7 +31,6 @@ public: /*! * @param thermo ThermoPhase object that represents the phase. * Defaults to zero - * * @param ndim Number of dimensions of the flux expressions. * Defaults to a value of one. */ @@ -86,7 +84,6 @@ public: virtual doublereal thermalConductivity(); private: - //! Routine to do some common initializations at the start of using //! this routine. void initTP(); diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index f16619efa..c838f9b06 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -34,7 +34,6 @@ namespace Cantera * - rate of change of the total volume (m^3/s) * - surface heat loss rate (W) * - species surface production rates (kmol/s) - * */ class Reactor : public ReactorBase { diff --git a/include/cantera/zeroD/ReactorFactory.h b/include/cantera/zeroD/ReactorFactory.h index 2a2aada8a..cd0686354 100644 --- a/include/cantera/zeroD/ReactorFactory.h +++ b/include/cantera/zeroD/ReactorFactory.h @@ -3,7 +3,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef REACTOR_FACTORY_H #define REACTOR_FACTORY_H @@ -16,9 +15,7 @@ namespace Cantera class ReactorFactory : FactoryBase { - public: - static ReactorFactory* factory() { ScopedLock lock(reactor_mutex); if (!s_factory) { diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index 6f2b94a72..030c18ae1 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -2110,7 +2110,7 @@ class incompressible_solid(phase): class lattice(phase): - def __init__(self, + def __init__(self, name = '', elements = '', species = '', diff --git a/interfaces/cython/cantera/examples/surface_chemistry/sofc.cti b/interfaces/cython/cantera/examples/surface_chemistry/sofc.cti index 6b594ed45..8c6bd6a69 100644 --- a/interfaces/cython/cantera/examples/surface_chemistry/sofc.cti +++ b/interfaces/cython/cantera/examples/surface_chemistry/sofc.cti @@ -17,12 +17,8 @@ units(length = "cm", time = "s", quantity = "mol", act_energy = "kJ/mol") # Turn on mechanism validation to detect unbalanced reactions, if any validate() - - #------------------------------------------------------------------ -# # parameters -# #------------------------------------------------------------------ # a few numeric parameters are collected here to allow easy modification. @@ -33,7 +29,6 @@ validate() tc = 800.0 # temperature in C tt = tc + 273.15 # temperature in K - # these values are defined here only so they may be easily changed to # assess the effects of the oxide thermochemistry. For work at a # single temperature, all that we really need is g = h - @@ -46,18 +41,13 @@ sox = (50.0, 'J/K/mol') # entropy of an oxygen ion hhydrox = (-220.0, 'kJ/mol') # enthalpy of a surface hydroxyl group shydrox = (87.0, 'J/mol/K') # entropy of a surface hydroxyl group - - - ####################### BULK PHASES #################################### # First we'll define the bulk (i.e. 3D) phases - a gas, a metal, and # an oxide. #------------------------------------------------------------------ -# # Gas phase. -# #------------------------------------------------------------------ # The gas contains only the minimum number of species needed to model @@ -73,11 +63,8 @@ ideal_gas(name = "gas", pressure = OneAtm, mole_fractions = 'H2:0.95, H2O:0.05')) - #------------------------------------------------------------------ -# # Bulk solid metal phase. -# #------------------------------------------------------------------ # # This phase will be used for the electrodes. All we need is @@ -85,9 +72,9 @@ ideal_gas(name = "gas", # containing electrons. Note that the 'metal' entry type requires # specifying a density, but it is not used in this simulation and # therefore is arbitrary. -# +# metal(name = "metal", - elements = "E", + elements = "E", species = "electron", density = (9.0, 'kg/m3'), initial_state = state( temperature =tt, @@ -113,12 +100,8 @@ species( name = "electron", atoms = "E:1", # h0 + cp0*(t - t0), s = s0 + cp0*ln(t/t0). For work at a single # temperature, it is sufficient to specify only h0. - - #------------------------------------------------------------------- -# # Bulk solid oxide electrolyte -# #-------------------------------------------------------------------- # Here too, we create a very simple model for the bulk phase. We only @@ -130,11 +113,10 @@ incompressible_solid(name = "oxide_bulk", species = "Ox VO**", density = (0.7, 'g/cm3'), initial_state = state( temperature = tt, - pressure = OneAtm, + pressure = OneAtm, mole_fractions = "Ox:0.95 VO**:0.05") ) - # The vacancy will be modeled as truly vacant - it contains no atoms, # has no charge, and has zero enthalpy and entropy. This is different # from the usual convention in which the vacancy properties are are @@ -146,20 +128,16 @@ incompressible_solid(name = "oxide_bulk", # A bulk lattice vacancy species( name = "VO**", atoms = "", - thermo = const_cp(h0 = (0.0, 'kJ/mol'))) + thermo = const_cp(h0 = (0.0, 'kJ/mol'))) # A bulk lattice oxygen species( name = "Ox", atoms = "O:1 E:2", - thermo = const_cp(h0 = hox, s0 = sox)) - - + thermo = const_cp(h0 = hox, s0 = sox)) ####################### SURFACE PHASES #################################### #-------------------------------------------------- -# # Metal surface -# #-------------------------------------------------- # The surface of a bulk phase must be treated like a separate phase, with its @@ -209,7 +187,6 @@ species( name = "H2O(m)", atoms = "H:2, O:1", thermo = const_cp(h0 = (-281.0, 'kJ/mol'), s0 = (123.0, 'J/mol/K'))) - # Surface reactions on the metal. We assume three dissociative # adsorption reactions, and three reactions on the surface # among adsorbates. All reactions are treated as reversible. @@ -231,11 +208,8 @@ surface_reaction( "H(m) + OH(m) <=> H2O(m) + (m)", surface_reaction( "OH(m) + OH(m) <=> H2O(m) + O(m)", [5.00000E+21, 0, 100.0], id = 'metal-rxn6') - #-------------------------------------------------------- -# # Oxide surface. -# #-------------------------------------------------------- #H # On the oxide surface, we consider four species: @@ -249,7 +223,7 @@ ideal_interface(name = "oxide_surface", species = "(ox) O''(ox) OH'(ox) H2O(ox)", site_density = 2.0e-9, phases = 'gas oxide_bulk', - reactions = 'oxide-*', + reactions = 'oxide-*', initial_state = state( temperature = tt, coverages = "O''(ox):2.0, (ox):0.0") ) @@ -258,8 +232,8 @@ ideal_interface(name = "oxide_surface", # An oxygen ion at the surface, with charge = -2 species( name = "O''(ox)", atoms = "O:1 E:2", - thermo = const_cp(h0 = hox, - s0 = sox)) + thermo = const_cp(h0 = hox, + s0 = sox)) # An OH at the surface, with charge = -1 species( name = "OH'(ox)", atoms = "O:1 H:1 E:1", @@ -275,7 +249,6 @@ species( name = "H2O(ox)", atoms = "H:2, O:1", thermo = const_cp(h0 = (-265.0, 'kJ/mol'), s0 = (98.0,'J/mol/K'))) - # This reaction represents the exchange of a surface oxygen vacancy and # a subsurface vacancy. The concentration of subsurface vacancies is # fixed by the doping level. If this reaction is given a large rate, @@ -284,8 +257,7 @@ species( name = "H2O(ox)", atoms = "H:2, O:1", surface_reaction("(ox) + Ox <=> VO** + O''(ox)", [5.0e8, 0.0, 0.0], id = "oxide-vac") - -# Desorption of physisorbed water. This is made fast. +# Desorption of physisorbed water. This is made fast. surface_reaction("H2O(ox) <=> H2O + (ox)", [1.0e14, 0.0, (0.0, 'kJ/mol')], id = "oxide-water") @@ -294,10 +266,8 @@ surface_reaction("H2O(ox) <=> H2O + (ox)", surface_reaction("H2O(ox) + O''(ox) <=> OH'(ox) + OH'(ox)", [1.0e14, 0.0, (0.0, 'kJ/mol')], id = "oxide-oh") - ####################### TRIPLE PHASE BOUNDARY ######################### - # The triple phase boundary between the metal, oxide, and gas. A # single species is specified, but it is not used, since all reactions # only involve species on either side of the tpb. Note that the site @@ -316,8 +286,6 @@ edge(name = "tpb", # dummy species species( name = "(tpb)", atoms = "") - - # Here we define two charge transfer reactions. Both reactions are # reversible, and can be used to model either anodes or cathodes # (although real anodes and cathodes would usually have different @@ -326,26 +294,19 @@ species( name = "(tpb)", atoms = "") # in this reaction, a proton from the metal crosses the TPB to the # oxide surface to make a hydroxyl and deliver an electron to the # metal. -edge_reaction("H(m) + O''(ox) <=> (m) + electron + OH'(ox)", +edge_reaction("H(m) + O''(ox) <=> (m) + electron + OH'(ox)", [5.0e13, 0.0, 120.0], beta = 0.5, id="edge-f2") # in this reaction, an oxygen on the metal surface plus 2 electrons # from the metal bulk fill a surface vacancy in the oxide lattice. -edge_reaction("O(m) + (ox) + 2 electron <=> (m) + O''(ox)", +edge_reaction("O(m) + (ox) + 2 electron <=> (m) + O''(ox)", [5.0e13, 0.0, 120.0], beta = 0.5, id="edge-f3") - # this reaction is commented out, but you can explore its effects by # uncommenting it. Be careful, if you are not solving for the OH' # concentration that the system does not become overdetermined # (i.e. impossible for all reactions to be simultaneously in # equilibrium). If this happens, the wrong OCVs will result. -#edge_reaction("H(m) + OH'(ox) <=> H2O(ox) + (m) + electron", +#edge_reaction("H(m) + OH'(ox) <=> H2O(ox) + (m) + electron", # [5.0e13, 0.0, 120.0], beta = 0.5, id="edge-f") - - - - - - diff --git a/interfaces/cython/cantera/examples/transport/multiprocessing_viscosity.py b/interfaces/cython/cantera/examples/transport/multiprocessing_viscosity.py index 3f743e586..36fa18119 100644 --- a/interfaces/cython/cantera/examples/transport/multiprocessing_viscosity.py +++ b/interfaces/cython/cantera/examples/transport/multiprocessing_viscosity.py @@ -1,6 +1,6 @@ """ This example demonstrates how Cantera can be used with the 'multiprocessing' -module. +module. Because Cantera Python objects are built on top of C++ objects which cannot be passed between Python processes, it is necessary to set up the computation so @@ -49,11 +49,11 @@ def parallel(mech, predicate, nProcs, nTemps): """ P = ct.one_atm X = 'CH4:1.0, O2:1.0, N2:3.76' - pool = multiprocessing.Pool(processes=nProcs, - initializer=init_process, + pool = multiprocessing.Pool(processes=nProcs, + initializer=init_process, initargs=(mech,)) - y = pool.map(predicate, + y = pool.map(predicate, zip(itertools.repeat(mech), np.linspace(300, 900, nTemps), itertools.repeat(P), @@ -64,13 +64,13 @@ def serial(mech, predicate, nTemps): P = ct.one_atm X = 'CH4:1.0, O2:1.0, N2:3.76' init_process(mech) - y = map(predicate, + y = map(predicate, zip(itertools.repeat(mech), np.linspace(300, 900, nTemps), itertools.repeat(P), itertools.repeat(X))) return y - + if __name__ == '__main__': # For functions where the work done in each subprocess is substantial, # significant speedup can be obtained using the multiprocessing module. diff --git a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp index 274b21a95..0fe687582 100644 --- a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp +++ b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp @@ -9,7 +9,6 @@ using namespace Cantera; void demoprog() { - printf("\n\n**** Testing modifying NASA polynomial coefficients ****\n\n"); IdealGasMix gas("h2o2.cti","ohmech"); @@ -31,7 +30,6 @@ void demoprog() const int LOW_A6 = 6; for (n = 0; n < nsp; n++) { - printf("\n\n %s (original):", gas.speciesName(n).c_str()); // get the NASA coefficients in array c @@ -76,7 +74,6 @@ void demoprog() int main() { - try { demoprog(); } catch (CanteraError& err) { diff --git a/samples/cxx/bvp/BoundaryValueProblem.h b/samples/cxx/bvp/BoundaryValueProblem.h index 29776d395..a3410ac83 100644 --- a/samples/cxx/bvp/BoundaryValueProblem.h +++ b/samples/cxx/bvp/BoundaryValueProblem.h @@ -66,8 +66,8 @@ public: */ BoundaryValueProblem(int nv, int np, doublereal zmin, doublereal zmax) : - m_left(0), m_right(0), m_sim(0) { - + m_left(0), m_right(0), m_sim(0) + { // Create the initial uniform grid Cantera::vector_fp z(np); int iz; @@ -86,13 +86,12 @@ public: */ BoundaryValueProblem(int nv, int np, doublereal* z) : - m_left(0), m_right(0), m_sim(0) { - + m_left(0), m_right(0), m_sim(0) + { setupGrid(np, z); resize(nv, np); } - /** * Destructor. Deletes the dummy terminator domains, and the * solver. @@ -103,7 +102,6 @@ public: delete m_sim; } - /** * Set parameters and options for solution component \a n. * This method should be invoked for each solution component @@ -137,7 +135,6 @@ public: setComponentName(n, c.name); } - /** * Solve the boundary value problem. * @param loglevel controls amount of diagnostic output. @@ -150,7 +147,6 @@ public: m_sim->solve(loglevel, refine); } - /** * Write the solution to a CSV file. * @param filename CSV file name. @@ -189,7 +185,6 @@ public: return 0.0; } - /** * Value of component \a m at point \a j. This method is used * to access solution values once a converged solution has been @@ -199,14 +194,11 @@ public: return m_sim->value(1,m,j); } - protected: - Cantera::Domain1D* m_left; ///< dummy terminator Cantera::Domain1D* m_right; ///< dummy terminator Cantera::Sim1D* m_sim; ///< controller for solution - /** * True if n is the index of the left-most grid point (zero), * false otherwise. @@ -230,7 +222,6 @@ protected: * derived classes. */ void start() { - // Add dummy terminator domains on either side of this one. m_left = new Cantera::Empty1D; m_right = new Cantera::Empty1D; @@ -248,7 +239,6 @@ protected: max_delta_slope, prune); } - /** * @name Trial Solution Derivatives * These methods return @@ -324,7 +314,6 @@ protected: return c1/(z(j+1) - z(j-1)); } - /** * This method is provided for use in method residual when * central-differenced second derivatives are needed. @@ -385,8 +374,6 @@ protected: return 2.0*(c2 - c1)/(z(j+1) - z(j-1)); } //@} - - }; } #endif diff --git a/samples/cxx/bvp/blasius.cpp b/samples/cxx/bvp/blasius.cpp index c843d227d..0895f0f3d 100644 --- a/samples/cxx/bvp/blasius.cpp +++ b/samples/cxx/bvp/blasius.cpp @@ -3,7 +3,6 @@ #include "BoundaryValueProblem.h" - /** * This class solves the Blasius boundary value problem on the domain (0,L): * \f[ @@ -23,12 +22,9 @@ */ class Blasius : public BVP::BoundaryValueProblem { - public: - // This problem has two components (zeta and u) Blasius(int np, double L) : BVP::BoundaryValueProblem(2, np, 0.0, L) { - // specify the component bounds, error tolerances, and names. BVP::Component A; A.lower = -200.0; @@ -47,7 +43,6 @@ public: setComponent(1, B); // u will be component 1 } - // destructor virtual ~Blasius() {} @@ -68,7 +63,6 @@ public: // conditions are specified. The solver will attempt to find a solution // x so that this function returns 0 for all n and j. virtual doublereal residual(doublereal* x, size_t n, size_t j) { - // if n = 0, return the residual for the first ODE if (n == 0) { if (isLeft(j)) { // here we specify zeta(0) = 0 @@ -90,9 +84,7 @@ public: } } - private: - // for convenience only. Note that the compiler will inline these. double zeta(double* x, int j) { return value(x,0,j); @@ -100,14 +92,11 @@ private: double u(double* x, int j) { return value(x,1,j); } - }; - int main() { try { - // Specify a problem on (0,10), with an initial uniform grid of // 6 points. Blasius eqs(6, 10.0); @@ -121,5 +110,3 @@ int main() return -1; } } - - diff --git a/samples/cxx/combustor/combustor.cpp b/samples/cxx/combustor/combustor.cpp index 531e5543f..1e5b65841 100644 --- a/samples/cxx/combustor/combustor.cpp +++ b/samples/cxx/combustor/combustor.cpp @@ -16,7 +16,6 @@ using namespace Cantera; void runexample() { - // use reaction mechanism GRI-Mech 3.0 IdealGasMix gas("gri30.cti", "gri30"); @@ -134,13 +133,11 @@ void runexample() int main() { - try { runexample(); return 0; - } - // handle exceptions thrown by Cantera - catch (CanteraError& err) { + } catch (CanteraError& err) { + // handle exceptions thrown by Cantera std::cout << err.what() << std::endl; std::cout << " terminating... " << std::endl; appdelete(); diff --git a/samples/cxx/demo.cpp b/samples/cxx/demo.cpp index 98646a7b5..92f22c030 100644 --- a/samples/cxx/demo.cpp +++ b/samples/cxx/demo.cpp @@ -25,7 +25,6 @@ using namespace Cantera; void demoprog() { - printf("\n\n**** C++ Test Program ****\n\n"); IdealGasMix gas("h2o2.cti","ohmech"); @@ -109,7 +108,6 @@ void demoprog() int main() { - try { demoprog(); } catch (CanteraError& err) { diff --git a/samples/cxx/kinetics1/kinetics1.cpp b/samples/cxx/kinetics1/kinetics1.cpp index c18ca9e70..137be9405 100644 --- a/samples/cxx/kinetics1/kinetics1.cpp +++ b/samples/cxx/kinetics1/kinetics1.cpp @@ -89,9 +89,8 @@ int main() int retn = kinetics1(0, 0); appdelete(); return retn; - } - // handle exceptions thrown by Cantera - catch (CanteraError& err) { + } catch (CanteraError& err) { + // handle exceptions thrown by Cantera std::cout << err.what() << std::endl; cout << " terminating... " << endl; appdelete(); diff --git a/samples/cxx/rankine/rankine.cpp b/samples/cxx/rankine/rankine.cpp index 0248ebf7a..2fdd691ee 100644 --- a/samples/cxx/rankine/rankine.cpp +++ b/samples/cxx/rankine/rankine.cpp @@ -33,7 +33,6 @@ void printStates() int openRankine(int np, void* p) { - double etap = 0.6; // pump isentropic efficiency double etat = 0.8; // turbine isentropic efficiency double phigh = 8.0e5; // high pressure @@ -76,7 +75,6 @@ int openRankine(int np, void* p) #ifndef CXX_DEMO int main() { - try { return openRankine(0, 0); } catch (CanteraError& err) { diff --git a/samples/f90/demo.f90 b/samples/f90/demo.f90 index b307b26a4..670fb9510 100644 --- a/samples/f90/demo.f90 +++ b/samples/f90/demo.f90 @@ -16,7 +16,7 @@ program main write(*,*) write(*,*) '******** Fortran 90 Test Program ********' - + ! Read in a definition of the 'gas' phase. ! This will take the definition with name 'ohmech' from file ! 'h2o2.cti', located in the Cantera data directory @@ -46,7 +46,7 @@ subroutine demo(gas, MAXSP, MAXRXNS) ! use the Cantera module use cantera - implicit none + implicit none ! declare the arguments type(phase_t), intent(inout) :: gas diff --git a/samples/matlab/catcomb.m b/samples/matlab/catcomb.m index b353f3e48..98cadd170 100644 --- a/samples/matlab/catcomb.m +++ b/samples/matlab/catcomb.m @@ -1,5 +1,5 @@ % CATCOMB -- Catalytic combustion on platinum. -% +% % This script solves a catalytic combustion problem. A stagnation flow % is set up, with a gas inlet 10 cm from a platinum surface at 900 % K. The lean, premixed methane/air mixture enters at ~ 6 cm/s (0.06 @@ -27,15 +27,13 @@ p = oneatm; % pressure tinlet = 300.0; % inlet temperature tsurf = 900.0; % surface temperature mdot = 0.06; % kg/m^2/s - transport = 'Mix'; % transport model - % We will solve first for a hydrogen/air case to % use as the initial estimate for the methane/air case % composition of the inlet premixed gas for the hydrogen/air case -comp1 = 'H2:0.05, O2:0.21, N2:0.78, AR:0.01'; +comp1 = 'H2:0.05, O2:0.21, N2:0.78, AR:0.01'; % composition of the inlet premixed gas for the methane/air case comp2 = 'CH4:0.095, O2:0.21, N2:0.78, AR:0.01'; @@ -43,22 +41,18 @@ comp2 = 'CH4:0.095, O2:0.21, N2:0.78, AR:0.01'; % the initial grid, in meters. The inlet/surface separation is 10 cm. initial_grid = [0.0 0.02 0.04 0.06 0.08 0.1]; % m - % numerical parameters tol_ss = [1.0e-8 1.0e-14]; % [rtol atol] for steady-state problem tol_ts = [1.0e-4 1.0e-9]; % [rtol atol] for time stepping loglevel = 1; % amount of diagnostic output % (0 to 5) - + refine_grid = 1; % 1 to enable refinement, 0 to % disable - - -%%%%%%%%%%%%%%% end of parameter list %%%%%%%%%%%%%%%%%%%%%% - - +%%%%%%%%%%%%%%% end of parameter list %%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% % % This object will be used to evaluate all thermodynamic, kinetic, @@ -66,36 +60,32 @@ refine_grid = 1; % 1 to enable refinement, 0 to % % The gas phase will be taken from the definition of phase 'gas' in % input file 'ptcombust.cti,' which is a stripped-down version of -% GRI-Mech 3.0. +% GRI-Mech 3.0. gas = importPhase('ptcombust.cti','gas'); set(gas,'T',tinlet,'P',p,'X',comp1); - %%%%%%%%%%%%%%%% create the interface object %%%%%%%%%%%%%%%%%% % % This object will be used to evaluate all surface chemical production % rates. It will be created from the interface definition 'Pt_surf' % in input file 'ptcombust.cti,' which implements the reaction % mechanism of Deutschmann et al., 1995 for catalytic combustion on -% platinum. +% platinum. % surf_phase = importInterface('ptcombust.cti','Pt_surf',gas); setTemperature(surf_phase, tsurf); % integrate the coverage equations in time for 1 s, holding the gas % composition fixed to generate a good starting estimate for the -% coverages. +% coverages. advanceCoverages(surf_phase, 1.0); - % The two objects we just created are independent of the problem % type -- they are useful in zero-D simulations, 1-D simulations, % etc. Now we turn to creating the objects that are specifically % for 1-D simulations. These will be 'stacked' together to create % the complete simulation. - - %%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% % % The flow object is responsible for evaluating the 1D governing @@ -107,8 +97,6 @@ flow = AxisymmetricFlow(gas, 'flow'); % set some parameters for the flow set(flow, 'P', p, 'grid', initial_grid, 'tol', tol_ss, 'tol-time', tol_ts); - - %%%%%%%%%%%%%%% create the inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % The temperature, mass flux, and composition (relative molar) may be @@ -120,10 +108,8 @@ inlt = Inlet('inlet'); % set the inlet parameters. Start with comp1 (hydrogen/air) set(inlt, 'T', tinlet, 'MassFlux', mdot, 'X', comp1); - - %%%%%%%%%%%%%% create the surface %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % This object provides the surface boundary conditions for the flow % equations. By supplying object surface_phase as an argument, the % coverage equations for its surface species will be added to the @@ -133,7 +119,6 @@ set(inlt, 'T', tinlet, 'MassFlux', mdot, 'X', comp1); surf = Surface('surface', surf_phase); setTemperature(surf,tsurf); - %%%%%%%%%%%%% create the stack %%%%%%%%%%%% % % Once the component parts have been created, they can be assembled @@ -143,9 +128,9 @@ sim1D = Stack([inlt, flow, surf]); % set the initial profiles. setProfile(sim1D, 2, {'u', 'V', 'T'}, [0.0 1.0 % z/zmax - 0.06 0.0 % u - 0.0 0.0 % V - tinlet tsurf]); % T + 0.06 0.0 % u + 0.0 0.0 % V + tinlet tsurf]); % T names = speciesNames(gas); for k = 1:nSpecies(gas) y = massFraction(inlt, k); @@ -156,7 +141,6 @@ sim1D %setTimeStep(fl, 1.0e-5, [1, 3, 6, 12]); %setMaxJacAge(fl, 4, 5); - %%%%%%%%%%%%% solution %%%%%%%%%%%%%%%%%%%% % start with the energy equation on @@ -177,7 +161,7 @@ setCoverageEqs(surf, 'on'); for iter=1:6 mult = 10.0^(iter - 6); setMultiplier(surf_phase, mult); - setMultiplier(gas, mult); + setMultiplier(gas, mult); solve(sim1D, 1, refine_grid); end @@ -189,14 +173,13 @@ set(inlt,'X',comp2); setRefineCriteria(sim1D, 2, 100.0, 0.15, 0.2); % solve the problem for the final time -solve(sim1D, loglevel, refine_grid); +solve(sim1D, loglevel, refine_grid); % show the solution sim1D % save the solution -saveSoln(sim1D,'catcomb.xml','energy',['solution with energy' ... - ' equation']); +saveSoln(sim1D,'catcomb.xml','energy',['solution with energy equation']); %%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% writeStats(sim1D); @@ -204,7 +187,6 @@ elapsed = cputime - t0; e = sprintf('Elapsed CPU time: %10.4g',elapsed); disp(e); - %%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clf; @@ -222,16 +204,16 @@ plotSolution(sim1D, 'flow', 'CH4'); title('CH4 Mass Fraction'); subplot(3,3,5); plotSolution(sim1D, 'flow', 'O2'); -title('O2 Mass Fraction'); +title('O2 Mass Fraction'); subplot(3,3,6); plotSolution(sim1D, 'flow', 'CO'); title('CO Mass Fraction'); subplot(3,3,7); plotSolution(sim1D, 'flow', 'CO2'); -title('CO2 Mass Fraction'); +title('CO2 Mass Fraction'); subplot(3,3,8); plotSolution(sim1D, 'flow', 'H2O'); -title('H2O Mass Fraction'); +title('H2O Mass Fraction'); subplot(3,3,9); plotSolution(sim1D, 'flow', 'H2'); -title('H2 Mass Fraction'); +title('H2 Mass Fraction'); diff --git a/samples/matlab/diffflame.m b/samples/matlab/diffflame.m index 88b9d9dab..022b11e43 100644 --- a/samples/matlab/diffflame.m +++ b/samples/matlab/diffflame.m @@ -1,15 +1,13 @@ % DIFFFLAME - A non-premixed opposed-jet flame. % % - + help diffflame disp('press any key to begin the simulation'); pause - t0 = cputime; % record the starting time - % parameter values p = oneatm; % pressure tin = 300.0; % inlet temperature @@ -29,11 +27,10 @@ tol_ts = [1.0e-3 1.0e-9]; % [rtol atol] for time stepping loglevel = 1; % amount of diagnostic output (0 % to 5) - -refine_grid = 1; % 1 to enable refinement, 0 to - % disable - +refine_grid = 1; % 1 to enable refinement, 0 to + % disable + %%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% % % This object will be used to evaluate all thermodynamic, kinetic, @@ -44,8 +41,6 @@ gas = GRI30('Mix') % set its state to that of the fuel (arbitrary) set(gas,'T', tin, 'P', p, 'X', comp2); - - %%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% f = AxisymmetricFlow(gas,'flow'); @@ -53,8 +48,6 @@ f = AxisymmetricFlow(gas,'flow'); set(f, 'P', p, 'grid', initial_grid); set(f, 'tol', tol_ss, 'tol-time', tol_ts); - - %%%%%%%%%%%%%%% create the air inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % The temperature, mass flux, and composition (relative molar) may be @@ -63,21 +56,18 @@ set(f, 'tol', tol_ss, 'tol-time', tol_ts); inlet_o = Inlet('air_inlet'); set(inlet_o, 'T', tin, 'MassFlux', mdot_o, 'X', comp1); - - %%%%%%%%%%%%%% create the fuel inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % inlet_f = Inlet('fuel_inlet'); set(inlet_f, 'T', tin, 'MassFlux', mdot_f, 'X', comp2); - %%%%%%%%%%%%% create the flame object %%%%%%%%%%%% % % Once the component parts have been created, they can be assembled -% to create the flame object. Function npflame_init (in Cantera/1D) +% to create the flame object. Function npflame_init (in Cantera/1D) % sets up the initial guess for the solution using a Burke-Schumann -% flame. +% flame. % fl = npflame_init(gas, inlet_f, f, inlet_o, 'C2H6', 'O2', 3.5); @@ -88,7 +78,6 @@ fl = npflame_init(gas, inlet_f, f, inlet_o, 'C2H6', 'O2', 3.5); % solve with fixed temperature profile first solve(fl, loglevel, 0); %refine_grid); - %%%%%%%%%%%% enable the energy equation %%%%%%%%%%%%%%%%%%%%% % % The energy equation will now be solved to compute the @@ -99,9 +88,7 @@ solve(fl, loglevel, 0); %refine_grid); enableEnergy(f); setRefineCriteria(fl, 2, 200.0, 0.1, 0.2); solve(fl, loglevel, refine_grid); -saveSoln(fl,'c2h6.xml','energy',['solution with energy' ... - ' equation']); - +saveSoln(fl,'c2h6.xml','energy',['solution with energy equation']); %%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% writeStats(fl); @@ -109,7 +96,6 @@ elapsed = cputime - t0; e = sprintf('Elapsed CPU time: %10.4g',elapsed); disp(e); - %%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clf; @@ -131,4 +117,3 @@ title('Radial Velocity / Radius [s^-1]'); subplot(2,3,6); plotSolution(fl, 'flow', 'u'); title('Axial Velocity [m/s]'); - diff --git a/samples/matlab/equil.m b/samples/matlab/equil.m index 60b288437..7f5b26494 100644 --- a/samples/matlab/equil.m +++ b/samples/matlab/equil.m @@ -26,8 +26,7 @@ for i = 1:50 x(ich4,1) = phi(i); x(io2,1) = 2.0; x(in2,1) = 7.52; - set(gas,'Temperature',300.0,'Pressure',101325.0,'MoleFractions', ... - x); + set(gas,'Temperature',300.0,'Pressure',101325.0,'MoleFractions', x); equilibrate(gas,'HP'); tad(i) = temperature(gas); xeq(:,i) = moleFractions(gas); diff --git a/samples/matlab/flame.m b/samples/matlab/flame.m index 772c6f7df..097527248 100644 --- a/samples/matlab/flame.m +++ b/samples/matlab/flame.m @@ -38,7 +38,6 @@ elseif isInlet(right) flametype = 3; end - % create the container object f = Stack([left flow right]); @@ -65,14 +64,13 @@ end zz = z(flow); dz = zz(end) - zz(1); setProfile(f, 2, {'u', 'V'}, [0.0 1.0 - mdot0/rho0 -mdot1/rho0 - 0.0 0.0]); + mdot0/rho0 -mdot1/rho0 + 0.0 0.0]); setProfile(f, 2, 'T', [0.0 z1 1.0; t0 2000.0 t1]); for n = 1:nSpecies(gas) nm = speciesName(gas,n); - if strcmp(nm,'H') | strcmp(nm,'OH') | strcmp(nm,'O') | ... - strcmp(nm,'HO2') + if strcmp(nm,'H') | strcmp(nm,'OH') | strcmp(nm,'O') | strcmp(nm,'HO2') yint = 1.0*yeq(n); else yint = yeq(n); @@ -83,8 +81,8 @@ for n = 1:nSpecies(gas) y1 = yeq(n); end setProfile(f, 2, nm, [0 z1 1 - massFraction(left, n) yint y1]); + massFraction(left, n) yint y1]); end -% set minimal grid refinement criteria -setRefineCriteria(f, 2, 10.0, 0.8, 0.8); \ No newline at end of file +% set minimal grid refinement criteria +setRefineCriteria(f, 2, 10.0, 0.8, 0.8); diff --git a/samples/matlab/flame1.m b/samples/matlab/flame1.m index 83012af7b..a8fbe1db2 100644 --- a/samples/matlab/flame1.m +++ b/samples/matlab/flame1.m @@ -1,7 +1,7 @@ % FLAME1 - A burner-stabilized flat flame % % This script simulates a burner-stablized lean hydrogen-oxygen flame -% at low pressure. +% at low pressure. help flame1; %disp('press any key to begin the simulation'); @@ -9,7 +9,6 @@ help flame1; t0 = cputime; % record the starting time - % parameter values p = 0.05*oneatm; % pressure tburner = 373.0; % burner temperature @@ -19,7 +18,7 @@ rxnmech = 'h2o2.cti'; % reaction mechanism file comp = 'H2:1.8, O2:1, AR:7'; % premixed gas composition initial_grid = [0.0 0.02 0.04 0.06 0.08 0.1 ... - 0.15 0.2 0.4 0.49 0.5]; % m + 0.15 0.2 0.4 0.49 0.5]; % m tol_ss = [1.0e-5 1.0e-13]; % [rtol atol] for steady-state % problem @@ -27,11 +26,11 @@ tol_ts = [1.0e-4 1.0e-9]; % [rtol atol] for time stepping loglevel = 1; % amount of diagnostic output (0 % to 5) - + refine_grid = 1; % 1 to enable refinement, 0 to - % disable -max_jacobian_age = [5, 10]; - + % disable +max_jacobian_age = [5, 10]; + %%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% % % This object will be used to evaluate all thermodynamic, kinetic, @@ -42,28 +41,22 @@ gas = IdealGasMix(rxnmech); % set its state to that of the unburned gas at the burner set(gas,'T', tburner, 'P', p, 'X', comp); - - %%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% f = AxisymmetricFlow(gas,'flow'); set(f, 'P', p, 'grid', initial_grid); set(f, 'tol', tol_ss, 'tol-time', tol_ts); - - %%%%%%%%%%%%%%% create the burner %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% The burner is an Inlet object. The temperature, mass flux, +% The burner is an Inlet object. The temperature, mass flux, % and composition (relative molar) may be specified. % burner = Inlet('burner'); set(burner, 'T', tburner, 'MassFlux', mdot, 'X', comp); - - %%%%%%%%%%%%%% create the outlet %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % The type of flame is determined by the object that terminates % the domain. An Outlet object imposes zero gradient boundary % conditions for the temperature and mass fractions, and zero @@ -71,7 +64,6 @@ set(burner, 'T', tburner, 'MassFlux', mdot, 'X', comp); % s = Outlet('out'); - %%%%%%%%%%%%% create the flame object %%%%%%%%%%%% % % Once the component parts have been created, they can be assembled @@ -96,9 +88,7 @@ solve(fl, loglevel, refine_grid); enableEnergy(f); setRefineCriteria(fl, 2, 200.0, 0.05, 0.1); solve(fl, 1, 1); -saveSoln(fl,'h2fl.xml','energy',['solution with energy' ... - ' equation']); - +saveSoln(fl,'h2fl.xml','energy',['solution with energy equation']); %%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% writeStats(fl); @@ -106,7 +96,6 @@ elapsed = cputime - t0; e = sprintf('Elapsed CPU time: %10.4g',elapsed); disp(e); - %%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clf; @@ -121,6 +110,4 @@ plotSolution(fl, 'flow', 'H2O'); title('H2O Mass Fraction'); subplot(2,2,4); plotSolution(fl, 'flow', 'O2'); -title('O2 Mass Fraction'); - - +title('O2 Mass Fraction'); diff --git a/samples/matlab/flame2.m b/samples/matlab/flame2.m index fa03759c2..cf0fbffaf 100644 --- a/samples/matlab/flame2.m +++ b/samples/matlab/flame2.m @@ -6,7 +6,6 @@ t0 = cputime; % record the starting time - % parameter values p = oneatm; % pressure tin = 300.0; % inlet temperature @@ -26,11 +25,10 @@ tol_ts = [1.0e-4 1.0e-13]; % [rtol atol] for time stepping loglevel = 1; % amount of diagnostic output (0 % to 5) - -refine_grid = 1; % 1 to enable refinement, 0 to - % disable - +refine_grid = 1; % 1 to enable refinement, 0 to + % disable + %%%%%%%%%%%%%%%% create the gas object %%%%%%%%%%%%%%%%%%%%%%%% % % This object will be used to evaluate all thermodynamic, kinetic, @@ -41,8 +39,6 @@ gas = GRI30('Mix'); %IdealGasMix(rxnmech, transport); % set its state to that of the fuel (arbitrary) set(gas,'T', tin, 'P', p, 'X', comp2); - - %%%%%%%%%%%%%%%% create the flow object %%%%%%%%%%%%%%%%%%%%%%% f = AxisymmetricFlow(gas,'flow'); @@ -50,8 +46,6 @@ f = AxisymmetricFlow(gas,'flow'); set(f, 'P', p, 'grid', initial_grid); set(f, 'tol', tol_ss, 'tol-time', tol_ts); - - %%%%%%%%%%%%%%% create the air inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % The temperature, mass flux, and composition (relative molar) may be @@ -60,15 +54,10 @@ set(f, 'tol', tol_ss, 'tol-time', tol_ts); inlet_o = Inlet('air_inlet'); set(inlet_o, 'T', tin, 'MassFlux', mdot_o, 'X', comp1); - - %%%%%%%%%%%%%% create the fuel inlet %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% inlet_f = Inlet('fuel_inlet'); set(inlet_f, 'T', tin, 'MassFlux', mdot_f, 'X', comp2); - %%%%%%%%%%%%% create the flame object %%%%%%%%%%%% % % Once the component parts have been created, they can be assembled @@ -83,7 +72,6 @@ fl = flame(gas, inlet_o, f, inlet_f); % solve with fixed temperature profile first solve(fl, loglevel, refine_grid); - %%%%%%%%%%%% enable the energy equation %%%%%%%%%%%%%%%%%%%%% % % The energy equation will now be solved to compute the @@ -94,9 +82,7 @@ solve(fl, loglevel, refine_grid); enableEnergy(f); setRefineCriteria(fl, 2, 200.0, 0.1, 0.1); solve(fl, loglevel, refine_grid); -saveSoln(fl,'c2h6.xml','energy',['solution with energy' ... - ' equation']); - +saveSoln(fl,'c2h6.xml','energy',['solution with energy equation']); %%%%%%%%%% show statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% writeStats(fl); @@ -104,7 +90,6 @@ elapsed = cputime - t0; e = sprintf('Elapsed CPU time: %10.4g',elapsed); disp(e); - %%%%%%%%%% make plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure(1); diff --git a/samples/matlab/ignite.m b/samples/matlab/ignite.m index a992ef8b1..5eec2ac22 100644 --- a/samples/matlab/ignite.m +++ b/samples/matlab/ignite.m @@ -1,6 +1,6 @@ function plotdata = ignite(g) % IGNITE Zero-dimensional kinetics: adiabatic, constant pressure. -% +% % This example solves the same problem as 'reactor1,' but does % it using on of MATLAB's ODE integrators, rather than using the % Cantera Reactor class. @@ -38,9 +38,8 @@ plotdata = output(out,gas); % boundary conditions - the rate of change of volume, the heat % flux, and the area. - % Rate of change of volume. Any arbirtrary function may be implemented. -% Input arguments: +% Input arguments: % t time % vol volume % gas ideal gas object @@ -50,11 +49,10 @@ function v = vdot(t, vol, gas) v = 1.e11 * (pressure(gas) - 101325.0); % holds pressure very % close to 1 atm -% heat flux (W/m^2). +% heat flux (W/m^2). function q = heatflux(t, gas) q = 0.0; % adiabatic - % surface area (m^2). Used only to compute heat transfer. function a = area(t,vol) a = 1.0; @@ -64,7 +62,7 @@ a = 1.0; % Since the solution variables used by the 'reactor' function are % not necessarily those desired for output, this function is called % after the integration is complete to generate the desired -% outputs. +% outputs. function pv = output(s, gas) times = s.x; @@ -82,7 +80,7 @@ for j = 1:n v_mass = ss(2)/mass; setMassFractions(gas, y); setState_UV(gas, [u_mass v_mass]); - + pv(1,j) = times(j); pv(2,j) = temperature(gas); pv(3,j) = density(gas); diff --git a/samples/matlab/ignite_hp.m b/samples/matlab/ignite_hp.m index cd7cabe0b..ca9131258 100644 --- a/samples/matlab/ignite_hp.m +++ b/samples/matlab/ignite_hp.m @@ -1,6 +1,6 @@ function ignite_hp(gas) % IGNITE_HP Solves the same ignition problem as 'ignite', but uses function -% conhp instead of reactor. +% conhp instead of reactor. % help ignite_hp @@ -34,5 +34,5 @@ if nargout == 0 plot(out.x,out.y(1+ioh,:)); xlabel('time'); ylabel('Mass Fraction'); - title('OH Mass Fraction'); + title('OH Mass Fraction'); end diff --git a/samples/matlab/ignite_uv.m b/samples/matlab/ignite_uv.m index f61b272e0..736ebd618 100644 --- a/samples/matlab/ignite_uv.m +++ b/samples/matlab/ignite_uv.m @@ -33,6 +33,5 @@ if nargout == 0 plot(out.x,out.y(1+ioh,:)); xlabel('time'); ylabel('Mass Fraction'); - title('OH Mass Fraction'); - + title('OH Mass Fraction'); end diff --git a/samples/matlab/isentropic.m b/samples/matlab/isentropic.m index f74bcdbf7..55d98742a 100644 --- a/samples/matlab/isentropic.m +++ b/samples/matlab/isentropic.m @@ -28,17 +28,17 @@ amin = 1.e14; % compute values for a range of pressure ratios for r = 0.005:0.0025:0.995 p = p0*r; - + % set the state using (p,s0) set(gas,'P',p,'S',s0); - + h = enthalpy_mass(gas); rho = density(gas); - + v2 = 2.0*(h0 - h); % h + V^2/2 = h0 - v = sqrt(v2); + v = sqrt(v2); a(i) = mdot/(rho*v); % rho*v*A = constant - + if a(i) < amin amin = a(i); end diff --git a/samples/matlab/periodic_cstr.m b/samples/matlab/periodic_cstr.m index bffbf45c0..323ad1c9a 100644 --- a/samples/matlab/periodic_cstr.m +++ b/samples/matlab/periodic_cstr.m @@ -34,14 +34,12 @@ OneAtm = 1.01325e5; set(gas,'T', 300.0, 'P', p, 'X', 'H2:2, O2:1'); - % create an upstream reservoir that will supply the reactor. The % temperature, pressure, and composition of the upstream reservoir are % set to those of the 'gas' object at the time the reservoir is % created. upstream = Reservoir(gas); - % Now set the gas to the initial temperature of the reactor, and create % the reactor object. set(gas, 'T', t, 'P', p); @@ -51,13 +49,11 @@ cstr = IdealGasReactor(gas); % fixed, so the initial volume is the volume at all later times. setInitialVolume(cstr, 10.0*1.0e-6); - % We need to have heat loss to see the oscillations. Create a % reservoir to represent the environment, and initialize its % temperature to the reactor temperature. env = Reservoir(gas); - % Create a heat-conducting wall between the reactor and the % environment. Set its area, and its overall heat transfer % coefficient. Larger U causes the reactor to be closer to isothermal. @@ -68,7 +64,6 @@ install(w, cstr, env); setArea(w, 1.0); setHeatTransferCoeff(w, 0.02); - % Connect the upstream reservoir to the reactor with a mass flow % controller (constant mdot). Set the mass flow rate to 1.25 sccm. sccm = 1.25; @@ -78,11 +73,9 @@ mfc = MassFlowController; install(mfc, upstream, cstr); setMassFlowRate(mfc, mdot); - % now create a downstream reservoir to exhaust into. downstream = Reservoir(gas); - % connect the reactor to the downstream reservoir with a valve, and % set the coefficient sufficiently large to keep the reactor pressure % close to the downstream pressure of 60 Torr. @@ -104,8 +97,8 @@ while tme < 300.0 advance(network, tme); tm(n) = tme; y(1,n) = massFraction(cstr,'H2'); - y(2,n) = massFraction(cstr,'O2'); - y(3,n) = massFraction(cstr,'H2O'); + y(2,n) = massFraction(cstr,'O2'); + y(3,n) = massFraction(cstr,'H2O'); end clf figure(1) diff --git a/samples/matlab/prandtl1.m b/samples/matlab/prandtl1.m index e7b06493a..5f19ae6bc 100644 --- a/samples/matlab/prandtl1.m +++ b/samples/matlab/prandtl1.m @@ -34,7 +34,7 @@ for i = 1:31 t(i) = minT + dT*(i-1); for j = 1:31 xo2(j) = 0.99*(j-1)/30.0; - x = zeros(nSpecies(gas),1); + x = zeros(nSpecies(gas),1); x(io2) = xo2(j); x(ih2) = 1.0 - xo2(j); set(gas,'T',t(i),'P',oneatm,'X',x); diff --git a/samples/matlab/prandtl2.m b/samples/matlab/prandtl2.m index a9b417316..8cf1fae2a 100644 --- a/samples/matlab/prandtl2.m +++ b/samples/matlab/prandtl2.m @@ -33,16 +33,16 @@ for i = 1:31 t(i) = minT + dT*(i-1); for j = 1:31 xo2(j) = 0.99*(j-1)/30.0; - x = zeros(nSpecies(gas),1); + x = zeros(nSpecies(gas),1); x(io2) = xo2(j); x(ih2) = 1.0 - xo2(j); set(gas,'T',t(i),'P',oneatm,'X',x); equilibrate(gas,'TP'); visc(i,j) = viscosity(gas); - lambda(i,j) = thermalConductivity(gas); + lambda(i,j) = thermalConductivity(gas); pr(i,j) = visc(i,j)*cp_mass(gas)/lambda(i,j); x = moleFractions(gas); - xh2(i,j) = x(ih2); + xh2(i,j) = x(ih2); end end disp(['CPU time = ' num2str(cputime - t0)]); @@ -73,4 +73,3 @@ surf(xo2,t,lambda); xlabel('Elemental O/(O+H)'); ylabel('Temperature (K)'); zlabel('Thermal Conductivity'); - diff --git a/samples/matlab/rankine.m b/samples/matlab/rankine.m index b68951790..0a76b64d3 100644 --- a/samples/matlab/rankine.m +++ b/samples/matlab/rankine.m @@ -1,10 +1,9 @@ -function [work, efficiency] = rankine(t1, p2, eta_pump, ... - eta_turbine) +function [work, efficiency] = rankine(t1, p2, eta_pump, eta_turbine) % % RANKINE % % This example computes the efficiency of a simple vapor power -% cycle. +% cycle. % help rankine @@ -38,11 +37,10 @@ x4 = vaporFraction(w); efficiency = (work - pump_work)/heat_added - function w = pump(fluid, pfinal, eta) % PUMP - Adiabatically pump a fluid to pressure pfinal, using a pump % with isentropic efficiency eta. -% +% h0 = enthalpy_mass(fluid); s0 = entropy_mass(fluid); set(fluid, 'S', s0, 'P', pfinal); @@ -67,5 +65,3 @@ actual_work = isentropic_work * eta; h1 = h0 - actual_work; set(fluid, 'H',h1, 'P',pfinal); w = actual_work; - - diff --git a/samples/matlab/reactor1.m b/samples/matlab/reactor1.m index 90b61994e..e5f283f46 100644 --- a/samples/matlab/reactor1.m +++ b/samples/matlab/reactor1.m @@ -1,7 +1,7 @@ function reactor1(g) % REACTOR1 Zero-dimensional kinetics: adiabatic, constant pressure. % -% >>>> For a simpler way to carry out a constant-pressure simulation, +% >>>> For a simpler way to carry out a constant-pressure simulation, % see example reactor3.m <<<<< % % This example illustrates how to use class 'Reactor' for @@ -54,7 +54,7 @@ for n = 1:100 t = t + dt; advance(network, t); tim(n) = time(network); - temp(n) = temperature(r); + temp(n) = temperature(r); x(n,1:3) = moleFraction(gas,{'OH','H','H2'}); end disp(['CPU time = ' num2str(cputime - t0)]); diff --git a/samples/matlab/reactor2.m b/samples/matlab/reactor2.m index a0627e9b5..5ab19a617 100644 --- a/samples/matlab/reactor2.m +++ b/samples/matlab/reactor2.m @@ -1,6 +1,6 @@ function reactor2(g) % REACTOR2 Zero-dimensional kinetics: adiabatic, constant volume. -% +% % This example illustrates how to use class 'Reactor' for % zero-dimensional kinetics simulations. Here the parameters are % set so that the reactor is adiabatic and constant volume. @@ -32,7 +32,7 @@ for n = 1:100 t = t + dt; advance(network, t); tim(n) = time(network); - temp(n) = temperature(r); + temp(n) = temperature(r); x(n,1:3) = moleFraction(gas,{'OH','H','H2'}); end disp(['CPU time = ' num2str(cputime - t0)]); diff --git a/samples/matlab/surfreactor.m b/samples/matlab/surfreactor.m index 33018eeac..9a306b73e 100644 --- a/samples/matlab/surfreactor.m +++ b/samples/matlab/surfreactor.m @@ -1,8 +1,8 @@ % SURFREACTOR Zero-dimensional reactor with surface chemistry -% +% % This example illustrates how to use class 'Reactor' for % zero-dimensional simulations including both homogeneous and -% heterogeneous chemistry. +% heterogeneous chemistry. help surfreactor @@ -60,9 +60,9 @@ for n = 1:100 t = t + dt; advance(network, t); tim(n) = t; - temp(n) = temperature(r); + temp(n) = temperature(r); pres(n) = pressure(r) - p0; - cov(n,:) = coverages(surf)'; + cov(n,:) = coverages(surf)'; x(n,:) = moleFraction(gas,names); end disp(['CPU time = ' num2str(cputime - t0)]); diff --git a/samples/matlab/transport1.m b/samples/matlab/transport1.m index 5b6d0646b..ce5e53ad9 100644 --- a/samples/matlab/transport1.m +++ b/samples/matlab/transport1.m @@ -25,7 +25,7 @@ for i = 1:31 t(i) = 300.0 + 100.0*i; for j = 1:31 xo2(j) = (j-1)/30.0; - x = zeros(nSpecies(gas),1); + x = zeros(nSpecies(gas),1); x(io2) = xo2(j); x(ih2) = 1.0 - xo2(j); set(gas,'T',t(i),'P',oneatm,'X',x); @@ -41,4 +41,3 @@ surf(xo2,t,pr); xlabel('Elemental oxygen mole fraction'); ylabel('Temperature (K)'); zlabel('Prandtl Number'); - diff --git a/samples/matlab/tut1.m b/samples/matlab/tut1.m index a9011ec7f..cbc71ad71 100644 --- a/samples/matlab/tut1.m +++ b/samples/matlab/tut1.m @@ -1,5 +1,5 @@ % Tutorial 1: Getting started -% +% % Topics: % - creating a gas mixture % - setting the state @@ -17,7 +17,7 @@ gas1 = GRI30 % pressure 101325 Pa % density 0.081889 kg/m^3 % mean mol. weight 2.01588 amu -% +% % 1 kg 1 kmol % ----------- ------------ % enthalpy 26470.1 5.336e+04 J @@ -26,8 +26,8 @@ gas1 = GRI30 % Gibbs function -1.94477e+07 -3.92e+07 J % heat capacity c_p 14311.8 2.885e+04 J/K % heat capacity c_v 10187.3 2.054e+04 J/K -% -% X Y Chem. Pot. / RT +% +% X Y Chem. Pot. / RT % ------------- ------------ ------------ % H2 1 1 -15.7173 % [ +52 minor] 0 0 @@ -66,7 +66,7 @@ setTemperature(gas1, 1200) % Notice in the summary of properties that MATLAB prints after this % command is executed that the temperature has been changed as % requested, but the pressure has changed too. The density and -% composition have not. +% composition have not. % % When setting properties individually, some convention needs to be % adopted to specify which other properties are held constant. This is @@ -83,7 +83,7 @@ setTemperature(gas1, 1200) % b) Setting the pressure is done holding temperature and % composition fixed. (The density changes.) -% +% % c) Setting the composition is done holding temperature % and density fixed. (The pressure changes). % @@ -104,7 +104,7 @@ set(gas1, 'Temperature', 900.0, 'Pressure', 1.e5); % call to 'set'. For example, the following sets the mole fractions % too: set(gas1, 'Temperature', 900.0, 'Pressure', 1.e5, 'MoleFractions', ... - 'CH4:1,O2:2,N2:7.52'); + 'CH4:1,O2:2,N2:7.52'); % The 'set' method also accepts abbreviated property names: @@ -116,7 +116,7 @@ set(gas1,'T',900.0,'P',1.e5,'X','CH4:1,O2:2,N2:7.52') % pressure 100000 Pa % density 0.369279 kg/m^3 % mean mol. weight 27.6332 amu -% +% % 1 kg 1 kmol % ----------- ------------ % enthalpy 455660 1.259e+07 J @@ -125,8 +125,8 @@ set(gas1,'T',900.0,'P',1.e5,'X','CH4:1,O2:2,N2:7.52') % Gibbs function -7.22072e+06 -1.995e+08 J % heat capacity c_p 1304.4 3.604e+04 J/K % heat capacity c_v 1003.52 2.773e+04 J/K -% -% X Y Chem. Pot. / RT +% +% X Y Chem. Pot. / RT % ------------- ------------ ------------ % O2 0.190114 0.220149 -27.9596 % CH4 0.095057 0.0551863 -37.0813 @@ -137,12 +137,11 @@ set(gas1,'T',900.0,'P',1.e5,'X','CH4:1,O2:2,N2:7.52') % can't be set individually. The following property pairs may be % set: (Enthalpy, Pressure), (IntEnergy, Volume), (Entropy, % Volume), (Entropy, Pressure). In each case, the values of the -% extensive properties must be entered *per unit mass*. +% extensive properties must be entered *per unit mass*. % Setting the enthalpy and pressure: set(gas1, 'Enthalpy', 2*enthalpy_mass(gas1), 'Pressure', 2*oneatm); - % The composition above was specified using a string. The format is a % comma-separated list of : % pairs. The mole numbers will be normalized to produce the mole diff --git a/samples/matlab/tut2.m b/samples/matlab/tut2.m index 1d4607197..cf656939f 100644 --- a/samples/matlab/tut2.m +++ b/samples/matlab/tut2.m @@ -104,7 +104,6 @@ diamonnd_surf2 = importInterface('diamond.xml','diamond_100',... gas2, diamond); - % Converting CK-format files % -------------------------- @@ -121,7 +120,7 @@ diamonnd_surf2 = importInterface('diamond.xml','diamond_100',... % % Here's an example of how to use it: % -% ck2cti -i mech.inp -t therm.dat -tr tran.dat -id mymech +% ck2cti -i mech.inp -t therm.dat -tr tran.dat -id mymech % clear all diff --git a/samples/matlab/tut3.m b/samples/matlab/tut3.m index 0a765bd06..2aee42c04 100644 --- a/samples/matlab/tut3.m +++ b/samples/matlab/tut3.m @@ -3,7 +3,7 @@ help tut3 % Suppose you have created a Cantera object and want to know what -% methods are available for it, and get help on using the methods. +% methods are available for it, and get help on using the methods. g = GRI30 diff --git a/samples/matlab/tut4.m b/samples/matlab/tut4.m index 51dc02409..48e922e31 100644 --- a/samples/matlab/tut4.m +++ b/samples/matlab/tut4.m @@ -75,7 +75,7 @@ end % does a few other things to generate a good starting guess and to % produce a reasonably robust algorithm. If you want to know more % about the details, look at the on-line documented source code of -% Cantera C++ class 'ChemEquil' at http://www.cantera.org. +% Cantera C++ class 'ChemEquil' at http://www.cantera.org. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all diff --git a/samples/matlab/tut5.m b/samples/matlab/tut5.m index 48bd4c9e0..4c0239b92 100644 --- a/samples/matlab/tut5.m +++ b/samples/matlab/tut5.m @@ -19,10 +19,10 @@ set(g,'T',1500,'P',oneatm,'X',ones(nSpecies(g),1)); % 1) Stoichiometric coefficients -nu_r = stoich_r(g) % reactant stoichiometric coefficient mstix -nu_p = stoich_p(g) % product stoichiometric coefficient mstix +nu_r = stoich_r(g) % reactant stoichiometric coefficient mstix +nu_p = stoich_p(g) % product stoichiometric coefficient mstix nu_net = stoich_net(g) % net (product - reactant) stoichiometric - % coefficient mstix + % coefficient mstix % For any of these, the (k,i) matrix element is the stoichiometric % coefficient of species k in reaction i. Since these coefficient @@ -64,7 +64,7 @@ legend('creation','destruction','net'); % For comparison, the production rates may also be computed % directly from the rates of progress and stoichiometric -% coefficients. +% coefficients. cdot2 = nu_p*qf + nu_r*qr; creation = [cdot, cdot2, cdot - cdot2] @@ -75,15 +75,12 @@ destruction = [ddot, ddot2, ddot - ddot2] wdot2 = nu_net * qn; net = [wdot, wdot2, wdot - wdot2] - % 4) Reaction equations e8 = reactionEqn(g,8) % equation for reaction 8 e1_10 = reactionEqn(g,1:10) % equation for rxns 1 - 10 eqs = reactionEqn(g) % all equations - - % 5) Equilibrium constants % The equilibrium constants are computed in concentration units, @@ -94,10 +91,8 @@ for i = 1:nReactions(g) disp(sprintf('%50s %13.5g', eqs{i}, kc(i))) end - - % 6) Multipliers - + % For each reaction, a multiplier may be specified that is applied % to the forward rate coefficient. By default, the multiplier is % 1.0 for all reactions. diff --git a/samples/matlab/tut6.m b/samples/matlab/tut6.m index c48f9819e..ea3b61950 100644 --- a/samples/matlab/tut6.m +++ b/samples/matlab/tut6.m @@ -34,7 +34,6 @@ g1 = GRI30('Multi') g2 = GRI30('Mix') - % Both models use a mixture-averaged formulation for the viscosity. visc = [viscosity(g1), viscosity(g2)] @@ -52,7 +51,7 @@ dmix2 = mixDiffCoeffs(g1) dmix1 = mixDiffCoeffs(g2) % Multicomponent diffusion coefficients. These are only implemented -% if the multicomponent model is used. +% if the multicomponent model is used. dmulti = multiDiffCoeffs(g1) % Thermal diffusion coefficients. These are only implemented with the @@ -66,7 +65,7 @@ dt = thermalDiffCoeffs(g1) % Note that there are no singularities for pure gases. This is % because a very small positive value is added to all mole -% fractions for the purpose of computing transport properties. +% fractions for the purpose of computing transport properties. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all diff --git a/samples/matlab/tut7.m b/samples/matlab/tut7.m index 1c44e537d..b2a7440e6 100644 --- a/samples/matlab/tut7.m +++ b/samples/matlab/tut7.m @@ -3,21 +3,17 @@ help tut7 % A variety of thermodynamic property methods are provided. - gas = air set(gas,'T',800,'P',oneatm) - % temperature, pressure, density T = temperature(gas) P = pressure(gas) rho = density(gas) n = molarDensity(gas) - % species non-dimensional properties -hrt = enthalpies_RT(gas) % vector of h_k/RT - +hrt = enthalpies_RT(gas) % vector of h_k/RT % mixture properties per mole hmole = enthalpy_mole(gas) @@ -25,7 +21,6 @@ umole = intEnergy_mole(gas) smole = entropy_mole(gas) gmole = gibbs_mole(gas) - % mixture properties per unit mass hmass = enthalpy_mass(gas) umass = intEnergy_mass(gas) @@ -34,6 +29,5 @@ gmass = gibbs_mass(gas) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - clear all cleanup \ No newline at end of file diff --git a/src/base/application.cpp b/src/base/application.cpp index 7b8123392..394024b88 100644 --- a/src/base/application.cpp +++ b/src/base/application.cpp @@ -312,7 +312,6 @@ void Application::close_XML_File(const std::string& file) long int Application::readStringRegistryKey(const std::string& keyName, const std::string& valueName, std::string& value, const std::string& defaultValue) { - HKEY key; long open_error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName.c_str(), 0, KEY_READ, &key); if (open_error != ERROR_SUCCESS) { @@ -405,7 +404,6 @@ void Application::setDefaultDirectories() // Under Windows, the Cantera setup utility records the installation // directory in the registry. Data files are stored in the 'data' // subdirectory of the main installation directory. - std::string installDir; readStringRegistryKey("SOFTWARE\\Cantera\\Cantera " CANTERA_SHORT_VERSION, "InstallDir", installDir, ""); @@ -426,9 +424,7 @@ void Application::setDefaultDirectories() #endif #ifdef DARWIN - // // add a default data location for Mac OS X - // dirs.push_back("/Applications/Cantera/data"); #endif diff --git a/src/base/application.h b/src/base/application.h index 9a2ac1524..a7c0f36b3 100644 --- a/src/base/application.h +++ b/src/base/application.h @@ -186,7 +186,6 @@ protected: } ; #endif - protected: //! Constructor for class sets up the initial conditions //! Protected ctor access thru static member function Instance diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index 244aad36d..7b034a46c 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -322,7 +322,6 @@ size_t getFloatArray(const XML_Node& node, std::vector & v, v.clear(); doublereal vmin = Undef, vmax = Undef; - doublereal funit = 1.0; /* * Get the attributes field, units, from the XML node diff --git a/src/base/units.h b/src/base/units.h index 4abda07f8..d558d42ee 100644 --- a/src/base/units.h +++ b/src/base/units.h @@ -70,7 +70,6 @@ public: * @param units_ String containing the units description */ doublereal toSI(const std::string& units_) { - // if dimensionless, return 1.0 if (units_ == "") { return 1.0; @@ -82,7 +81,6 @@ public: char action = '-'; while (true) { - // get token consisting of all characters up to the next // dash, slash, or the end of the string k = u.find_first_of("/-"); @@ -163,7 +161,6 @@ private: //! Units class constructor, containing the default mappings between //! strings and units. Unit() { - // unity m_u["1"] = 1.0; diff --git a/src/base/xml.cpp b/src/base/xml.cpp index e1c3494b6..f6930162c 100644 --- a/src/base/xml.cpp +++ b/src/base/xml.cpp @@ -394,7 +394,6 @@ void XML_Node::clear() m_iscomment = false; m_linenum = 0; - } void XML_Node::addComment(const std::string& comment) @@ -670,7 +669,6 @@ XML_Node* XML_Node::findNameIDIndex(const std::string& nameTarget, } } } - return scResult; } diff --git a/src/clib/ctfunc.cpp b/src/clib/ctfunc.cpp index 4c6bf919b..f85ddf8ba 100644 --- a/src/clib/ctfunc.cpp +++ b/src/clib/ctfunc.cpp @@ -92,7 +92,6 @@ extern "C" { } } - int func_del(int i) { try { @@ -162,5 +161,4 @@ extern "C" { return handleAllExceptions(-1, ERR); } } - } diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index c2c5f76fd..a50c866e4 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -468,7 +468,6 @@ extern "C" { } } - //------------------- Sim1D -------------------------------------- int sim1D_new(size_t nd, int* domains) diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index 9c72d9967..290023e65 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -209,7 +209,6 @@ extern "C" { } } - // reactor networks int reactornet_new() @@ -454,10 +453,8 @@ extern "C" { } } - ///////////// Walls /////////////////////// - int wall_new(int type) { try { diff --git a/src/clib/ctxml.cpp b/src/clib/ctxml.cpp index 3b2227fba..16a0231e6 100644 --- a/src/clib/ctxml.cpp +++ b/src/clib/ctxml.cpp @@ -296,5 +296,4 @@ extern "C" { } return 0; } - } diff --git a/src/clib/ctxml.h b/src/clib/ctxml.h index 19779a92c..b6370e1c6 100644 --- a/src/clib/ctxml.h +++ b/src/clib/ctxml.h @@ -38,4 +38,3 @@ extern "C" { } #endif - diff --git a/src/equil/BasisOptimize.cpp b/src/equil/BasisOptimize.cpp index 5e6f53ab2..b31ef5898 100644 --- a/src/equil/BasisOptimize.cpp +++ b/src/equil/BasisOptimize.cpp @@ -417,7 +417,6 @@ void ElemRearrange(size_t nComponents, const vector_fp& elementAbundances, std::vector& orderVectorElements) { size_t j, k, l, i, jl, ml, jr, ielem, jj, kk=0; - size_t nelements = mphase->nElements(); std::string ename; /* diff --git a/src/equil/ChemEquil.cpp b/src/equil/ChemEquil.cpp index 87d557f3b..a35195f15 100644 --- a/src/equil/ChemEquil.cpp +++ b/src/equil/ChemEquil.cpp @@ -16,7 +16,6 @@ using namespace std; #include - namespace Cantera { int ChemEquil_print_lvl = 0; @@ -68,7 +67,6 @@ void ChemEquil::initialize(thermo_t& s) { // store a pointer to s and some of its properties locally. m_phase = &s; - m_p0 = s.refPressure(); m_kk = s.nSpecies(); m_mm = s.nElements(); @@ -107,7 +105,6 @@ void ChemEquil::initialize(thermo_t& s) // represent positive ions, where the 'element' is an // electron if (na < 0.0) { - // if negative atom numbers have already been specified // for some element other than this one, throw // an exception @@ -161,7 +158,6 @@ void ChemEquil::setToEquilState(thermo_t& s, void ChemEquil::update(const thermo_t& s) { - // get the mole fractions, temperature, and density s.getMoleFractions(DATA_PTR(m_molefractions)); m_temp = s.temperature(); @@ -352,10 +348,8 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, { doublereal xval, yval, tmp; int fail = 0; - bool tempFixed = true; int XY = _equilflag(XYstr); - vector_fp state; s.saveState(state); @@ -504,7 +498,6 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, // loop up to 5 times for (int it = 0; it < 10; it++) { - // set the composition and get p1 setInitialMoles(s, elMolesGoal, loglevel - 1); pval = m_p1->value(s); @@ -546,7 +539,6 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, } } - setInitialMoles(s, elMolesGoal,loglevel); /* @@ -580,7 +572,6 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, estimateElementPotentials(s, x, elMolesGoal); } - /* * Do a better estimate of the element potentials. * We have found that the current estimate may not be good @@ -627,7 +618,6 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, vector_fp oldx(nvar, 0.0); // old solution vector_fp oldresid(nvar, 0.0); doublereal f, oldf; - doublereal fctr = 1.0, newval; for (int iter = 0; iter < options.maxIterations; iter++) @@ -918,11 +908,9 @@ void ChemEquil::equilJacobian(thermo_t& s, vector_fp& x, rdx = 1.0/dx; // calculate perturbed residual - equilResidual(s, x, elmols, r1, xval, yval, loglevel-1); // compute nth column of Jacobian - for (m = 0; m < x.size(); m++) { jac(m, n) = (r1[m] - r0[m])*rdx; } @@ -989,7 +977,6 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, vector_fp n_i(m_kk,0.0); vector_fp n_i_calc(m_kk,0.0); vector_fp actCoeff(m_kk, 1.0); - vector_fp Xmol_i_calc(m_kk,0.0); double beta = 1.0; @@ -1008,7 +995,6 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, */ s.getGibbs_RT(DATA_PTR(m_muSS_RT)); - vector_fp eMolesCalc(m_mm, 0.0); vector_fp eMolesFix(m_mm, 0.0); double elMolesTotal = 0.0; @@ -1027,7 +1013,6 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, } } - double n_t = 0.0; double sum2 = 0.0; double nAtomsMax = 1.0; @@ -1122,7 +1107,6 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, } double nCutoff; - bool normalStep = true; /* * Decide if we are to do a normal step or a modified step @@ -1300,7 +1284,6 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, } } - resid[m_mm] = n_t - n_t_calc; if (DEBUG_MODE_ENABLED && ChemEquil_print_lvl > 0) { @@ -1509,7 +1492,6 @@ void ChemEquil::adjustEloc(thermo_t& s, vector_fp& elMolesGoal) } s.getMoleFractions(DATA_PTR(m_molefractions)); size_t k; - size_t maxPosEloc = npos; size_t maxNegEloc = npos; double maxPosVal = -1.0; @@ -1576,7 +1558,6 @@ void ChemEquil::adjustEloc(thermo_t& s, vector_fp& elMolesGoal) s.setMoleFractions(DATA_PTR(m_molefractions)); s.getMoleFractions(DATA_PTR(m_molefractions)); - } } // namespace diff --git a/src/equil/MultiPhase.cpp b/src/equil/MultiPhase.cpp index 53bb5109a..79333ae51 100644 --- a/src/equil/MultiPhase.cpp +++ b/src/equil/MultiPhase.cpp @@ -213,9 +213,7 @@ void MultiPhase::init() /// set the initial composition within each phase to the /// mole fractions stored in the phase objects m_init = true; - uploadMoleFractionsFromPhases(); - updatePhases(); } @@ -317,7 +315,6 @@ void MultiPhase::getValidChemPotentials(doublereal not_mu, doublereal* mu, bool standard) const { size_t i, loc = 0; - updatePhases(); // iterate over the phases for (i = 0; i < m_np; i++) { @@ -590,7 +587,6 @@ double MultiPhase::equilibrate_MultiPhaseEquil(int XY, doublereal err, Tlow = 0.5*m_Tmin; // lower bound on T Thigh = 2.0*m_Tmax; // upper bound on T for (n = 0; n < maxiter; n++) { - // if 'strt' is false, the current composition will be used as // the starting estimate; otherwise it will be estimated MultiPhaseEquil e(this, strt); @@ -746,7 +742,6 @@ void MultiPhase::equilibrate(const std::string& XY, const std::string& solver, vector_fp initial_moles = m_moles; double initial_T = m_temp; double initial_P = m_press; - int ixy = _equilflag(XY.c_str()); if (solver == "auto" || solver == "vcs") { try { diff --git a/src/equil/MultiPhaseEquil.cpp b/src/equil/MultiPhaseEquil.cpp index 49adf4208..d2634a95c 100644 --- a/src/equil/MultiPhaseEquil.cpp +++ b/src/equil/MultiPhaseEquil.cpp @@ -122,7 +122,6 @@ MultiPhaseEquil::MultiPhaseEquil(MultiPhase* mix, bool start, int loglevel) : m_ // Delta G / RT for each reaction m_deltaG_RT.resize(nFree(), 0.0); - m_majorsp.resize(m_nsp); m_sortindex.resize(m_nsp,0); m_lastsort.resize(m_nel); @@ -174,7 +173,6 @@ doublereal MultiPhaseEquil::equilibrate(int XY, doublereal err, { int i; m_iter = 0; - for (i = 0; i < maxsteps; i++) { stepComposition(loglevel-1); if (error() < err) { @@ -213,12 +211,9 @@ void MultiPhaseEquil::finish() int MultiPhaseEquil::setInitialMoles(int loglevel) { size_t ik, j; - double not_mu = 1.0e12; - m_mix->getValidChemPotentials(not_mu, DATA_PTR(m_mu), true); doublereal dg_rt; - int idir; double nu; double delta_xi, dxi_min = 1.0e10; @@ -226,7 +221,6 @@ int MultiPhaseEquil::setInitialMoles(int loglevel) int iter = 0; while (redo) { - // choose a set of components based on the current // composition computeN(); @@ -403,11 +397,11 @@ void MultiPhaseEquil::getComponents(const std::vector& order) // create stoichiometric coefficient matrix. for (size_t n = 0; n < m_nsp; n++) { - if (n < m_nel) + if (n < m_nel) { for (k = 0; k < nFree(); k++) { m_N(n, k) = -m_A(n, k + m_nel); } - else { + } else { for (k = 0; k < nFree(); k++) { m_N(n, k) = 0.0; } @@ -480,7 +474,6 @@ doublereal MultiPhaseEquil::stepComposition(int loglevel) // scale omega to keep the major species non-negative doublereal FCTR = 0.99; const doublereal MAJOR_THRESHOLD = 1.0e-12; - doublereal omega = 1.0, omax, omegamax = 1.0; for (ik = 0; ik < m_nsp; ik++) { k = m_order[ik]; @@ -497,7 +490,6 @@ doublereal MultiPhaseEquil::stepComposition(int loglevel) // goes away. First we'll determine an upper bound on omega, // such that all if (m_dsoln[k] == 1) { - if ((m_moles[k] > MAJOR_THRESHOLD) || (ik < m_nel)) { if (m_moles[k] < MAJOR_THRESHOLD) { m_force = true; @@ -556,14 +548,12 @@ doublereal MultiPhaseEquil::computeReactionSteps(vector_fp& dxi) doublereal stoich, nmoles, csum, term1, fctr, rfctr; vector_fp nu; doublereal grad = 0.0; - dxi.resize(nFree()); computeN(); doublereal not_mu = 1.0e12; m_mix->getValidChemPotentials(not_mu, DATA_PTR(m_mu)); for (j = 0; j < nFree(); j++) { - // get stoichiometric vector getStoichVector(j, nu); @@ -590,7 +580,6 @@ doublereal MultiPhaseEquil::computeReactionSteps(vector_fp& dxi) } else if (!m_solnrxn[j]) { fctr = 1.0; } else { - // component sum csum = 0.0; for (k = 0; k < m_nel; k++) { @@ -716,11 +705,9 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) size_t k; size_t istart; size_t nSpecies; - double vol = 0.0; string sName; size_t nphase = m_np; - FILE* FP = fopen(reportFile.c_str(), "w"); if (!FP) { throw CanteraError("MultiPhaseEquil::reportCSV", "Failure to open file"); @@ -729,7 +716,6 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) double pres = m_mix->pressure(); vector mf(m_nsp_mix, 1.0); vector fe(m_nsp_mix, 0.0); - std::vector VolPM; std::vector activity; std::vector ac; @@ -737,7 +723,6 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) std::vector mu0; std::vector molalities; - vol = 0.0; for (size_t iphase = 0; iphase < nphase; iphase++) { istart = m_mix->speciesIndex(0, iphase); @@ -763,7 +748,6 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) for (size_t iphase = 0; iphase < nphase; iphase++) { istart = m_mix->speciesIndex(0, iphase); - ThermoPhase& tref = m_mix->phase(iphase); ThermoPhase* tp = &tref; tp->getMoleFractions(&mf[istart]); @@ -772,17 +756,14 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) nSpecies = tref.nSpecies(); activity.resize(nSpecies, 0.0); ac.resize(nSpecies, 0.0); - mu0.resize(nSpecies, 0.0); mu.resize(nSpecies, 0.0); VolPM.resize(nSpecies, 0.0); molalities.resize(nSpecies, 0.0); - int actConvention = tp->activityConvention(); tp->getActivities(DATA_PTR(activity)); tp->getActivityCoefficients(DATA_PTR(ac)); tp->getStandardChemPotentials(DATA_PTR(mu0)); - tp->getPartialMolarVolumes(DATA_PTR(VolPM)); tp->getChemPotentials(DATA_PTR(mu)); double VolPhaseVolumes = 0.0; @@ -816,7 +797,6 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) mf[istart + k] * TMolesPhase, VolPM[k], VolPhaseVolumes); } - } else { if (iphase == 0) { fprintf(FP," Name, Phase, PhaseMoles, Mole_Fract, " diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index 138a0108b..3b9cca048 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -11,7 +11,6 @@ #include "cantera/equil/vcs_MultiPhaseEquil.h" #include "cantera/equil/vcs_VolPhase.h" #include "cantera/equil/vcs_species_thermo.h" - #include "cantera/base/clockWC.h" #include "cantera/base/stringUtils.h" #include "cantera/thermo/speciesThermoTypes.h" @@ -110,7 +109,6 @@ int vcs_MultiPhaseEquil::equilibrate_TV(int XY, doublereal xtarget, } Verr = fabs((Vtarget - Vnow)/Vtarget); - if (Verr < err) { goto done; } @@ -130,7 +128,6 @@ int vcs_MultiPhaseEquil::equilibrate_TV(int XY, doublereal xtarget, Pnew = 3.0 * Pnow; } } - } else { m_mix->setPressure(Pnow*1.01); double dVdP = (m_mix->volume() - Vnow)/(0.01*Pnow); @@ -141,7 +138,6 @@ int vcs_MultiPhaseEquil::equilibrate_TV(int XY, doublereal xtarget, if (Pnew > 1.7 * Pnow) { Pnew = 1.7 * Pnow; } - } m_mix->setPressure(Pnew); } @@ -203,8 +199,6 @@ int vcs_MultiPhaseEquil::equilibrate_HP(doublereal Htarget, // the equilibrium enthalpy monotonically increases with T; // if the current value is below the target, then we know the // current temperature is too low. Set the lower bounds. - - if (Hnow < Htarget) { if (Tnow > Tlow) { Tlow = Tnow; @@ -256,7 +250,6 @@ int vcs_MultiPhaseEquil::equilibrate_HP(doublereal Htarget, Tnew = 0.5*Tnow; } m_mix->setTemperature(Tnew); - } catch (CanteraError err) { if (!estimateEquil) { strt = -1; @@ -268,7 +261,6 @@ int vcs_MultiPhaseEquil::equilibrate_HP(doublereal Htarget, m_mix->setTemperature(Tnew); } } - } throw CanteraError("MultiPhase::equilibrate_HP", "No convergence for T"); @@ -304,7 +296,6 @@ int vcs_MultiPhaseEquil::equilibrate_SP(doublereal Starget, int printLvlSub = std::max(printLvl - 1, 0); for (int n = 0; n < maxiter; n++) { - // start with a loose error tolerance, but tighten it as we get // close to the final temperature try { @@ -390,7 +381,6 @@ int vcs_MultiPhaseEquil::equilibrate_SP(doublereal Starget, Tnew = 0.5*Tnow; } m_mix->setTemperature(Tnew); - } catch (CanteraError err) { if (!estimateEquil) { strt = -1; @@ -402,7 +392,6 @@ int vcs_MultiPhaseEquil::equilibrate_SP(doublereal Starget, m_mix->setTemperature(Tnew); } } - } throw CanteraError("MultiPhase::equilibrate_SP", "No convergence for T"); @@ -459,11 +448,9 @@ int vcs_MultiPhaseEquil::equilibrate_TP(int estimateEquil, { int maxit = maxsteps; clockWC tickTock; - m_printLvl = printLvl; m_vprob.m_printLvl = printLvl; - /* * Extract the current state information * from the MultiPhase object and @@ -474,7 +461,6 @@ int vcs_MultiPhaseEquil::equilibrate_TP(int estimateEquil, plogf("problems\n"); } - // Set the estimation technique if (estimateEquil) { m_vprob.iest = estimateEquil; @@ -654,17 +640,14 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) size_t nSpecies = tref.nSpecies(); activity.resize(nSpecies, 0.0); ac.resize(nSpecies, 0.0); - mu0.resize(nSpecies, 0.0); mu.resize(nSpecies, 0.0); VolPM.resize(nSpecies, 0.0); molalities.resize(nSpecies, 0.0); - int actConvention = tref.activityConvention(); tref.getActivities(&activity[0]); tref.getActivityCoefficients(&ac[0]); tref.getStandardChemPotentials(&mu0[0]); - tref.getPartialMolarVolumes(&VolPM[0]); tref.getChemPotentials(&mu[0]); double VolPhaseVolumes = 0.0; @@ -674,7 +657,6 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) VolPhaseVolumes *= TMolesPhase; vol += VolPhaseVolumes; - if (actConvention == 1) { MolalityVPSSTP* mTP = static_cast(&tref); mTP->getMolalities(&molalities[0]); @@ -700,7 +682,6 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) mf[istart + k] * TMolesPhase, VolPM[k], VolPhaseVolumes); } - } else { if (iphase == 0) { fprintf(FP," Name, Phase, PhaseMoles, Mole_Fract, " @@ -780,7 +761,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) */ int kT = 0; for (size_t iphase = 0; iphase < totNumPhases; iphase++) { - /* * Get the ThermoPhase object - assume volume phase */ @@ -812,7 +792,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) * ->TMolesInert = Inerts in the phase = 0.0 for cantera * ->PhaseName = Name of the phase */ - vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase]; VolPhase->resize(iphase, nSpPhase, nelem, phaseName.c_str(), 0.0); VolPhase->m_gasPhase = gasPhase; @@ -885,7 +864,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) * object into the vprob object. */ vprob->addPhaseElements(VolPhase); - VolPhase->setState_TP(vprob->T, vprob->PresPA); vector muPhase(tPhase->nSpecies(),0.0); tPhase->getChemPotentials(&muPhase[0]); @@ -920,7 +898,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) * Transfer the type of unknown */ vprob->SpeciesUnknownType[kT] = VolPhase->speciesUnknownType(k); - if (vprob->SpeciesUnknownType[kT] == VCS_SPECIES_TYPE_MOLNUM) { /* * Set the initial number of kmoles of the species @@ -937,7 +914,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) "Unknown species type: " + int2str(vprob->SpeciesUnknownType[kT])); } - /* * transfer chemical potential vector */ @@ -988,7 +964,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) SpeciesThermo& sp = tPhase->speciesThermo(); int spType = sp.reportType(k); - if (spType == SIMPLE) { double c[4]; double minTemp, maxTemp, refPressure; @@ -1064,13 +1039,11 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) ts_ptr->SS0_feSave = VolPhase->G0_calc_one(k)/ R; ts_ptr->SS0_TSave = vprob->T; } - } /* * Transfer initial element abundances to the vprob object. * We have to find the mapping index from one to the other - * */ vprob->gai.resize(vprob->ne, 0.0); vprob->set_gai(); @@ -1125,7 +1098,6 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) writeline('=', 80); plogf("\n"); } - return VCS_SUCCESS; } @@ -1185,7 +1157,6 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) } else { volPhase->setExistence(VCS_PHASE_EXIST_NO); } - } /* * Transfer initial element abundances to the vprob object. @@ -1211,7 +1182,6 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) plogf(" Initial_Estimated_kMols\n"); for (size_t i = 0; i < vprob->nspecies; i++) { size_t iphase = vprob->PhaseID[i]; - vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase]; plogf("%16s %5d %16s", vprob->SpName[i].c_str(), iphase, VolPhase->PhaseName.c_str()); @@ -1247,7 +1217,6 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) writeline('=', 80); plogf("\n"); } - return VCS_SUCCESS; } @@ -1269,7 +1238,6 @@ void vcs_MultiPhaseEquil::getStoichVector(size_t rxn, vector_fp& nu) j = indSpecies[kc]; nu[j] = m_vsolve.m_stoichCoeffRxnMatrix(kc,rxn); } - } size_t vcs_MultiPhaseEquil::numComponents() const @@ -1308,8 +1276,6 @@ int vcs_MultiPhaseEquil::determine_PhaseStability(int iph, double& funcStab, int plogf("problems\n"); } - - // Check obvious bounds on the temperature and pressure // NOTE, we may want to do more here with the real bounds // given by the ThermoPhase objects. @@ -1349,7 +1315,6 @@ int vcs_MultiPhaseEquil::determine_PhaseStability(int iph, double& funcStab, int double te = tickTock.secondsWC(); if (printLvl > 0) { plogf("\n Results from vcs_PS:\n"); - plogf("\n"); plogf("Temperature = %g Kelvin\n", m_vprob.T); plogf("Pressure = %g Pa\n", m_vprob.PresPA); diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index ff5abcae9..605b324ed 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -227,7 +227,6 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies, m_singleSpecies = false; } - IndSpecies.resize(nspecies, npos); if (ListSpeciesPtr.size() >= m_numSpecies) { @@ -263,7 +262,6 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies, ActCoeff.resize(nspecies, 1.0); np_dLnActCoeffdMolNumber.resize(nspecies, nspecies, 0.0); - m_speciesUnknownType.resize(nspecies, VCS_SPECIES_TYPE_MOLNUM); m_UpToDate = false; m_vcsStateStatus = VCS_STATECALC_OLD; @@ -273,23 +271,17 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies, m_UpToDate_GStar = false; m_UpToDate_G0 = false; - elemResize(numElem); - } void vcs_VolPhase::elemResize(const size_t numElemConstraints) { - m_elementNames.resize(numElemConstraints); - m_elementActive.resize(numElemConstraints+1, 1); m_elementType.resize(numElemConstraints, VCS_ELEM_TYPE_ABSPOS); m_formulaMatrix.resize(m_numSpecies, numElemConstraints, 0.0); - m_elementNames.resize(numElemConstraints, ""); m_elemGlobalIndex.resize(numElemConstraints, npos); - m_numElemConstraints = numElemConstraints; } @@ -381,7 +373,6 @@ void vcs_VolPhase::setMoleFractionsState(const double totalMoles, const double* const moleFractions, const int vcsStateStatus) { - if (totalMoles != 0.0) { // There are other ways to set the mole fractions when VCS_STATECALC // is set to a normal settting. @@ -426,7 +417,6 @@ void vcs_VolPhase::setMoleFractionsState(const double totalMoles, } } _updateMoleFractionDependencies(); - } void vcs_VolPhase::setMolesFromVCS(const int stateCalc, @@ -1079,7 +1069,6 @@ size_t vcs_VolPhase::transferElementsFM(const ThermoPhase* const tPhase) */ elemResize(ne); - if (ChargeNeutralityElement != npos) { m_elementType[ChargeNeutralityElement] = VCS_ELEM_TYPE_CHARGENEUTRALITY; } @@ -1120,13 +1109,10 @@ size_t vcs_VolPhase::transferElementsFM(const ThermoPhase* const tPhase) ne++; elemResize(ne); } - } m_formulaMatrix.resize(ns, ne, 0.0); - m_speciesUnknownType.resize(ns, VCS_SPECIES_TYPE_MOLNUM); - elemResize(ne); size_t e = 0; @@ -1164,7 +1150,6 @@ size_t vcs_VolPhase::transferElementsFM(const ThermoPhase* const tPhase) } } - /* * Here, we figure out what is the species types are * The logic isn't set in stone, and is just for a particular type diff --git a/src/equil/vcs_inest.cpp b/src/equil/vcs_inest.cpp index ce52dbdbc..7a972bc05 100644 --- a/src/equil/vcs_inest.cpp +++ b/src/equil/vcs_inest.cpp @@ -321,7 +321,6 @@ int VCS_SOLVE::vcs_inest_TP() { int retn = 0; clockWC tickTock; - if (m_doEstimateEquil > 0) { /* * Calculate the elemental abundances diff --git a/src/equil/vcs_phaseStability.cpp b/src/equil/vcs_phaseStability.cpp index 71c0bb8d1..3ddfaa342 100644 --- a/src/equil/vcs_phaseStability.cpp +++ b/src/equil/vcs_phaseStability.cpp @@ -16,7 +16,6 @@ namespace Cantera bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const { vcs_VolPhase* Vphase = m_VolPhaseList[iphasePop]; - AssertThrowMsg(!Vphase->exists(), "VCS_SOLVE::vcs_popPhasePossible", "called for a phase that exists!"); @@ -35,11 +34,11 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const size_t irxn = kspec - m_numComponents; if (kspec >= m_numComponents) { bool iPopPossible = true; - /* - * Note one case is if the component is a member of the popping phase. - * This component will be zeroed and the logic here will negate the current - * species from causing a positive if this component is consumed. - */ + /* + * Note one case is if the component is a member of the popping phase. + * This component will be zeroed and the logic here will negate the current + * species from causing a positive if this component is consumed. + */ for (size_t j = 0; j < m_numComponents; ++j) { if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS) { double stoicC = m_stoichCoeffRxnMatrix(j,irxn); @@ -163,13 +162,11 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() iphList.clear(); vcs_VolPhase* Vphase = m_VolPhaseList[iph]; if (Vphase->exists() < 0) { - linkedPhases.clear(); size_t nsp = Vphase->nSpecies(); for (size_t k = 0; k < nsp; k++) { size_t kspec = Vphase->spGlobalIndexVCS(k); size_t irxn = kspec - m_numComponents; - for (size_t j = 0; j < m_numComponents; j++) { if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS) { if (m_molNumSpecies_old[j] <= 0.0) { @@ -199,7 +196,6 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() /* * Now fill in the phasePopProblemLists_ list. - * */ for (size_t iph = 0; iph < m_numPhases; iph++) { vcs_VolPhase* Vphase = m_VolPhaseList[iph]; @@ -220,7 +216,6 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() phasePopProblemLists_.push_back(popProblem); } } - return nfound; } @@ -256,9 +251,7 @@ size_t VCS_SOLVE::vcs_popPhaseID(std::vector & phasePopPhaseIDs) } else { if (Vphase->m_singleSpecies) { /*********************************************************************** - * * Single Phase Stability Resolution - * ***********************************************************************/ size_t kspec = Vphase->spGlobalIndexVCS(0); size_t irxn = kspec - m_numComponents; @@ -288,12 +281,9 @@ size_t VCS_SOLVE::vcs_popPhaseID(std::vector & phasePopPhaseIDs) existence, Fephase, m_tPhaseMoles_old[iph], anote); } - } else { /*********************************************************************** - * * MultiSpecies Phase Stability Resolution - * ***********************************************************************/ if (vcs_popPhasePossible(iph)) { Fephase = vcs_phaseStabilityTest(iph); @@ -330,7 +320,6 @@ size_t VCS_SOLVE::vcs_popPhaseID(std::vector & phasePopPhaseIDs) * Insert logic here to figure out if phase pops are linked together. Only do one linked * pop at a time. */ - if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" ---------------------------------------------------------------------\n"); } @@ -407,8 +396,6 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) if (-m_deltaMolNumSpecies[kspec] > m_molNumSpecies_old[kspec]) { m_deltaMolNumSpecies[kspec] = -m_molNumSpecies_old[kspec]; } - - } else { vector fracDelta(Vphase->nSpecies()); vector X_est(Vphase->nSpecies()); @@ -427,7 +414,6 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) m_deltaGRxn_tmp = m_molNumSpecies_old; double* molNumSpecies_tmp = DATA_PTR(m_deltaGRxn_tmp); - for (size_t k = 0; k < Vphase->nSpecies(); k++) { kspec = Vphase->spGlobalIndexVCS(k); double delmol = deltaMolNumPhase * X_est[k]; @@ -475,8 +461,6 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) damp = 0.001 / ratioComp; } } - - if (damp <= 1.0E-6) { return 3; } @@ -494,9 +478,7 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) } } } - } - return 0; } @@ -509,7 +491,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) const size_t nsp = Vphase->nSpecies(); int minNumberIterations = 3; if (nsp <= 1) { - minNumberIterations = 1; + minNumberIterations = 1; } // We will do a full Newton calculation later, but for now, ... @@ -523,7 +505,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) vector fracDelta_raw(nsp, 0.0); vector creationGlobalRxnNumbers(nsp, npos); m_deltaGRxn_Deficient = m_deltaGRxn_old; - vector m_feSpecies_Deficient(m_numComponents, 0.0); doublereal damp = 1.0; doublereal dampOld = 1.0; @@ -540,9 +521,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) // it gets created fracDelta_new = Vphase->creationMoleNumbers(creationGlobalRxnNumbers); - std::vector componentList; - for (size_t k = 0; k < nsp; k++) { size_t kspec = Vphase->spGlobalIndexVCS(k); if (kspec < m_numComponents) { @@ -575,7 +554,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } bool converged = false; for (int its = 0; its < 200 && (!converged); its++) { - dampOld = damp; normUpdateOld = normUpdate; fracDelta_old = fracDelta_new; @@ -613,7 +591,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } } - /* * Feed the newly formed estimate of the mole fractions back into the * ThermoPhase object @@ -655,7 +632,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) m_stoichCoeffRxnMatrix(kc_spec,irxn) * (m_feSpecies_Deficient[kc_spec]- m_feSpecies_old[kc_spec]); } } - } } @@ -688,7 +664,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } } - // Given a set of fracDelta's, we calculate the fracDelta's // for the component species, if any for (size_t i = 0; i < componentList.size(); i++) { @@ -704,8 +679,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } } - - /* * Now possibly dampen the estimate. */ @@ -725,7 +698,6 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) crossedSign = true; } - damp = 0.5; if (dampOld < 0.25) { damp = 2.0 * dampOld; @@ -772,26 +744,23 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) if (normUpdate < 1.0E-5 * damp) { converged = true; - if (its < minNumberIterations) { - converged = false; - } + if (its < minNumberIterations) { + converged = false; + } } - } if (converged) { - /* - * Save the final optimized stated back into the VolPhase object for later use - */ + /* + * Save the final optimized stated back into the VolPhase object for later use + */ Vphase->setMoleFractionsState(0.0, &X_est[0], VCS_STATECALC_PHASESTABILITY); - /* - * Save fracDelta for later use to initialize the problem better - * @TODO creationGlobalRxnNumbers needs to be calculated here and stored. - */ + /* + * Save fracDelta for later use to initialize the problem better + * @TODO creationGlobalRxnNumbers needs to be calculated here and stored. + */ Vphase->setCreationMoleNumbers(&fracDelta_new[0], creationGlobalRxnNumbers); } - - } else { throw CanteraError("VCS_SOLVE::vcs_phaseStabilityTest", "not done yet"); } diff --git a/src/equil/vcs_prep.cpp b/src/equil/vcs_prep.cpp index 5138f359e..c5a8bcedd 100644 --- a/src/equil/vcs_prep.cpp +++ b/src/equil/vcs_prep.cpp @@ -18,7 +18,6 @@ namespace Cantera void VCS_SOLVE::vcs_SSPhase() { std::vector numPhSpecies(m_numPhases, 0); - for (size_t kspec = 0; kspec < m_numSpeciesTot; ++kspec) { numPhSpecies[m_phaseID[kspec]]++; } diff --git a/src/equil/vcs_prob.cpp b/src/equil/vcs_prob.cpp index ca063810e..1543146cd 100644 --- a/src/equil/vcs_prob.cpp +++ b/src/equil/vcs_prob.cpp @@ -361,7 +361,6 @@ void VCS_PROB::reportCSV(const std::string& reportFile) std::vector mu(nspecies, 0.0); std::vector mu0(nspecies, 0.0); std::vector molalities(nspecies, 0.0); - double vol = 0.0; size_t iK = 0; for (size_t iphase = 0; iphase < NPhase; iphase++) { @@ -401,17 +400,14 @@ void VCS_PROB::reportCSV(const std::string& reportFile) double TMolesPhase = volP->totalMoles(); activity.resize(nSpeciesPhase, 0.0); ac.resize(nSpeciesPhase, 0.0); - mu0.resize(nSpeciesPhase, 0.0); mu.resize(nSpeciesPhase, 0.0); volPM.resize(nSpeciesPhase, 0.0); molalities.resize(nSpeciesPhase, 0.0); - int actConvention = tp->activityConvention(); tp->getActivities(&activity[0]); tp->getActivityCoefficients(&ac[0]); tp->getStandardChemPotentials(&mu0[0]); - tp->getPartialMolarVolumes(&volPM[0]); tp->getChemPotentials(&mu[0]); double VolPhaseVolumes = 0.0; @@ -447,7 +443,6 @@ void VCS_PROB::reportCSV(const std::string& reportFile) mf[istart + k] * TMolesPhase, volPM[k], VolPhaseVolumes); } - } else { if (iphase == 0) { fprintf(FP," Name, Phase, PhaseMoles, Mole_Fract, " diff --git a/src/equil/vcs_report.cpp b/src/equil/vcs_report.cpp index 3dcb392cf..f53a175cd 100644 --- a/src/equil/vcs_report.cpp +++ b/src/equil/vcs_report.cpp @@ -15,9 +15,7 @@ int VCS_SOLVE::vcs_report(int iconv) { bool printActualMoles = true, inertYes = false; size_t nspecies = m_numSpeciesTot; - char originalUnitsState = m_unitsState; - std::vector sortindex(nspecies,0); std::vector xy(nspecies,0.0); @@ -148,7 +146,6 @@ int VCS_SOLVE::vcs_report(int iconv) } else { plogf(" Unknown"); } - plogf("\n"); } } @@ -256,7 +253,6 @@ int VCS_SOLVE::vcs_report(int iconv) * -> Inert species are handled as if they had a standard free * energy of zero */ - double g = vcs_Total_Gibbs(&m_molNumSpecies_old[0], &m_feSpecies_old[0], &m_tPhaseMoles_old[0]); plogf("\n\tTotal Dimensionless Gibbs Free Energy = G/RT = %15.7E\n", g); diff --git a/src/equil/vcs_rxnadj.cpp b/src/equil/vcs_rxnadj.cpp index 2464d5e0e..1bbd55cc9 100644 --- a/src/equil/vcs_rxnadj.cpp +++ b/src/equil/vcs_rxnadj.cpp @@ -51,14 +51,12 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) /************************************************************************ ******** LOOP OVER THE FORMATION REACTIONS ***************************** ************************************************************************/ - for (size_t irxn = 0; irxn < m_numRxnRdc; ++irxn) { if (DEBUG_MODE_ENABLED) { sprintf(ANOTE, "Normal Calc"); } size_t kspec = m_indexRxnToSpecies[irxn]; - if (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDPHASE) { m_deltaMolNumSpecies[kspec] = 0.0; if (DEBUG_MODE_ENABLED) { @@ -113,14 +111,12 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) } } } - } else { if (DEBUG_MODE_ENABLED) { sprintf(ANOTE, "MultSpec (%s): still dead DG = %11.3E", vcs_speciesType_string(m_speciesStatus[kspec], 15), m_deltaGRxn_new[irxn]); } m_deltaMolNumSpecies[kspec] = 0.0; - } } else { /********************************************************************/ @@ -129,7 +125,6 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) /* * First take care of cases where we want to bail out * - * * Don't bother if superconvergence has already been achieved * in this mode. */ @@ -234,7 +229,6 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) } m_deltaMolNumSpecies[kspec] = -m_molNumSpecies_old[kspec]; } - } else { /* ************************************************************ */ /* **** REACTION IS ENTIRELY AMONGST SINGLE SPECIES PHASES **** */ @@ -283,7 +277,6 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) * added back into the component species. */ if (dss != 0.0) { - if ((k == kspec) && (m_SSPhase[kspec] != 1)) { /* * Found out that we can be in this spot, when components of multispecies phases @@ -420,7 +413,6 @@ int VCS_SOLVE::vcs_rxn_adj_cg() /* * First take care of cases where we want to bail out * - * * Don't bother if superconvergence has already been achieved * in this mode. */ @@ -555,14 +547,12 @@ int VCS_SOLVE::vcs_rxn_adj_cg() } /* End of loop over non-component stoichiometric formation reactions */ /* - * * When we form the Hessian we must be careful to ensure that it * is a symmetric positive definite matrix, still. This means zeroing * out columns when we zero out rows as well. * -> I suggest writing a small program to make sure of this * property. */ - if (DEBUG_MODE_ENABLED) { plogf(" "); for (size_t j = 0; j < 77; j++) { @@ -618,7 +608,6 @@ double VCS_SOLVE::vcs_Hessian_actCoeff_diag(size_t irxn) if (kph == m_phaseID[l]) { s += sc_irxn[l] * (m_np_dLnActCoeffdMolNum(l,kspec) + m_np_dLnActCoeffdMolNum(kspec,l)) / np_kspec; } - } } return s; @@ -740,7 +729,6 @@ double VCS_SOLVE::vcs_line_search(const size_t irxn, const double dx_orig, char* } dx = dx_orig; - for (its = 0; its < MAXITS; its++) { /* * Calculate the approximation to the total Gibbs free energy at diff --git a/src/equil/vcs_setMolesLinProg.cpp b/src/equil/vcs_setMolesLinProg.cpp index b4d6c9285..7399d049e 100644 --- a/src/equil/vcs_setMolesLinProg.cpp +++ b/src/equil/vcs_setMolesLinProg.cpp @@ -43,7 +43,6 @@ int VCS_SOLVE::vcs_setMolesLinProg() // m_mix->getValidChemPotentials(not_mu, DATA_PTR(m_mu), true); // -> This is already done coming into the routine. double dg_rt; - int idir; double nu; double delta_xi, dxi_min = 1.0e10; @@ -52,7 +51,6 @@ int VCS_SOLVE::vcs_setMolesLinProg() int iter = 0; bool abundancesOK = true; bool usedZeroedSpecies; - std::vector sm(m_numElemConstraints*m_numElemConstraints, 0.0); std::vector ss(m_numElemConstraints, 0.0); std::vector sa(m_numElemConstraints, 0.0); @@ -70,7 +68,6 @@ int VCS_SOLVE::vcs_setMolesLinProg() } while (redo) { - if (!vcs_elabcheck(0)) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" --- seMolesLinProg Mole numbers failing element abundances\n"); @@ -107,7 +104,6 @@ int VCS_SOLVE::vcs_setMolesLinProg() // loop over all reactions for (irxn = 0; irxn < m_numRxnTot; irxn++) { - // dg_rt is the Delta_G / RT value for the reaction ik = m_numComponents + irxn; dg_rt = m_SSfeSpecies[ik]; @@ -126,7 +122,6 @@ int VCS_SOLVE::vcs_setMolesLinProg() for (size_t jcomp = 0; jcomp < m_numComponents; jcomp++) { nu = sc_irxn[jcomp]; - // set max change in progress variable by // non-negativity requirement if (nu*idir < 0) { diff --git a/src/equil/vcs_solve.cpp b/src/equil/vcs_solve.cpp index 0ef0a3e00..7903b7ca5 100644 --- a/src/equil/vcs_solve.cpp +++ b/src/equil/vcs_solve.cpp @@ -12,10 +12,8 @@ #include "cantera/base/ctexceptions.h" #include "cantera/base/stringUtils.h" #include "cantera/equil/vcs_prob.h" - #include "cantera/equil/vcs_VolPhase.h" #include "cantera/equil/vcs_species_thermo.h" - #include "cantera/base/clockWC.h" using namespace std; @@ -97,40 +95,30 @@ void VCS_SOLVE::vcs_initSizes(const size_t nspecies0, const size_t nelements, * filled with meaningful information. */ m_stoichCoeffRxnMatrix.resize(nelements, nspecies0, 0.0); - m_scSize.resize(nspecies0, 0.0); m_spSize.resize(nspecies0, 1.0); - m_SSfeSpecies.resize(nspecies0, 0.0); m_feSpecies_new.resize(nspecies0, 0.0); m_molNumSpecies_old.resize(nspecies0, 0.0); - m_speciesUnknownType.resize(nspecies0, VCS_SPECIES_TYPE_MOLNUM); - m_deltaMolNumPhase.resize(nphase0, nspecies0, 0.0); m_phaseParticipation.resize(nphase0, nspecies0, 0); m_phasePhi.resize(nphase0, 0.0); - m_molNumSpecies_new.resize(nspecies0, 0.0); - m_deltaGRxn_new.resize(nspecies0, 0.0); m_deltaGRxn_old.resize(nspecies0, 0.0); m_deltaGRxn_Deficient.resize(nspecies0, 0.0); m_deltaGRxn_tmp.resize(nspecies0, 0.0); m_deltaMolNumSpecies.resize(nspecies0, 0.0); - m_feSpecies_old.resize(nspecies0, 0.0); m_elemAbundances.resize(nelements, 0.0); m_elemAbundancesGoal.resize(nelements, 0.0); - m_tPhaseMoles_old.resize(nphase0, 0.0); m_tPhaseMoles_new.resize(nphase0, 0.0); m_deltaPhaseMoles.resize(nphase0, 0.0); m_TmpPhase.resize(nphase0, 0.0); m_TmpPhase2.resize(nphase0, 0.0); - m_formulaMatrix.resize(nspecies0, nelements); - TPhInertMoles.resize(nphase0, 0.0); /* @@ -157,14 +145,10 @@ void VCS_SOLVE::vcs_initSizes(const size_t nspecies0, const size_t nelements, m_SSPhase.resize(2*nspecies0, 0); m_phaseID.resize(nspecies0, 0); - m_numElemConstraints = nelements; - m_elementName.resize(nelements, std::string("")); m_speciesName.resize(nspecies0, std::string("")); - m_elType.resize(nelements, VCS_ELEM_TYPE_ABSPOS); - m_elementActive.resize(nelements, 1); /* * Malloc space for activity coefficients for all species @@ -209,7 +193,6 @@ void VCS_SOLVE::vcs_initSizes(const size_t nspecies0, const size_t nelements, } return; - } VCS_SOLVE::~VCS_SOLVE() @@ -262,7 +245,6 @@ int VCS_SOLVE::vcs(VCS_PROB* vprob, int ifunc, int ipr, int ip1, int maxit) size_t nspecies0 = vprob->nspecies + 10; size_t nelements0 = vprob->ne; size_t nphase0 = vprob->NPhase; - vcs_initSizes(nspecies0, nelements0, nphase0); if (retn != 0) { @@ -362,7 +344,6 @@ int VCS_SOLVE::vcs(VCS_PROB* vprob, int ifunc, int ipr, int ip1, int maxit) * * FILL IN */ - if (iconv < 0) { plogf("ERROR: FAILURE its = %d!\n", m_VCount->Its); } else if (iconv == 1) { @@ -540,7 +521,6 @@ int VCS_SOLVE::vcs_prob_specifyFully(const VCS_PROB* pub) * TPhMoles1[] * DelTPhMoles[] * - * * T, Pres, copy over here */ if (pub->T > 0.0) { @@ -760,9 +740,7 @@ int VCS_SOLVE::vcs_prob_specify(const VCS_PROB* pub) m_pressurePA = pub->PresPA; m_VCS_UnitsFormat = pub->m_VCS_UnitsFormat; m_doEstimateEquil = pub->iest; - m_totalVol = pub->Vol; - m_tolmaj = pub->tolmaj; m_tolmin = pub->tolmin; m_tolmaj2 = 0.01 * m_tolmaj; @@ -863,7 +841,6 @@ int VCS_SOLVE::vcs_prob_specify(const VCS_PROB* pub) vPhase->setElectricPotential(phi); } - if (status_change) { vcs_SSPhase(); } @@ -871,14 +848,12 @@ int VCS_SOLVE::vcs_prob_specify(const VCS_PROB* pub) * Calculate the total number of moles in all phases. */ vcs_tmoles(); - return retn; } int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) { size_t k1 = 0; - vcs_tmoles(); m_totalVol = vcs_VolTotal(m_temperature, m_pressurePA, &m_molNumSpecies_old[0], &m_PMVolumeSpecies[0]); @@ -949,12 +924,10 @@ int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) "We have an inconsistency in total moles, " + fp2str(sumMoles) + " " + fp2str(pubPhase->totalMoles())); } - } pub->m_Iterations = m_VCount->Its; pub->m_NumBasisOptimizations = m_VCount->Basis_Opts; - return VCS_SUCCESS; } diff --git a/src/equil/vcs_solve_TP.cpp b/src/equil/vcs_solve_TP.cpp index de19e0026..af6b25502 100644 --- a/src/equil/vcs_solve_TP.cpp +++ b/src/equil/vcs_solve_TP.cpp @@ -10,7 +10,6 @@ #include "cantera/equil/vcs_solve.h" #include "cantera/equil/vcs_VolPhase.h" - #include "cantera/base/ctexceptions.h" #include "cantera/base/clockWC.h" #include "cantera/base/stringUtils.h" @@ -104,14 +103,12 @@ int VCS_SOLVE::vcs_solve_TP(int print_lvl, int printDetails, int maxit) /* ******************************************************* */ /* **** Printout the initial conditions for problem ****** */ /* ******************************************************* */ - if (print_lvl != 0) { plogf("VCS CALCULATION METHOD\n\n "); plogf("%s\n", m_title.c_str()); plogf("\n\n%5d SPECIES\n%5d ELEMENTS\n", m_numSpeciesTot, m_numElemConstraints); plogf("%5d COMPONENTS\n", m_numComponents); plogf("%5d PHASES\n", m_numPhases); - plogf(" PRESSURE%22.8g %3s\n", m_pressurePA, "Pa "); plogf(" TEMPERATURE%19.3f K\n", m_temperature); vcs_VolPhase* Vphase = m_VolPhaseList[0]; @@ -216,7 +213,6 @@ int VCS_SOLVE::vcs_solve_TP(int print_lvl, int printDetails, int maxit) if (retn != VCS_SUCCESS) { return retn; } - it1 = 1; forceComponentCalc = 0; iti = 0; @@ -232,7 +228,6 @@ int VCS_SOLVE::vcs_solve_TP(int print_lvl, int printDetails, int maxit) solve_tp_inner(iti, it1, uptodate_minors, allMinorZeroedSpecies, forceComponentCalc, stage, printDetails, ANOTE); lec = false; - } else if (stage == EQUILIB_CHECK) { /*************************************************************************/ /***************** EQUILIBRIUM CHECK FOR MAJOR SPECIES *******************/ @@ -240,7 +235,6 @@ int VCS_SOLVE::vcs_solve_TP(int print_lvl, int printDetails, int maxit) solve_tp_equilib_check(allMinorZeroedSpecies, uptodate_minors, giveUpOnElemAbund, solveFail, iti, it1, maxit, stage, lec); - } else if (stage == ELEM_ABUND_CHECK) { /* *************************************************** */ /* **** CORRECT ELEMENTAL ABUNDANCES ***************** */ @@ -763,7 +757,6 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, * of all species. */ size_t lnospec = vcs_delete_species(kspec); - if (lnospec) { stage = RECHECK_DELETED; break; @@ -1127,7 +1120,6 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, * Print out the changes to the solution that FORCER produced */ if (printDetails && forced) { - plogf(" -----------------------------------------------------\n"); plogf(" --- FORCER SUBROUTINE changed the solution:\n"); plogf(" --- SPECIES Status INIT MOLES TENT_MOLES"); @@ -1167,7 +1159,6 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, /* *************************************************************** */ /* **** ITERATION SUMMARY PRINTOUT SECTION *********************** */ /* *************************************************************** */ - if (printDetails) { plogf(" "); writeline('-', 103); @@ -1305,7 +1296,6 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, } vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD); vcs_dfe(VCS_STATECALC_OLD, 0, 0, m_numSpeciesRdc); - vcs_deltag(0, true, VCS_STATECALC_OLD); iti = 0; return; @@ -1334,7 +1324,6 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, /*************************************************************************/ /***************** CHECK FOR OPTIMUM BASIS *******************************/ /*************************************************************************/ - for (size_t i = 0; i < m_numRxnRdc; ++i) { size_t l = m_indexRxnToSpecies[i]; if (m_speciesUnknownType[l] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { @@ -1492,7 +1481,6 @@ void VCS_SOLVE::solve_tp_equilib_check(bool& allMinorZeroedSpecies, /*************************************************************************/ /*************** EQUILIBRIUM CHECK FOR MINOR SPECIES *********************/ /*************************************************************************/ - if (m_numRxnMinorZeroed != 0) { /* * Calculate the chemical potential and reaction DeltaG @@ -1713,13 +1701,10 @@ double VCS_SOLVE::vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete, * We then solve the resulting calculation: * * gamma * x = gamma_0 * x0 exp (-deltaG/RT); - * - * */ a = clip(w_kspec * s, -1.0+1e-8, 100.0); tmp = clip(-dg_irxn / (1.0 + a), -200.0, 200.0); wTrial = w_kspec * exp(tmp); - molNum_kspec_new = wTrial; if (wTrial > 100. * w_kspec) { @@ -1732,14 +1717,12 @@ double VCS_SOLVE::vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete, } else { molNum_kspec_new = wTrial; } - } else if (1.0E10 * wTrial < w_kspec) { molNum_kspec_new= 1.0E-10 * w_kspec; } else { molNum_kspec_new = wTrial; } - if ((molNum_kspec_new) < VCS_DELETE_MINORSPECIES_CUTOFF) { goto L_ZERO_SPECIES; } @@ -2086,7 +2069,6 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) } } - /* * Loop over all of the inactive species in the phase: * Right now we reinstate all species in a deleted multiphase. @@ -2129,7 +2111,6 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) * Upload the state to the VP object */ Vphase->setTotalMoles(0.0); - return successful; } @@ -2218,7 +2199,6 @@ int VCS_SOLVE::vcs_recheck_deleted() bool VCS_SOLVE::recheck_deleted_phase(const int iphase) { - // Check first to see if the phase is in fact deleted const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; if (Vphase->exists() != VCS_PHASE_EXIST_NO) { @@ -2263,7 +2243,6 @@ size_t VCS_SOLVE::vcs_add_all_deleted() * being sufficiently good. Note, we will recalculate everything at the end of the routine. */ m_molNumSpecies_new = m_molNumSpecies_old; - for (int cits = 0; cits < 3; cits++) { for (size_t kspec = m_numSpeciesRdc; kspec < m_numSpeciesTot; ++kspec) { size_t iph = m_phaseID[kspec]; @@ -2365,7 +2344,6 @@ bool VCS_SOLVE::vcs_globStepDamp() } } - /* *************************************************** */ /* **** CALCULATE ORIGINAL SLOPE ********************* */ /* ************************************************** */ @@ -2603,7 +2581,6 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[], */ if ((aw[k] != test) && aw[k] < VCS_DELETE_MINORSPECIES_CUTOFF) { *usedZeroedSpecies = true; - double maxConcPossKspec = 0.0; double maxConcPoss = 0.0; size_t kfound = npos; @@ -2658,7 +2635,6 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[], k = kfound; } - if (aw[k] == test) { m_numComponents = jr; ncTrial = m_numComponents; @@ -2851,7 +2827,6 @@ L_END_LOOP: } for (k = 0; k < m_numSpeciesTot; k++) { if (m_speciesUnknownType[k] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - for (size_t j = 0; j < ncTrial; ++j) { for (size_t i = 0; i < ncTrial; ++i) { if (i == jlose) { @@ -2886,7 +2861,6 @@ L_END_LOOP: } } - /* * Calculate the szTmp array for each formation reaction */ @@ -2930,7 +2904,6 @@ L_END_LOOP: plogf("\n"); } - /* * Manual check on the satisfaction of the reaction matrix's ability * to conserve elements @@ -3081,10 +3054,7 @@ size_t VCS_SOLVE::vcs_basisOptMax(const double* const molNum, const size_t j, int VCS_SOLVE::vcs_species_type(const size_t kspec) const { - // ---------- Treat special cases first --------------------- - - if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { return VCS_SPECIES_INTERFACIALVOLTAGE; } @@ -3095,9 +3065,7 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const int phaseExist = VPhase->exists(); // ---------- Treat zeroed out species first ---------------- - if (m_molNumSpecies_old[kspec] <= 0.0) { - if (m_tPhaseMoles_old[iph] <= 0.0) { if (!m_SSPhase[kspec]) { return VCS_SPECIES_ZEROEDMS; @@ -3134,8 +3102,6 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const /* * The Gibbs free energy for this species is such that * it will pop back into existence. - */ - /* * -> An exception to this is if a needed regular element * is also zeroed out. Then, don't pop the phase or the species back into * existence. @@ -3557,8 +3523,6 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc, } } } - - } void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const @@ -3782,7 +3746,6 @@ bool VCS_SOLVE::vcs_evaluate_speciesType() plogf(" %10.3g ", m_molNumSpecies_old[kspec]); const char* sString = vcs_speciesType_string(m_speciesStatus[kspec], 100); plogf("%s\n", sString); - } else if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { if (m_speciesStatus[kspec] != VCS_SPECIES_MINOR) { switch (m_speciesStatus[kspec]) { @@ -4019,7 +3982,6 @@ void VCS_SOLVE::vcs_deltag(const int l, const bool doDeleted, deltaGRxn[irxn] = 1.0 - poly; } } - } } } @@ -4081,12 +4043,10 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) writeline('-', 132); for (size_t kspec = 0; kspec < m_numSpeciesTot; kspec++) { - size_t irxn = npos; if (kspec >= m_numComponents) { - irxn = kspec - m_numComponents; - } - + irxn = kspec - m_numComponents; + } double mfValue = 1.0; size_t iphase = m_phaseID[kspec]; const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; @@ -4147,13 +4107,10 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) printf(" balanced"); } } - printf(" \n"); } - printf(" "); writeline('-', 132); - } void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted, @@ -4204,7 +4161,6 @@ void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted, * Multispecies Phase */ bool zeroedPhase = true; - for (size_t irxn = 0; irxn < irxnl; ++irxn) { size_t kspec = m_indexRxnToSpecies[irxn]; if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { @@ -4237,7 +4193,6 @@ void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted, * For small dg_i, the expression below becomes: * 1 - sum_i(exp(-dg_i)/AC_i) ~ sum_i((dg_i-1)/AC_i) + 1 * - * * HKM -> The ratio of mole fractions at the reinstatement * time should be equal to the normalized weighting * of exp(-dg_i) / AC_i. This should be implemented. @@ -4254,8 +4209,7 @@ void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted, * * This can probably be solved by successive iteration. * This should be implemented. - */ - /* + * * Calculate dg[] for each species in a zeroed multispecies phase. * All of the dg[]'s will be equal. If dg[] is negative, then * the phase will come back into existence. @@ -4299,7 +4253,6 @@ void VCS_SOLVE::vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k */ vcs_VolPhase* pv1 = m_VolPhaseList[m_phaseID[k1]]; vcs_VolPhase* pv2 = m_VolPhaseList[m_phaseID[k2]]; - size_t kp1 = m_speciesLocalPhaseIndex[k1]; size_t kp2 = m_speciesLocalPhaseIndex[k2]; AssertThrowMsg(pv1->spGlobalIndexVCS(kp1) == k1, "VCS_SOLVE::vcs_switch_pos", @@ -4345,8 +4298,6 @@ void VCS_SOLVE::vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k /* * Handle the index pointer in the phase structures */ - - if (ifunc) { /* * Find the Rxn indices corresponding to the two species diff --git a/src/equil/vcs_solve_phaseStability.cpp b/src/equil/vcs_solve_phaseStability.cpp index 5dedad05b..24cc5b7b5 100644 --- a/src/equil/vcs_solve_phaseStability.cpp +++ b/src/equil/vcs_solve_phaseStability.cpp @@ -16,7 +16,6 @@ namespace Cantera int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStable) { - /* * ifunc determines the problem type */ @@ -30,10 +29,8 @@ int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStabl size_t nspecies0 = vprob->nspecies + 10; size_t nelements0 = vprob->ne; size_t nphase0 = vprob->NPhase; - vcs_initSizes(nspecies0, nelements0, nphase0); - if (ifunc < 0 || ifunc > 2) { plogf("vcs: Unrecognized value of ifunc, %d: bailing!\n", ifunc); @@ -63,7 +60,6 @@ int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStabl return retn; } - /* * This function is called to copy the current problem * into the current object's data structure. @@ -75,7 +71,6 @@ int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStabl return retn; } - /* * Prep the problem data for this particular instantiation of * the problem @@ -122,7 +117,6 @@ int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStabl */ iStab = vcs_solve_phaseStability(iphase, ifunc, feStable, printLvl); - /* * Redimensionalize the free energies using * the reverse of vcs_nondim to add back units. @@ -147,11 +141,9 @@ int VCS_SOLVE::vcs_solve_phaseStability(const int iph, const int ifunc, std::vector sm(m_numElemConstraints*m_numElemConstraints, 0.0); std::vector ss(m_numElemConstraints, 0.0); std::vector sa(m_numElemConstraints, 0.0); - std::vector aw(m_numSpeciesTot, 0.0); std::vector wx(m_numElemConstraints, 0.0); - vcs_basopt(false, &aw[0], &sa[0], &sm[0], &ss[0], test, &usedZeroedSpecies); vcs_evaluate_speciesType(); diff --git a/src/equil/vcs_species_thermo.cpp b/src/equil/vcs_species_thermo.cpp index 4229ab053..cabac81d6 100644 --- a/src/equil/vcs_species_thermo.cpp +++ b/src/equil/vcs_species_thermo.cpp @@ -20,7 +20,6 @@ namespace Cantera { VCS_SPECIES_THERMO::VCS_SPECIES_THERMO(size_t indexPhase, size_t indexSpeciesPhase) : - IndexPhase(indexPhase), IndexSpeciesPhase(indexSpeciesPhase), OwningPhase(0), diff --git a/src/fortran/cantera_funcs.f90 b/src/fortran/cantera_funcs.f90 index 6d7b382a0..3dec24a1a 100644 --- a/src/fortran/cantera_funcs.f90 +++ b/src/fortran/cantera_funcs.f90 @@ -24,7 +24,7 @@ module cantera_funcs else s = ctxml_child(root, 'phase') end if - + self = newThermoPhase(s) call newKinetics(s, self) diff --git a/src/fortran/cantera_kinetics.f90 b/src/fortran/cantera_kinetics.f90 index 71fbea0d0..04dfb5fb3 100644 --- a/src/fortran/cantera_kinetics.f90 +++ b/src/fortran/cantera_kinetics.f90 @@ -15,7 +15,7 @@ module cantera_kinetics type(phase_t), intent(in), optional :: neighbor2 type(phase_t), intent(in), optional :: neighbor3 type(phase_t), intent(in), optional :: neighbor4 - integer :: missing + integer :: missing missing = -1 if (present(neighbor1)) then diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index 75f26c40c..750b19f87 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -336,7 +336,6 @@ extern "C" { return 0; } - doublereal phase_natoms_(const integer* n, integer* k, integer* m) { try { @@ -592,7 +591,6 @@ extern "C" { } } - status_t th_getenthalpies_rt_(const integer* n, doublereal* h_rt) { try { @@ -626,7 +624,6 @@ extern "C" { return 0; } - //-------------- Kinetics ------------------// integer newkineticsfromxml_(integer* mxml, integer* iphase, @@ -1051,7 +1048,6 @@ extern "C" { return 0; } - status_t ctbuildsolutionfromxml(char* src, integer* ixml, char* id, integer* ith, integer* ikin, ftnlen lensrc, ftnlen lenid) { diff --git a/src/kinetics/BulkKinetics.cpp b/src/kinetics/BulkKinetics.cpp index a6bb5fdc4..7375a0ff8 100644 --- a/src/kinetics/BulkKinetics.cpp +++ b/src/kinetics/BulkKinetics.cpp @@ -14,7 +14,6 @@ BulkKinetics::BulkKinetics(thermo_t* thermo) : } } - Kinetics* BulkKinetics::duplMyselfAsKinetics(const std::vector & tpVector) const { BulkKinetics* kin = new BulkKinetics(*this); @@ -31,7 +30,6 @@ bool BulkKinetics::isReversible(size_t i) { } } - void BulkKinetics::getDeltaGibbs(doublereal* deltaG) { // Get the chemical potentials of the species in the ideal gas solution. diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index c740459d0..4d026d542 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -166,7 +166,6 @@ void GasKinetics::updateROP() { update_rates_C(); update_rates_T(); - if (m_ROP_ok) { return; } @@ -211,7 +210,6 @@ void GasKinetics::updateROP() AssertFinite(m_ropr[i], "GasKinetics::updateROP", "m_ropr[" + int2str(i) + "] is not finite."); } - m_ROP_ok = true; } diff --git a/src/kinetics/Group.cpp b/src/kinetics/Group.cpp index c43dbb237..0d51f01a4 100644 --- a/src/kinetics/Group.cpp +++ b/src/kinetics/Group.cpp @@ -16,7 +16,6 @@ namespace Cantera void Group::validate() { - size_t n = m_comp.size(); // if already checked and not valid, return diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index db233c244..19cde753f 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -53,7 +53,6 @@ ImplicitSurfChem::ImplicitSurfChem(vector k) : ntmax = std::max(nt, ntmax); m_specStartIndex.push_back(kinSpIndex); kinSpIndex += nsp; - size_t nPhases = kinPtr->nPhases(); vector_int pLocTmp(nPhases); size_t imatch = npos; @@ -74,7 +73,6 @@ ImplicitSurfChem::ImplicitSurfChem(vector k) : } } pLocVec.push_back(pLocTmp); - } m_numTotalSpecies = m_nv + m_numTotalBulkSpecies; m_concSpecies.resize(m_numTotalSpecies, 0.0); @@ -82,11 +80,8 @@ ImplicitSurfChem::ImplicitSurfChem(vector k) : m_integ = newIntegrator("CVODE"); - - // use backward differencing, with a full Jacobian computed // numerically, and use a Newton linear iterator - m_integ->setMethod(BDF_Method); m_integ->setProblemType(DENSE + NOJAC); m_integ->setIterator(Newton_Iter); @@ -245,7 +240,6 @@ void ImplicitSurfChem::solvePseudoSteadyStateProblem(int ifuncOverride, // Save the current solution copy(m_concSpecies.begin(), m_concSpecies.end(), m_concSpeciesSave.begin()); - int retn = m_surfSolver->solveSurfProb(ifunc, time_scale, TKelvin, PGas, reltol, atol); if (retn != 1) { @@ -255,7 +249,6 @@ void ImplicitSurfChem::solvePseudoSteadyStateProblem(int ifuncOverride, ifunc = SFLUX_INITIALIZE; retn = m_surfSolver->solveSurfProb(ifunc, time_scale, TKelvin, PGas, reltol, atol); - if (retn != 1) { throw CanteraError("ImplicitSurfChem::solvePseudoSteadyStateProblem", "solveSP return an error condition!"); diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 476d08156..de20d2366 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -293,11 +293,8 @@ void InterfaceKinetics::getEquilibriumConstants(doublereal* kc) { updateMu0(); doublereal rrt = 1.0 / (GasConstant * thermo(0).temperature()); - std::fill(kc, kc + nReactions(), 0.0); - getReactionDelta(DATA_PTR(m_mu0_Kc), kc); - for (size_t i = 0; i < nReactions(); i++) { kc[i] = exp(-kc[i]*rrt); } @@ -402,16 +399,13 @@ void InterfaceKinetics::convertExchangeCurrentDensityFormulation(doublereal* con // // We need to have the straight chemical reaction rate constant to come out of this calculation. if (m_ctrxn_BVform[i] == 0) { - // // Calculate the term and modify the forward reaction - // double tmp = exp(- m_beta[i] * m_deltaG0[irxn] * rrt); double tmp2 = m_ProdStanConcReac[irxn]; tmp *= 1.0 / tmp2 / Faraday; kfwd[irxn] *= tmp; } // If BVform is nonzero we don't need to do anything. - } else { // kfwd[] is the chemical reaction rate constant // @@ -419,7 +413,6 @@ void InterfaceKinetics::convertExchangeCurrentDensityFormulation(doublereal* con // We will calculate the exchange current density formulation here and // substitute it. if (m_ctrxn_BVform[i] != 0) { - // Calculate the term and modify the forward reaction rate constant so that // it's in the exchange current density formulation format double tmp = exp(m_beta[i] * m_deltaG0[irxn] * rrt); @@ -471,9 +464,8 @@ void InterfaceKinetics::updateROP() // Multiply by the perturbation factor multiply_each(m_ropf.begin(), m_ropf.end(), m_perturb.begin()); - // + // Copy the forward rate constants to the reverse rate constants - // copy(m_ropf.begin(), m_ropf.end(), m_ropr.begin()); // For reverse rates computed from thermochemistry, multiply @@ -492,16 +484,13 @@ void InterfaceKinetics::updateROP() double OCV = 0.0; for (size_t jrxn = 0; jrxn != nReactions(); ++jrxn) { if (reactionType(jrxn) == BUTLERVOLMER_RXN) { - // // OK, the reaction rate constant contains the current density rate constant calculation // the rxnstoich calculation contained the dependence of the current density on the activity concentrations // We finish up with the ROP calculation // // Calculate the overpotential of the reaction - // double nStoichElectrons=1; getDeltaGibbs(0); - if (nStoichElectrons != 0.0) { OCV = m_deltaG[jrxn]/Faraday/ nStoichElectrons; } @@ -572,7 +561,6 @@ void InterfaceKinetics::updateROP() } } } - m_ROP_ok = true; } @@ -757,7 +745,6 @@ bool InterfaceKinetics::addReaction(shared_ptr r_base) orders[kineticsSpeciesIndex(iter->first)] = iter->second; } } - } else { m_ctrxn_BVform.push_back(0); if (re->film_resistivity > 0.0) { @@ -892,7 +879,6 @@ SurfaceArrhenius InterfaceKinetics::buildSurfaceArrhenius( size_t k = thermo(reactionPhaseIndex()).speciesIndex(iter->first); rate.addCoverageDependence(k, iter->second.a, iter->second.m, iter->second.E); } - return rate; } @@ -946,7 +932,6 @@ void InterfaceKinetics::finalize() m_StandardConc.resize(m_kk, 0.0); m_deltaG0.resize(safe_reaction_size, 0.0); m_deltaG.resize(safe_reaction_size, 0.0); - m_ProdStanConcReac.resize(safe_reaction_size, 0.0); if (m_thermo.size() != m_phaseExists.size()) { @@ -962,7 +947,6 @@ void InterfaceKinetics::finalize() m_ropnet.resize(1, 0.0); m_rkcn.resize(1, 0.0); } - m_finalized = true; } @@ -1165,7 +1149,6 @@ void EdgeKinetics::finalize() m_ropnet.resize(1, 0.0); m_rkcn.resize(1, 0.0); } - m_finalized = true; } diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index c89357ac8..9ddff7265 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -51,9 +51,7 @@ Kinetics& Kinetics::operator=(const Kinetics& right) m_kk = right.m_kk; m_perturb = right.m_perturb; m_reactions = right.m_reactions; - m_thermo = right.m_thermo; // DANGER -> shallow pointer copy - m_start = right.m_start; m_phaseindex = right.m_phaseindex; m_surfphase = right.m_surfphase; @@ -74,7 +72,6 @@ Kinetics& Kinetics::operator=(const Kinetics& right) Kinetics* Kinetics::duplMyselfAsKinetics(const std::vector & tpVector) const { Kinetics* ko = new Kinetics(*this); - ko->assignShallowPointers(tpVector); return ko; } @@ -150,8 +147,6 @@ void Kinetics::assignShallowPointers(const std::vector & tpVector) } m_thermo[i] = tpVector[i]; } - - } std::pair Kinetics::checkDuplicates(bool throw_err) const @@ -183,7 +178,6 @@ std::pair Kinetics::checkDuplicates(bool throw_err) const // Compare this reaction to others with similar participants vector& related = participants[key]; - for (size_t m = 0; m < related.size(); m++) { Reaction& other = *m_reactions[related[m]]; if (R.reaction_type != other.reaction_type) { @@ -586,7 +580,6 @@ bool Kinetics::addReaction(shared_ptr r) } checkReactionBalance(*r); - size_t irxn = nReactions(); // index of the new reaction // indices of reactant and product species within this Kinetics object diff --git a/src/kinetics/KineticsFactory.cpp b/src/kinetics/KineticsFactory.cpp index 7445e5fed..2b8a505fd 100644 --- a/src/kinetics/KineticsFactory.cpp +++ b/src/kinetics/KineticsFactory.cpp @@ -4,7 +4,6 @@ // Copyright 2001 California Institute of Technology #include "cantera/kinetics/KineticsFactory.h" - #include "cantera/kinetics/GasKinetics.h" #include "cantera/kinetics/InterfaceKinetics.h" #include "cantera/kinetics/EdgeKinetics.h" diff --git a/src/kinetics/Reaction.cpp b/src/kinetics/Reaction.cpp index 62a5d262f..416e94f31 100644 --- a/src/kinetics/Reaction.cpp +++ b/src/kinetics/Reaction.cpp @@ -531,7 +531,6 @@ void setupElectrochemicalReaction(ElectrochemicalReaction& R, } getOptionalFloat(rxn_node, "filmResistivity", R.film_resistivity); - setupInterfaceReaction(R, rxn_node); // For Butler Volmer reactions, install the orders for the exchange current @@ -585,7 +584,6 @@ void setupElectrochemicalReaction(ElectrochemicalReaction& R, double c = getValue(initial_orders, iter->first, iter->second); R.orders[iter->first] += c * R.beta; } - } else { throw CanteraError("setupElectrochemicalReaction", "unknown model " "for reactionOrderFormulation XML_Node: '" + @@ -619,38 +617,31 @@ shared_ptr newReaction(const XML_Node& rxn_node) shared_ptr R(new ElementaryReaction()); setupElementaryReaction(*R, rxn_node); return R; - } else if (type == "threebody" || type == "three_body") { shared_ptr R(new ThreeBodyReaction()); setupThreeBodyReaction(*R, rxn_node); return R; - } else if (type == "falloff") { shared_ptr R(new FalloffReaction()); setupFalloffReaction(*R, rxn_node); return R; - } else if (type == "chemact" || type == "chemically_activated") { shared_ptr R(new ChemicallyActivatedReaction()); setupChemicallyActivatedReaction(*R, rxn_node); return R; - } else if (type == "plog" || type == "pdep_arrhenius") { shared_ptr R(new PlogReaction()); setupPlogReaction(*R, rxn_node); return R; - } else if (type == "chebyshev") { shared_ptr R(new ChebyshevReaction()); setupChebyshevReaction(*R, rxn_node); return R; - } else if (type == "interface" || type == "surface" || type == "edge" || type == "global") { shared_ptr R(new InterfaceReaction()); setupInterfaceReaction(*R, rxn_node); return R; - } else if (type == "electrochemical" || type == "butlervolmer_noactivitycoeffs" || type == "butlervolmer" || @@ -658,7 +649,6 @@ shared_ptr newReaction(const XML_Node& rxn_node) shared_ptr R(new ElectrochemicalReaction()); setupElectrochemicalReaction(*R, rxn_node); return R; - } else { throw CanteraError("newReaction", "Unknown reaction type '" + rxn_node["type"] + "'"); @@ -670,7 +660,6 @@ std::vector > getReactions(const XML_Node& node) std::vector > all_reactions; std::vector reaction_nodes = node.child("reactionData").getChildren("reaction"); - for (std::vector::iterator iter = reaction_nodes.begin(); iter != reaction_nodes.end(); ++iter) diff --git a/src/kinetics/ReactionPath.cpp b/src/kinetics/ReactionPath.cpp index 2c75988b9..01b6e5e5e 100644 --- a/src/kinetics/ReactionPath.cpp +++ b/src/kinetics/ReactionPath.cpp @@ -228,13 +228,11 @@ void ReactionPathDiagram::exportToDot(ostream& s) } Path* p; - size_t kbegin, kend, i1, i2, k1, k2; doublereal flx; // draw paths representing net flows if (flow_type == NetFlow) { - // if no scale was specified, normalize // net flows by the maximum net flow if (scale <= 0.0) { @@ -256,7 +254,6 @@ void ReactionPathDiagram::exportToDot(ostream& s) flmax = std::max(flmax, 1e-10); // loop over all unique pairs of nodes - for (i1 = 0; i1 < nNodes(); i1++) { k1 = m_speciesNumber[i1]; for (i2 = i1+1; i2 < nNodes(); i2++) { @@ -270,7 +267,6 @@ void ReactionPathDiagram::exportToDot(ostream& s) if (flx != 0.0) { // set beginning and end of the path based on the // sign of the net flow - if (flx > 0.0) { kbegin = k1; kend = k2; @@ -283,7 +279,6 @@ void ReactionPathDiagram::exportToDot(ostream& s) // write out path specification if the net flow // is greater than the threshold - if (flxratio >= threshold) { // make nodes visible node(kbegin)->visible = true; @@ -430,7 +425,6 @@ std::vector ReactionPathDiagram::species() int ReactionPathBuilder::findGroups(ostream& logfile, Kinetics& s) { m_groups.resize(m_nr); - for (size_t i = 0; i < m_nr; i++) { // loop over reactions logfile << endl << "Reaction " << i+1 << ": " << s.reactionString(i); @@ -448,7 +442,6 @@ int ReactionPathBuilder::findGroups(ostream& logfile, Kinetics& s) } Group b0, b1, bb; - vector& e = m_elementSymbols; if (m_determinate[i]) { @@ -515,7 +508,6 @@ int ReactionPathBuilder::findGroups(ostream& logfile, Kinetics& s) } } - if (b1.valid()) { if (b1.sign() > 0) { group_a1 = &r0; @@ -563,7 +555,6 @@ void ReactionPathBuilder::writeGroup(ostream& out, const Group& g) void ReactionPathBuilder::findElements(Kinetics& kin) { - string ename; m_enamemap.clear(); m_nel = 0; @@ -636,11 +627,9 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) m_reac.resize(m_nr); m_prod.resize(m_nr); - m_ropf.resize(m_nr); m_ropr.resize(m_nr); m_determinate.resize(m_nr); - m_x.resize(m_ns); // not currently used ? m_elatoms.resize(m_nel, m_nr); @@ -649,10 +638,8 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) map net; for (size_t i = 0; i < m_nr; i++) { - // construct the lists of reactant and product indices, not // including molecules that appear on both sides. - m_reac[i].clear(); m_prod[i].clear(); net.clear(); @@ -685,7 +672,6 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) // excluding molecules that appear on both sides of the // reaction. We only need to compute this for the reactants, // since the elements are conserved. - for (n = 0; n < nrnet; n++) { k = m_reac[i][n]; for (size_t m = 0; m < m_nel; m++) { @@ -704,7 +690,6 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) m_sgroup[j] = Group(comp); } - // determine whether or not the reaction is "determinate", meaning // that there is no ambiguity about which reactant is the source for // any element in any product. This is false if more than one @@ -712,7 +697,6 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) // contains the element. In this case, additional information is // needed to determine the partitioning of the reactant atoms of // that element among the products. - int nar, nap; for (size_t i = 0; i < m_nr; i++) { nr = m_reac[i].size(); @@ -765,12 +749,9 @@ int ReactionPathBuilder::build(Kinetics& s, const string& element, doublereal f, ropf, ropr, fwd, rev; string fwdlabel, revlabel; map warn; - doublereal threshold = 0.0; bool fwd_incl, rev_incl, force_incl; - size_t m = m_enamemap[element]-1; - r.element = element; if (m == npos) { return -1; @@ -803,7 +784,6 @@ int ReactionPathBuilder::build(Kinetics& s, const string& element, for (size_t kr = 0; kr < nr; kr++) { size_t kkr = m_reac[i][kr]; - fwdlabel = reactionLabel(i, kr, nr, m_reac[i], s); for (size_t kp = 0; kp < np; kp++) { @@ -820,23 +800,19 @@ int ReactionPathBuilder::build(Kinetics& s, const string& element, revlabel += " (+ M)"; } - // calculate the flow only for pairs that are // not the same species, both contain atoms of // element m, and both are allowed to appear in // the diagram - if ((kkr != kkp) && (m_atoms(kkr,m) > 0 && m_atoms(kkp,m) > 0) && status[kkr] >= 0 && status[kkp] >= 0) { - // if neither species contains the full // number of atoms of element m in the // reaction, then we must consider the // type of reaction to determine which // reactant species was the source of a // given m-atom in the product - if ((m_atoms(kkp,m) < m_elatoms(m, i)) && (m_atoms(kkr,m) < m_elatoms(m, i))) { map >& g = m_transfer[i]; diff --git a/src/kinetics/RxnRates.cpp b/src/kinetics/RxnRates.cpp index fc3823f4a..ecb0223eb 100644 --- a/src/kinetics/RxnRates.cpp +++ b/src/kinetics/RxnRates.cpp @@ -52,18 +52,18 @@ SurfaceArrhenius::SurfaceArrhenius(double A, double b, double Ta) } void SurfaceArrhenius::addCoverageDependence(size_t k, doublereal a, - doublereal m, doublereal e) { - m_ncov++; - m_sp.push_back(k); - m_ac.push_back(a); - m_ec.push_back(e); - if (m != 0.0) { - m_msp.push_back(k); - m_mc.push_back(m); - m_nmcov++; - } + doublereal m, doublereal e) +{ + m_ncov++; + m_sp.push_back(k); + m_ac.push_back(a); + m_ec.push_back(e); + if (m != 0.0) { + m_msp.push_back(k); + m_mc.push_back(m); + m_nmcov++; } - +} Plog::Plog(const std::multimap& rates) : logP_(-1000) diff --git a/src/kinetics/importKinetics.cpp b/src/kinetics/importKinetics.cpp index 3add8f5b8..e3a79c813 100644 --- a/src/kinetics/importKinetics.cpp +++ b/src/kinetics/importKinetics.cpp @@ -136,7 +136,6 @@ bool installReactionArrays(const XML_Node& p, Kinetics& kin, * the true number of reactions in the mechanism, itot. */ kin.finalize(); - return true; } @@ -166,7 +165,6 @@ bool importKinetics(const XML_Node& phase, std::vector th, // they must be listed in a 'phaseArray' child // element. Homogeneous mechanisms do not need to include a // phaseArray element. - vector phase_ids; if (phase.hasChild("phaseArray")) { const XML_Node& pa = phase.child("phaseArray"); @@ -180,19 +178,16 @@ bool importKinetics(const XML_Node& phase, std::vector th, // for each referenced phase, attempt to find its id among those // phases specified. bool phase_ok; - string phase_id; string msg = ""; for (int n = 0; n < np; n++) { phase_id = phase_ids[n]; phase_ok = false; - // loop over the supplied 'ThermoPhase' objects representing // phases, to find an object with the same id. for (int m = 0; m < nt; m++) { if (th[m]->id() == phase_id) { phase_ok = true; - // if no phase with this id has been added to //the kinetics manager yet, then add this one if (k->phaseIndex(phase_id) == npos) { diff --git a/src/kinetics/solveSP.cpp b/src/kinetics/solveSP.cpp index 57704f06b..2f8f44b91 100644 --- a/src/kinetics/solveSP.cpp +++ b/src/kinetics/solveSP.cpp @@ -69,7 +69,6 @@ solveSP::solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc) : size_t nsp = sp->nSpecies(); m_nSpeciesSurfPhase.push_back(nsp); m_numTotSurfSpecies += nsp; - } /* * We rely on ordering to figure things out @@ -89,15 +88,12 @@ solveSP::solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc) : } m_maxTotSpecies = std::max(m_maxTotSpecies, m_neq); - m_netProductionRatesSave.resize(m_maxTotSpecies, 0.0); m_numEqn1.resize(m_maxTotSpecies, 0.0); m_numEqn2.resize(m_maxTotSpecies, 0.0); m_XMolKinSpecies.resize(m_maxTotSpecies, 0.0); m_CSolnSave.resize(m_neq, 0.0); - m_spSurfLarge.resize(m_numSurfPhases, 0); - m_kinSpecIndex.resize(m_numTotSurfSpecies + m_numTotBulkSpeciesSS, 0); m_kinObjIndex.resize(m_numTotSurfSpecies + m_numTotBulkSpeciesSS, 0); m_eqnIndexStartSolnPhase.resize(m_numSurfPhases + m_numBulkPhasesSS, 0); @@ -149,7 +145,6 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, doublereal resid_norm; doublereal inv_t = 0.0; doublereal t_real = 0.0, update_norm = 1.0E6; - bool do_time = false, not_converged = true; m_ioflag = std::min(m_ioflag, 1); @@ -234,7 +229,6 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, /* * Check end condition */ - if (ifunc == SFLUX_TRANSIENT) { tmp = t_real + 1.0/inv_t; if (tmp > time_scale) { @@ -313,7 +307,6 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, * between 0 and 1, and not allow too large a change (factor of 2) * in any unknown. */ - damp = calc_damping(DATA_PTR(m_CSolnSP), DATA_PTR(m_resid), m_neq, &label_d); /* @@ -462,7 +455,6 @@ void solveSP::fun_eval(doublereal* resid, const doublereal* CSoln, * HKM Should do it here for all kinetics objects so that * bulk will eventually work. */ - if (do_time) { kindexSP = 0; for (isp = 0; isp < m_numSurfPhases; isp++) { @@ -618,15 +610,12 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i const doublereal APPROACH = 0.80; doublereal damp = 1.0, xnew, xtop, xbot; static doublereal damp_old = 1.0; - *label = -1; for (size_t i = 0; i < dim; i++) { - /* * Calculate the new suggested new value of x[i] */ - xnew = x[i] - damp * dxneg[i]; /* @@ -634,7 +623,6 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i * - Only going to allow x[i] to converge to zero by a * single order of magnitude at a time */ - xtop = 1.0 - 0.1*fabs(1.0-x[i]); xbot = fabs(x[i]*0.1) - 1.0e-16; if (xnew > xtop) { @@ -653,7 +641,6 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i * Only allow the damping parameter to increase by a factor of three each * iteration. Heuristic to avoid oscillations in the value of damp */ - if (damp > damp_old*3) { damp = damp_old*3; *label = -1; @@ -663,7 +650,6 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i * Save old value of the damping parameter for use * in subsequent calls. */ - damp_old = damp; return damp; @@ -750,9 +736,7 @@ doublereal solveSP::calc_t(doublereal netProdRateSolnSP[], size_t surfIndex = m_kin->surfacePhaseIndex(); kstart = m_kin->kineticsSpeciesIndex(0, surfIndex); ThermoPhase& THref = m_kin->thermo(surfIndex); - m_kin->getNetProductionRates(DATA_PTR(m_numEqn1)); - sden = THref.molarDensity(); for (k = 0; k < nsp; k++, kindexSP++) { size_t kspindex = kstart + k; diff --git a/src/matlab/ctfunctions.cpp b/src/matlab/ctfunctions.cpp index 17fe73f71..56f4f0e38 100644 --- a/src/matlab/ctfunctions.cpp +++ b/src/matlab/ctfunctions.cpp @@ -35,7 +35,6 @@ void ctfunctions(int nlhs, mxArray* plhs[], char* output_buf = 0; switch (job) { - // convert CK file to CTI case 1: if (nrhs < 8) { diff --git a/src/matlab/ctmethods.cpp b/src/matlab/ctmethods.cpp index 25167ba33..37f43147a 100644 --- a/src/matlab/ctmethods.cpp +++ b/src/matlab/ctmethods.cpp @@ -83,7 +83,6 @@ void initLogger() } } - extern "C" { void mexFunction(int nlhs, mxArray* plhs[], diff --git a/src/matlab/flowdevicemethods.cpp b/src/matlab/flowdevicemethods.cpp index d07b782bf..2f13e0620 100644 --- a/src/matlab/flowdevicemethods.cpp +++ b/src/matlab/flowdevicemethods.cpp @@ -31,7 +31,6 @@ void flowdevicemethods(int nlhs, mxArray* plhs[], if (job < 20) { switch (job) { - case 1: iok = flowdev_del(i); break; diff --git a/src/matlab/kineticsmethods.cpp b/src/matlab/kineticsmethods.cpp index e347a84f6..0de6d1da0 100644 --- a/src/matlab/kineticsmethods.cpp +++ b/src/matlab/kineticsmethods.cpp @@ -43,9 +43,7 @@ void kineticsmethods(int nlhs, mxArray* plhs[], // get scalar attributes if (job < 10) { - switch (job) { - case 1: vv = (double) kin_nReactions(kin); break; @@ -72,7 +70,6 @@ void kineticsmethods(int nlhs, mxArray* plhs[], *h = vv; return; } else if (job < 20) { - // get reaction array attributes mwSize nr = (mwSize) kin_nReactions(kin); plhs[0] = mxCreateNumericMatrix(nr,1,mxDOUBLE_CLASS,mxREAL); diff --git a/src/matlab/mixturemethods.cpp b/src/matlab/mixturemethods.cpp index 54b19959e..4d37cd5fc 100644 --- a/src/matlab/mixturemethods.cpp +++ b/src/matlab/mixturemethods.cpp @@ -39,7 +39,6 @@ void mixturemethods(int nlhs, mxArray* plhs[], int maxiter, maxsteps, loglevel; if (job < 15) { switch (job) { - case 1: iok = mix_del(i); break; @@ -167,4 +166,3 @@ void mixturemethods(int nlhs, mxArray* plhs[], } } } - diff --git a/src/matlab/onedimmethods.cpp b/src/matlab/onedimmethods.cpp index d9b4e8c8c..6c7840cff 100644 --- a/src/matlab/onedimmethods.cpp +++ b/src/matlab/onedimmethods.cpp @@ -16,19 +16,16 @@ void onedimmethods(int nlhs, mxArray* plhs[], double* dom_ids, *h; int indx = 0; char* nm; - int dom; dom = getInt(prhs[1]); - int idom, icomp, localPoint; if (job < 10) { int ph, kin, tr, itype; size_t sz, nd; switch (job) { - - // construct a new stagnation flow instance case 1: + // construct a new stagnation flow instance checkNArgs(7, nrhs); ph = getInt(prhs[3]); kin = getInt(prhs[4]); @@ -36,40 +33,34 @@ void onedimmethods(int nlhs, mxArray* plhs[], itype = getInt(prhs[6]); indx = stflow_new(ph, kin, tr, itype); break; - - // construct a new Inlet1D instance case 2: + // construct a new Inlet1D instance checkNArgs(3, nrhs); indx = inlet_new(); break; - - // construct a new Surf1D instance case 3: + // construct a new Surf1D instance checkNArgs(3, nrhs); indx = surf_new(); break; - - // construct a new Symm1D instance case 4: + // construct a new Symm1D instance checkNArgs(3, nrhs); indx = symm_new(); break; - - // construct a new Outlet1D instance case 5: + // construct a new Outlet1D instance checkNArgs(3, nrhs); indx = outlet_new(); break; - - // construct a new ReactingSurf1D instance case 6: + // construct a new ReactingSurf1D instance checkNArgs(4, nrhs); indx = reactingsurf_new(); reactingsurf_setkineticsmgr(indx, getInt(prhs[3])); break; - - // construct a new Sim1D instance case 8: { + // construct a new Sim1D instance checkNArgs(5, nrhs); nd = getInt(prhs[3]); dom_ids = mxGetPr(prhs[4]); @@ -387,7 +378,6 @@ void onedimmethods(int nlhs, mxArray* plhs[], onoff = getInt(prhs[3]); iok = reactingsurf_enableCoverageEqs(dom, onoff); break; - default: mexPrintf(" job = %d ",job); mexErrMsgTxt("unknown parameter"); diff --git a/src/matlab/phasemethods.cpp b/src/matlab/phasemethods.cpp index 508700790..a28b2f097 100644 --- a/src/matlab/phasemethods.cpp +++ b/src/matlab/phasemethods.cpp @@ -109,8 +109,8 @@ void phasemethods(int nlhs, mxArray* plhs[], case 0: vv = (double) newThermoFromXML(ph); break; - // floating-point attributes case 1: + // floating-point attributes vv = phase_temperature(ph); break; case 2: diff --git a/src/matlab/reactormethods.cpp b/src/matlab/reactormethods.cpp index 21b099a55..5bdc06f6d 100644 --- a/src/matlab/reactormethods.cpp +++ b/src/matlab/reactormethods.cpp @@ -10,10 +10,8 @@ void reactormethods(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) { int iok = 0, n; - int job = getInt(prhs[1]); int i = getInt(prhs[2]); - double r = Undef; double v = Undef; if (nrhs > 3) { @@ -33,7 +31,6 @@ void reactormethods(int nlhs, mxArray* plhs[], } // options that do not return a value - if (job < 20) { switch (job) { case 1: @@ -106,4 +103,3 @@ void reactormethods(int nlhs, mxArray* plhs[], return; } } - diff --git a/src/matlab/reactornetmethods.cpp b/src/matlab/reactornetmethods.cpp index acdc88810..85f35200d 100644 --- a/src/matlab/reactornetmethods.cpp +++ b/src/matlab/reactornetmethods.cpp @@ -12,7 +12,6 @@ void reactornetmethods(int nlhs, mxArray* plhs[], int iok = 0, n; int job = getInt(prhs[1]); int i = getInt(prhs[2]); - double r = Undef; double v = Undef; double v2 = -1.0; @@ -36,10 +35,8 @@ void reactornetmethods(int nlhs, mxArray* plhs[], } // options that do not return a value - if (job < 20) { switch (job) { - case 1: iok = reactornet_del(i); break; diff --git a/src/matlab/surfmethods.cpp b/src/matlab/surfmethods.cpp index c2dd05975..15d7b29d4 100644 --- a/src/matlab/surfmethods.cpp +++ b/src/matlab/surfmethods.cpp @@ -6,7 +6,6 @@ #include "clib/ct.h" using namespace std; - using namespace Cantera; void surfmethods(int nlhs, mxArray* plhs[], @@ -22,15 +21,12 @@ void surfmethods(int nlhs, mxArray* plhs[], // set parameters if (job < 100) { - switch (job) { - case 1: checkNArgs(4, nrhs); vv = getDouble(prhs[3]); iok = surf_setsitedensity(surf, vv); break; - case 3: checkNArgs(4, nrhs); ptr = mxGetPr(prhs[3]); @@ -43,13 +39,11 @@ void surfmethods(int nlhs, mxArray* plhs[], mexErrMsgTxt("wrong array size for coverages"); } break; - case 5: checkNArgs(4, nrhs); str = getString(prhs[3]); iok = surf_setcoveragesbyname(surf, str); break; - default: mexErrMsgTxt("unknown job"); } diff --git a/src/matlab/transportmethods.cpp b/src/matlab/transportmethods.cpp index 0c6d5747f..50b4d7438 100644 --- a/src/matlab/transportmethods.cpp +++ b/src/matlab/transportmethods.cpp @@ -31,7 +31,6 @@ void transportmethods(int nlhs, mxArray* plhs[], return; } - if (job < 10) { switch (job) { case 0: @@ -43,7 +42,7 @@ void transportmethods(int nlhs, mxArray* plhs[], break; case 2: vv = trans_thermalConductivity(n); - break; + break; case 3: vv = trans_electricalConductivity(n); break; diff --git a/src/matlab/wallmethods.cpp b/src/matlab/wallmethods.cpp index 6211f41fb..f7646a76d 100644 --- a/src/matlab/wallmethods.cpp +++ b/src/matlab/wallmethods.cpp @@ -12,7 +12,6 @@ void wallmethods(int nlhs, mxArray* plhs[], int m, iok = 0, n; int job = getInt(prhs[1]); int i = getInt(prhs[2]); - double r = Undef; double v = Undef; if (nrhs > 3) { @@ -107,4 +106,3 @@ void wallmethods(int nlhs, mxArray* plhs[], return; } } - diff --git a/src/matlab/xmlmethods.cpp b/src/matlab/xmlmethods.cpp index b4f128d3a..cc805bde8 100644 --- a/src/matlab/xmlmethods.cpp +++ b/src/matlab/xmlmethods.cpp @@ -41,7 +41,6 @@ void xmlmethods(int nlhs, mxArray* plhs[], { int j, m, iok = 0; char* file, *key, *val, *nm; - int job = getInt(prhs[1]); int i = getInt(prhs[2]); diff --git a/src/numerics/CVodeInt.cpp b/src/numerics/CVodeInt.cpp index eb0e56753..1be2ef73c 100644 --- a/src/numerics/CVodeInt.cpp +++ b/src/numerics/CVodeInt.cpp @@ -53,7 +53,6 @@ extern "C" { double* fydata = N_VDATA(fy); double* ewtdata = N_VDATA(ewt); double* ydot = N_VDATA(vtemp1); - Cantera::FuncEval* func = (Cantera::FuncEval*)f_data; int i,j; diff --git a/src/numerics/CVodeInt.h b/src/numerics/CVodeInt.h index d6fc775a1..d65d34f85 100644 --- a/src/numerics/CVodeInt.h +++ b/src/numerics/CVodeInt.h @@ -78,7 +78,6 @@ private: int m_nabs; double m_hmax, m_hmin; int m_maxsteps; - vector_fp m_ropt; long int* m_iopt; void* m_data; diff --git a/src/numerics/CVodesIntegrator.cpp b/src/numerics/CVodesIntegrator.cpp index 3adb6100f..c1a7f45e0 100644 --- a/src/numerics/CVodesIntegrator.cpp +++ b/src/numerics/CVodesIntegrator.cpp @@ -23,7 +23,6 @@ using namespace std; #include "cvodes/cvodes_diag.h" #include "cvodes/cvodes_spgmr.h" - #define CV_SS 1 #define CV_SV 2 @@ -51,7 +50,6 @@ public: }; extern "C" { - /** * Function called by cvodes to evaluate ydot given y. The CVODE * integrator allows passing in a void* pointer to access @@ -345,7 +343,6 @@ void CVodesIntegrator::initialize(double t0, FuncEval& func) applyOptions(); } - void CVodesIntegrator::reinitialize(double t0, FuncEval& func) { m_t0 = t0; @@ -354,7 +351,6 @@ void CVodesIntegrator::reinitialize(double t0, FuncEval& func) NV_DATA_S(m_y)); int result; - result = CVodeReInit(m_cvode_mem, m_t0, m_y); if (result != CV_SUCCESS) { throw CVodesErr("CVodeReInit failed. result = "+int2str(result)); diff --git a/src/numerics/DAE_solvers.cpp b/src/numerics/DAE_solvers.cpp index 9f89d88c0..fa2981d78 100644 --- a/src/numerics/DAE_solvers.cpp +++ b/src/numerics/DAE_solvers.cpp @@ -35,5 +35,4 @@ DAE_Solver* newDAE_Solver(const std::string& itype, ResidJacEval& f) } } -# #endif diff --git a/src/numerics/IDA_Solver.cpp b/src/numerics/IDA_Solver.cpp index d83454d42..3199fdaa9 100644 --- a/src/numerics/IDA_Solver.cpp +++ b/src/numerics/IDA_Solver.cpp @@ -33,9 +33,7 @@ namespace Cantera */ class ResidData { - public: - ResidData(ResidJacEval* f, IDA_Solver* s, int npar = 0) { m_func = f; m_solver = s; @@ -345,9 +343,6 @@ void IDA_Solver::init(doublereal t0) m_ida_mem = IDACreate(); int flag = 0; - - - if (m_itol == IDA_SV) { flag = IDAInit(m_ida_mem, ida_resid, m_t0, m_y, m_ydot); if (flag != IDA_SUCCESS) { @@ -481,7 +476,6 @@ void IDA_Solver::correctInitial_Y_given_Yp(doublereal* y, doublereal* yp, doubl throw IDA_Err("IDACalcIC failed: error = " + int2str(flag)); } - flag = IDAGetConsistentIC(m_ida_mem, m_y, m_ydot); if (flag != IDA_SUCCESS) { throw IDA_Err("IDAGetSolution failed: error = " + int2str(flag)); @@ -512,7 +506,6 @@ void IDA_Solver::correctInitial_YaYp_given_Yd(doublereal* y, doublereal* yp, dou throw IDA_Err("IDACalcIC failed: error = " + int2str(flag)); } - flag = IDAGetConsistentIC(m_ida_mem, m_y, m_ydot); if (flag != IDA_SUCCESS) { throw IDA_Err("IDAGetSolution failed: error = " + int2str(flag)); diff --git a/src/numerics/ODE_integrators.cpp b/src/numerics/ODE_integrators.cpp index 4b480ae0e..8c2c659c6 100644 --- a/src/numerics/ODE_integrators.cpp +++ b/src/numerics/ODE_integrators.cpp @@ -2,7 +2,6 @@ #include "cantera/base/ct_defs.h" #include "cantera/numerics/Integrator.h" - #ifdef HAS_SUNDIALS #include "cantera/numerics/CVodesIntegrator.h" #else diff --git a/src/numerics/ResidJacEval.cpp b/src/numerics/ResidJacEval.cpp index 3e37cead3..4b64d364e 100644 --- a/src/numerics/ResidJacEval.cpp +++ b/src/numerics/ResidJacEval.cpp @@ -85,7 +85,7 @@ void ResidJacEval::user_out(const int ifunc, const doublereal t, user_out2(ifunc, t, 0.0, y, ydot); } -int ResidJacEval::evalTimeTrackingEqns(const doublereal t, +int ResidJacEval::evalTimeTrackingEqns(const doublereal t, const doublereal delta_t, const doublereal* y, const doublereal* ydot) @@ -93,7 +93,7 @@ int ResidJacEval::evalTimeTrackingEqns(const doublereal t, return 1; } -int ResidJacEval::calcDeltaSolnVariables(const doublereal t, +int ResidJacEval::calcDeltaSolnVariables(const doublereal t, const doublereal* const ySoln, const doublereal* const ySolnDot, doublereal* const deltaYSoln, @@ -111,7 +111,7 @@ int ResidJacEval::calcDeltaSolnVariables(const doublereal t, return 1; } -void ResidJacEval::calcSolnScales(const doublereal t, +void ResidJacEval::calcSolnScales(const doublereal t, const doublereal* const ysoln, const doublereal* const ysolnOld, doublereal* const ysolnScales) @@ -151,7 +151,7 @@ int ResidJacEval::matrixConditioning(doublereal* const matrix, const int nrows, int ResidJacEval::evalResidNJ(const doublereal t, const doublereal deltaT, const doublereal* y, const doublereal* ydot, - doublereal* const resid, + doublereal* const resid, const ResidEval_Type_Enum evalType, const int id_x, const doublereal delta_x) { @@ -176,7 +176,7 @@ int ResidJacEval::evalJacobian(const doublereal t, const doublereal delta_t, } int ResidJacEval::evalJacobianDP(const doublereal t, const doublereal delta_t, - const doublereal c_j, + const doublereal c_j, const doublereal* const y, const doublereal* const ydot, doublereal* const* jac_colPts, diff --git a/src/numerics/RootFind.cpp b/src/numerics/RootFind.cpp index 4659d204e..7dae79792 100644 --- a/src/numerics/RootFind.cpp +++ b/src/numerics/RootFind.cpp @@ -187,7 +187,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun int doFinalFuncCall = 0; doublereal x1, x2, xnew, f1, f2, fnew, slope; doublereal deltaX2 = 0.0, deltaXnew = 0.0; - int posStraddle = 0; int retn = ROOTFIND_FAILEDCONVERGENCE; int foundPosF = 0; @@ -302,7 +301,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun /* * Now, this is actually a tricky part of the algorithm - Find the x value for * the second point. It's tricky because we don't have a valid idea of the scale of x yet - * */ rfT.reasoning = "Second Point: "; if (x1 == 0.0) { @@ -338,8 +336,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun fnorm = 0.5*(fabs(f1) + fabs(f2)) + fabs(m_funcTargetValue) + m_atolf; } fnoise = 1.0E-100; - - if (f2 > fnoise) { if (!foundPosF) { foundPosF = 1; @@ -363,7 +359,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun rfT.foundPos = foundPosF; rfT.foundNeg = foundNegF; - /* * See if we have already achieved a straddle */ @@ -499,8 +494,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun } /* * OK, we have an estimate xnew. - * - * * Put heuristic bounds on the step jump */ if ((xnew > x1 && xnew < x2) || (xnew < x1 && xnew > x2)) { @@ -865,7 +858,6 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun } } - /* * Check for excess convergence in the x coordinate */ @@ -998,9 +990,7 @@ done: rfT.reasoning += "CONVERGENCE: NormalEnding -> Last point used"; } } else { - *xbest = x2; - rfT.xval = *xbest; rfT.fval = f2; rfT.delX = fabs(x2 - x1); diff --git a/src/numerics/SquareMatrix.cpp b/src/numerics/SquareMatrix.cpp index 36e6c1e4c..10cf1f26f 100644 --- a/src/numerics/SquareMatrix.cpp +++ b/src/numerics/SquareMatrix.cpp @@ -30,7 +30,6 @@ SquareMatrix::SquareMatrix(size_t n, doublereal v) : GeneralMatrix(0), a1norm_(0.0), useQR_(0) - { } @@ -163,8 +162,6 @@ int SquareMatrix::factorQR() if (lworkOpt > lwork) { work.resize(lworkOpt); } - - return info; } @@ -206,7 +203,6 @@ int SquareMatrix::solveQR(doublereal* b) } char dd = 'N'; - ct_dtrtrs(ctlapack::UpperTriangular, ctlapack::NoTranspose, &dd, m_nrows, 1, &*begin(), m_nrows, b, m_nrows, info); if (info != 0) { @@ -217,13 +213,11 @@ int SquareMatrix::solveQR(doublereal* b) throw CELapackError("SquareMatrix::solveQR()", "DTRTRS returned INFO = " + int2str(info)); } } - return info; } doublereal SquareMatrix::rcond(doublereal anorm) { - if (iwork_.size() < m_nrows) { iwork_.resize(m_nrows); } @@ -256,7 +250,6 @@ doublereal SquareMatrix::oneNorm() const doublereal SquareMatrix::rcondQR() { - if (iwork_.size() < m_nrows) { iwork_.resize(m_nrows); } diff --git a/src/numerics/funcs.cpp b/src/numerics/funcs.cpp index 34b76efc0..3eecf0ce5 100644 --- a/src/numerics/funcs.cpp +++ b/src/numerics/funcs.cpp @@ -64,29 +64,23 @@ doublereal linearInterp(doublereal x, const vector_fp& xpts, * point C. * * @param n The number of data points. - * * @param x A set of grid points on which the data is specified. * The array of values of the independent variable. These * values may appear in any order and need not all be * distinct. There are n of them. - * * @param y array of corresponding function values. There are n of them - * * @param w array of positive values to be used as weights. If * W[0] is negative, DPOLFT will set all the weights * to 1.0, which means unweighted least squares error * will be minimized. To minimize relative error, the * user should set the weights to: W(I) = 1.0/Y(I)**2, * I = 1,...,N . - * * @param maxdeg maximum degree to be allowed for polynomial fit. * MAXDEG may be any non-negative integer less than N. * Note -- MAXDEG cannot be equal to N-1 when a * statistical test is to be used for degree selection, * i.e., when input value of EPS is negative. - * * @param ndeg output degree of the fit computed. - * * @param eps Specifies the criterion to be used in determining * the degree of fit to be computed. * (1) If EPS is input negative, DPOLFT chooses the @@ -106,12 +100,10 @@ doublereal linearInterp(doublereal x, const vector_fp& xpts, * fitted polynomial. DPOLFT will increase the * degree of fit until this criterion is met or * until the maximum degree is reached. - * * @param r Output vector containing the first LL+1 Taylor coefficients * where LL=ABS(ndeg). * P(X) = r[0] + r[1]*(X-C) + ... + r[ndeg] * (X-C)**ndeg * ( here C = 0.0) - * * @return returns the RMS error of the polynomial of degree ndeg . */ doublereal polyfit(int n, doublereal* x, doublereal* y, doublereal* w, int maxdeg, int& ndeg, doublereal eps, doublereal* r) diff --git a/src/oneD/Domain1D.cpp b/src/oneD/Domain1D.cpp index 651444045..5951673d7 100644 --- a/src/oneD/Domain1D.cpp +++ b/src/oneD/Domain1D.cpp @@ -50,7 +50,6 @@ void Domain1D::needJacUpdate() void Domain1D::eval(size_t jg, doublereal* xg, doublereal* rg, integer* mask, doublereal rdt) { - if (jg != npos && (jg + 1 < firstPoint() || jg > lastPoint() + 1)) { return; } diff --git a/src/oneD/MultiJac.cpp b/src/oneD/MultiJac.cpp index 3df607160..9c322ff39 100644 --- a/src/oneD/MultiJac.cpp +++ b/src/oneD/MultiJac.cpp @@ -58,7 +58,6 @@ void MultiJac::eval(doublereal* x0, doublereal* resid0, doublereal rdt) for (j = 0; j < m_points; j++) { nv = m_resid->nVars(j); for (n = 0; n < nv; n++) { - // perturb x(n) xsave = x0[ipt]; dx = m_atol + fabs(xsave)*m_rtol; @@ -75,15 +74,13 @@ void MultiJac::eval(doublereal* x0, doublereal* resid0, doublereal rdt) mv = m_resid->nVars(i); iloc = m_resid->loc(i); for (m = 0; m < mv; m++) { - value(m+iloc,ipt) = (m_r1[m+iloc] - - resid0[m+iloc])*rdx; + value(m+iloc,ipt) = (m_r1[m+iloc] - resid0[m+iloc])*rdx; } } } x0[ipt] = xsave; ipt++; } - } for (n = 0; n < m_size; n++) { diff --git a/src/oneD/MultiNewton.cpp b/src/oneD/MultiNewton.cpp index a2f387ff5..4f1f948ef 100644 --- a/src/oneD/MultiNewton.cpp +++ b/src/oneD/MultiNewton.cpp @@ -111,8 +111,7 @@ doublereal bound_step(const doublereal* x, const doublereal* step, * Here \f$\epsilon_{r,n} \f$ is the relative error tolerance for * component n, and multiplies the average magnitude of * solution component n in the domain. The second term, - * \f$\epsilon_{a,n}\f$, is the absolute error tolerance for component - * n. + * \f$\epsilon_{a,n}\f$, is the absolute error tolerance for component n. */ doublereal norm_square(const doublereal* x, const doublereal* step, Domain1D& r) @@ -191,7 +190,6 @@ void MultiNewton::step(doublereal* x, doublereal* step, } iok = jac.solve(step, step); - // if iok is non-zero, then solve failed if (iok != 0) { iok--; @@ -259,19 +257,15 @@ int MultiNewton::dampStep(const doublereal* x0, const doublereal* step0, return -3; } - //-------------------------------------------- // Attempt damped step //-------------------------------------------- // damping coefficient starts at 1.0 doublereal damp = 1.0; - doublereal ff; - size_t m; for (m = 0; m < NDAMP; m++) { - ff = fbound*damp; // step the solution by the damped step size @@ -301,7 +295,6 @@ int MultiNewton::dampStep(const doublereal* x0, const doublereal* step0, // accept this damping coefficient. Also accept it if this // step would result in a converged solution. Otherwise, // decrease the damping coefficient and try again. - if (s1 < 1.0 || s1 < s0) { break; } diff --git a/src/oneD/OneDim.cpp b/src/oneD/OneDim.cpp index 3bfdef712..e8c677b87 100644 --- a/src/oneD/OneDim.cpp +++ b/src/oneD/OneDim.cpp @@ -1,7 +1,6 @@ //! @file OneDim.cpp #include "cantera/oneD/MultiNewton.h" #include "cantera/oneD/OneDim.h" - #include "cantera/numerics/Func1.h" #include "cantera/base/ctml.h" diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index e46d87013..c5a994ae2 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -20,7 +20,6 @@ Sim1D::Sim1D(vector& domains) : { // resize the internal solution vector and the work array, and perform // domain-specific initialization of the solution vector. - m_x.resize(size(), 0.0); m_xnew.resize(size(), 0.0); for (size_t n = 0; n < m_nd; n++) { @@ -78,7 +77,6 @@ doublereal Sim1D::workValue(size_t dom, size_t comp, size_t localPoint) const void Sim1D::setProfile(size_t dom, size_t comp, const vector_fp& pos, const vector_fp& values) { - Domain1D& d = domain(dom); doublereal z0 = d.zmin(); doublereal z1 = d.zmax(); @@ -351,7 +349,6 @@ int Sim1D::refine(int loglevel) size_t npnow = d.nPoints(); size_t nstart = znew.size(); for (size_t m = 0; m < npnow; m++) { - if (r.keepPoint(m)) { // add the current grid point to the new grid znew.push_back(d.grid(m)); @@ -364,9 +361,7 @@ int Sim1D::refine(int loglevel) // now check whether a new point is needed in the // interval to the right of point m, and if so, add // entries to znew and xnew for this new point - if (r.newPointNeeded(m) && m + 1 < npnow) { - // add new point at midpoint zmid = 0.5*(d.grid(m) + d.grid(m+1)); znew.push_back(zmid); @@ -422,11 +417,9 @@ int Sim1D::setFixedTemperature(doublereal t) size_t m1 = 0; std::vector dsize; - for (n = 0; n < m_nd; n++) { bool addnewpt=false; Domain1D& d = domain(n); - size_t comp = d.nComponents(); // loop over points in the current grid to determine where new point is needed. @@ -478,8 +471,6 @@ int Sim1D::setFixedTemperature(doublereal t) xnew.push_back(xmid); } } - - } dsize.push_back(znew.size() - nstart); } @@ -488,7 +479,6 @@ int Sim1D::setFixedTemperature(doublereal t) // vector xnew have been constructed, but the domains // themselves have not yet been modified. Now update each // domain with the new grid. - size_t gridstart = 0, gridsize; for (n = 0; n < m_nd; n++) { Domain1D& d = domain(n); @@ -503,9 +493,7 @@ int Sim1D::setFixedTemperature(doublereal t) // resize the work array m_xnew.resize(xnew.size()); - copy(xnew.begin(), xnew.end(), m_xnew.begin()); - resize(); finalize(); return np; diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 06c4c2827..40c8d7904 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -30,7 +30,6 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) : m_do_radiation(false) { m_type = cFlowType; - m_points = points; m_thermo = ph; @@ -44,7 +43,6 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) : Domain1D::resize(m_nsp+4, points); } - // make a local copy of the species molecular weight vector m_wt = m_thermo->molecularWeights(); @@ -67,7 +65,6 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) : m_qdotRadiation.resize(m_points, 0.0); //-------------- default solution bounds -------------------- - setBounds(0, -1e20, 1e20); // no bounds on u setBounds(1, -1e20, 1e20); // V setBounds(2, 200.0, 1e9); // temperature bounds @@ -240,7 +237,6 @@ void StFlow::eval(size_t jg, doublereal* xg, integer* diag = diagg + loc(); size_t jmin, jmax; - if (jg == npos) { // evaluate all points jmin = 0; jmax = m_points - 1; @@ -270,12 +266,10 @@ void StFlow::eval(size_t jg, doublereal* xg, // Jacobian is being evaluated updateDiffFluxes(x, j0, j1); - //---------------------------------------------------- // evaluate the residual equations at all required // grid points //---------------------------------------------------- - doublereal sum, sum2, dtdzj; // calculation of qdotRadiation @@ -349,7 +343,6 @@ void StFlow::eval(size_t jg, doublereal* xg, //---------------------------------------------- if (j == 0) { - // these may be modified by a boundary object // Continuity. This propagates information right-to-left, @@ -380,7 +373,6 @@ void StFlow::eval(size_t jg, doublereal* xg, rsd[index(c_offset_Y, 0)] = 1.0 - sum; } else if (j == m_points - 1) { evalRightBoundary(x, rsd, diag, rdt); - } else { // interior points evalContinuity(j, x, rsd, diag, rdt); @@ -389,7 +381,6 @@ void StFlow::eval(size_t jg, doublereal* xg, // // \rho dV/dt + \rho u dV/dz + \rho V^2 // = d(\mu dV/dz)/dz - lambda - // //------------------------------------------------- rsd[index(c_offset_V,j)] = (shear(x,j) - lambda(x,j) - rho_u(x,j)*dVdz(x,j) @@ -402,10 +393,8 @@ void StFlow::eval(size_t jg, doublereal* xg, // // \rho dY_k/dt + \rho u dY_k/dz + dJ_k/dz // = M_k\omega_k - // //------------------------------------------------- getWdot(x,j); - doublereal convec, diffus; for (k = 0; k < m_nsp; k++) { convec = rho_u(x,j)*dYdz(x,k,j); @@ -426,15 +415,12 @@ void StFlow::eval(size_t jg, doublereal* xg, // - sum_k(\omega_k h_k_ref) // - sum_k(J_k c_p_k / M_k) dT/dz //----------------------------------------------- - if (m_do_energy[j]) { - setGas(x,j); // heat release term const vector_fp& h_RT = m_thermo->enthalpy_RT_ref(); const vector_fp& cp_R = m_thermo->cp_R_ref(); - sum = 0.0; sum2 = 0.0; doublereal flxk; @@ -451,7 +437,6 @@ void StFlow::eval(size_t jg, doublereal* xg, - m_cp[j]*rho_u(x,j)*dtdzj - divHeatFlux(x,j) - sum - sum2; rsd[index(c_offset_T, j)] /= (m_rho[j]*m_cp[j]); - rsd[index(c_offset_T, j)] -= rdt*(T(x,j) - T_prev(j)); rsd[index(c_offset_T, j)] -= (m_qdotRadiation[j] / (m_rho[j] * m_cp[j])); diag[index(c_offset_T, j)] = 1; @@ -564,14 +549,12 @@ void StFlow::updateDiffFluxes(const doublereal* x, size_t j0, size_t j1) doublereal sum, wtm, rho, dz, gradlogT; switch (m_transport_option) { - case c_Mixav_Transport: for (j = j0; j < j1; j++) { sum = 0.0; wtm = m_wtm[j]; rho = density(j); dz = z(j+1) - z(j); - for (k = 0; k < m_nsp; k++) { m_flux(k,j) = m_wt[k]*(rho*m_diff[k+m_nsp*j]/wtm); m_flux(k,j) *= (X(x,k,j) - X(x,k,j+1))/dz; @@ -587,7 +570,6 @@ void StFlow::updateDiffFluxes(const doublereal* x, size_t j0, size_t j1) case c_Multi_Transport: for (j = j0; j < j1; j++) { dz = z(j+1) - z(j); - for (k = 0; k < m_nsp; k++) { doublereal sum = 0.0; for (size_t m = 0; m < m_nsp; m++) { @@ -650,7 +632,6 @@ size_t StFlow::componentIndex(const std::string& name) const } } } - return npos; } @@ -670,10 +651,8 @@ void StFlow::restore(const XML_Node& dom, doublereal* soln, int loglevel) double pp = -1.0; pp = getFloat(dom, "pressure", "pressure"); setPressure(pp); - vector d = dom.child("grid_data").getChildren("floatArray"); size_t nd = d.size(); - vector_fp x; size_t n, np = 0, j, ks, k; string nm; @@ -733,7 +712,6 @@ void StFlow::restore(const XML_Node& dom, doublereal* soln, int loglevel) // imported temperature profile by default. If // this is not desired, call setFixedTempProfile // *after* restoring the solution. - vector_fp zz(np); for (size_t jj = 0; jj < np; jj++) { zz[jj] = (grid(jj) - zmin())/(zmax() - zmin()); @@ -825,9 +803,7 @@ void StFlow::restore(const XML_Node& dom, doublereal* soln, int loglevel) XML_Node& StFlow::save(XML_Node& o, const doublereal* const sol) { size_t k; - Array2D soln(m_nv, m_points, sol + loc()); - XML_Node& flow = Domain1D::save(o, sol); flow.addAttribute("type",flowType()); @@ -881,7 +857,6 @@ XML_Node& StFlow::save(XML_Node& o, const doublereal* const sol) addFloat(ref, "curve", refiner().maxSlope()); addFloat(ref, "prune", refiner().prune()); addFloat(ref, "grid_min", refiner().gridMin()); - return flow; } @@ -897,7 +872,6 @@ void AxiStagnFlow::evalRightBoundary(doublereal* x, doublereal* rsd, // the boundary object connected to the right of this one may modify or // replace these equations. The default boundary conditions are zero u, V, // and T, and zero diffusive flux for all species. - rsd[index(0,j)] = rho_u(x,j); rsd[index(1,j)] = V(x,j); rsd[index(2,j)] = T(x,j); @@ -923,9 +897,7 @@ void AxiStagnFlow::evalContinuity(size_t j, doublereal* x, doublereal* rsd, // lambda information propagates in the opposite direction. // // d(\rho u)/dz + 2\rho V = 0 - // //------------------------------------------------ - rsd[index(c_offset_U,j)] = -(rho_u(x,j+1) - rho_u(x,j))/m_dz[j] -(density(j+1)*V(x,j+1) + density(j)*V(x,j)); @@ -974,9 +946,7 @@ void FreeFlame::evalContinuity(size_t j, doublereal* x, doublereal* rsd, // Continuity equation // // d(\rho u)/dz + 2\rho V = 0 - // //---------------------------------------------- - if (grid(j) > m_zfixed) { rsd[index(c_offset_U,j)] = - (rho_u(x,j) - rho_u(x,j-1))/m_dz[j-1] diff --git a/src/oneD/boundaries1D.cpp b/src/oneD/boundaries1D.cpp index f5a059b24..ca5d06c46 100644 --- a/src/oneD/boundaries1D.cpp +++ b/src/oneD/boundaries1D.cpp @@ -158,7 +158,6 @@ void Inlet1D::eval(size_t jg, doublereal* xg, doublereal* rg, doublereal* xb, *rb; // residual equations for the two local variables - r[0] = m_mdot - x[0]; // Temperature @@ -168,7 +167,6 @@ void Inlet1D::eval(size_t jg, doublereal* xg, doublereal* rg, diag[0] = 0; diag[1] = 0; - // if it is a left inlet, then the flow solution vector // starts 2 to the right in the global solution vector if (m_ilr == LeftInlet) { @@ -543,7 +541,6 @@ void OutletRes1D::init() void OutletRes1D::eval(size_t jg, doublereal* xg, doublereal* rg, integer* diagg, doublereal rdt) { - if (jg != npos && (jg + 2 < firstPoint() || jg > lastPoint() + 2)) { return; } @@ -580,7 +577,6 @@ void OutletRes1D::eval(size_t jg, doublereal* xg, doublereal* rg, } if (m_flow_left) { - nc = m_flow_left->nComponents(); xb = x - nc; rb = r - nc; diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index 0024b77d3..768071549 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -41,7 +41,6 @@ DebyeHuckel::DebyeHuckel() : m_densWaterSS(1000.), m_waterProps(0) { - m_npActCoeff.resize(3); m_npActCoeff[0] = 0.1127; m_npActCoeff[1] = -0.01049; @@ -233,7 +232,6 @@ void DebyeHuckel::setPressure(doublereal p) void DebyeHuckel::setState_TP(doublereal t, doublereal p) { - Phase::setTemperature(t); /* * Store the current pressure @@ -256,7 +254,6 @@ void DebyeHuckel::setState_TP(doublereal t, doublereal p) void DebyeHuckel::calcDensity() { if (m_waterSS) { - /* * Store the internal density of the water SS. * Note, we would have to do this for all other @@ -735,7 +732,6 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) } m_speciesSize[k] = getFloat(*ss, "molarVolume", "toSI"); } - } /* @@ -874,7 +870,6 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) ++_b) { size_t kk = speciesIndex(_b->first); m_Aionic[kk] = fpValue(_b->second) * Afactor; - } } } @@ -940,7 +935,6 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (acNodePtr) { if (acNodePtr->hasChild("stoichIsMods")) { XML_Node& sIsNode = acNodePtr->child("stoichIsMods"); - map msIs; getMap(sIsNode, msIs); for (map::const_iterator _b = msIs.begin(); @@ -1022,7 +1016,6 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) XML_Node& stateNode = phaseNode.child("state"); setStateFromXML(stateNode); } - } double DebyeHuckel::A_Debye_TP(double tempArg, double presArg) const @@ -1362,7 +1355,6 @@ void DebyeHuckel::s_update_lnMolalityActCoeff() const } lnActivitySolvent -= m_Mnaught * log(10.0) * m_IionicMolality * tmp / 2.0; - break; case DHFORM_BETAIJ: @@ -1468,8 +1460,6 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - - double sqrtI = sqrt(m_IionicMolality); double numdAdTTmp = dAdT * sqrtI; double denomTmp = m_B_Debye * sqrtI; @@ -1494,7 +1484,6 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const } m_dlnActCoeffMolaldT[m_indexSolvent] = 0.0; - coeff = 2.0 / 3.0 * dAdT * m_Mnaught * sqrtI; tmp = 0.0; if (denomTmp > 0.0) { @@ -1573,8 +1562,6 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const throw CanteraError("DebyeHuckel::s_update_dlnMolalityActCoeff_dT", "ERROR"); } - - } void DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2() const @@ -1595,8 +1582,6 @@ void DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - - double sqrtI = sqrt(m_IionicMolality); double numd2AdT2Tmp = d2AdT2 * sqrtI; double denomTmp = m_B_Debye * sqrtI; @@ -1617,7 +1602,6 @@ void DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2() const } m_d2lnActCoeffMolaldT2[m_indexSolvent] = 0.0; - coeff = 2.0 / 3.0 * d2AdT2 * m_Mnaught * sqrtI; tmp = 0.0; if (denomTmp > 0.0) { @@ -1715,8 +1699,6 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dP() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - - double sqrtI = sqrt(m_IionicMolality); double numdAdPTmp = dAdP * sqrtI; double denomTmp = m_B_Debye * sqrtI; @@ -1742,7 +1724,6 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dP() const } m_dlnActCoeffMolaldP[m_indexSolvent] = 0.0; - coeff = 2.0 / 3.0 * dAdP * m_Mnaught * sqrtI; tmp = 0.0; if (denomTmp > 0.0) { diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp index 3ced57672..fbaf9e0b4 100644 --- a/src/thermo/FixedChemPotSSTP.cpp +++ b/src/thermo/FixedChemPotSSTP.cpp @@ -78,7 +78,6 @@ FixedChemPotSSTP::FixedChemPotSSTP(XML_Node& xmlphase, const std::string& id_) : FixedChemPotSSTP::FixedChemPotSSTP(const std::string& Ename, doublereal val) : chemPot_(0.0) { - std::string pname = Ename + "Fixed"; setID(pname); setName(pname); diff --git a/src/thermo/GeneralSpeciesThermo.cpp b/src/thermo/GeneralSpeciesThermo.cpp index 7dec82c91..a7e9cfc8d 100644 --- a/src/thermo/GeneralSpeciesThermo.cpp +++ b/src/thermo/GeneralSpeciesThermo.cpp @@ -69,7 +69,6 @@ GeneralSpeciesThermo::operator=(const GeneralSpeciesThermo& b) m_tlow_max = b.m_tlow_max; m_thigh_min = b.m_thigh_min; m_p0 = b.m_p0; - return *this; } @@ -208,7 +207,6 @@ const SpeciesThermoInterpType* GeneralSpeciesThermo::provideSTIT(size_t k) const } } - doublereal GeneralSpeciesThermo::reportOneHf298(const size_t k) const { const SpeciesThermoInterpType* sp_ptr = provideSTIT(k); diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index 64ea08ced..daa2bd151 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -309,20 +309,16 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b) m_lnActCoeffMolal_Scaled = b.m_lnActCoeffMolal_Scaled; m_lnActCoeffMolal_Unscaled = b.m_lnActCoeffMolal_Unscaled; - m_dlnActCoeffMolaldT_Scaled = b.m_dlnActCoeffMolaldT_Scaled; m_dlnActCoeffMolaldT_Unscaled = b.m_dlnActCoeffMolaldT_Unscaled; - m_d2lnActCoeffMolaldT2_Scaled = b.m_d2lnActCoeffMolaldT2_Scaled; m_d2lnActCoeffMolaldT2_Unscaled= b.m_d2lnActCoeffMolaldT2_Unscaled; - m_dlnActCoeffMolaldP_Scaled = b.m_dlnActCoeffMolaldP_Scaled; m_dlnActCoeffMolaldP_Unscaled = b.m_dlnActCoeffMolaldP_Unscaled; m_molalitiesCropped = b.m_molalitiesCropped; m_molalitiesAreCropped = b.m_molalitiesAreCropped; m_CounterIJ = b.m_CounterIJ; - m_gfunc_IJ = b.m_gfunc_IJ; m_g2func_IJ = b.m_g2func_IJ; m_hfunc_IJ = b.m_hfunc_IJ; @@ -383,7 +379,6 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b) CROP_ln_gamma_k_min = b.CROP_ln_gamma_k_min; CROP_ln_gamma_k_max = b.CROP_ln_gamma_k_max; CROP_speciesCropped_ = b.CROP_speciesCropped_; - m_debugCalc = b.m_debugCalc; } return *this; @@ -552,7 +547,6 @@ double HMWSoln::density() const void HMWSoln::setDensity(const doublereal rho) { double dens_old = density(); - if (rho != dens_old) { throw CanteraError("HMWSoln::setDensity", "Density is not an independent variable"); @@ -784,7 +778,6 @@ void HMWSoln::getPartialMolarCp(doublereal* cpbar) const * species at the T and P of the solution. */ getCp_R(cpbar); - for (size_t k = 0; k < m_kk; k++) { cpbar[k] *= GasConstant; } @@ -987,7 +980,6 @@ void HMWSoln::initLengths() m_speciesSize.resize(m_kk); m_speciesCharge_Stoich.resize(m_kk, 0.0); m_Aionic.resize(m_kk, 0.0); - m_pp.resize(m_kk, 0.0); m_tmpV.resize(m_kk, 0.0); m_molalitiesCropped.resize(m_kk, 0.0); @@ -1060,14 +1052,12 @@ void HMWSoln::initLengths() m_dlnActCoeffMolaldT_Scaled.resize(m_kk, 0.0); m_d2lnActCoeffMolaldT2_Scaled.resize(m_kk, 0.0); m_dlnActCoeffMolaldP_Scaled.resize(m_kk, 0.0); - m_lnActCoeffMolal_Unscaled.resize(m_kk, 0.0); m_dlnActCoeffMolaldT_Unscaled.resize(m_kk, 0.0); m_d2lnActCoeffMolaldT2_Unscaled.resize(m_kk, 0.0); m_dlnActCoeffMolaldP_Unscaled.resize(m_kk, 0.0); m_CounterIJ.resize(m_kk*m_kk, 0); - m_gfunc_IJ.resize(maxCounterIJlen, 0.0); m_g2func_IJ.resize(maxCounterIJlen, 0.0); m_hfunc_IJ.resize(maxCounterIJlen, 0.0); @@ -1099,7 +1089,6 @@ void HMWSoln::initLengths() m_CMX_IJ_P.resize(maxCounterIJlen, 0.0); m_gamma_tmp.resize(m_kk, 0.0); - IMS_lnActCoeffMolal_.resize(m_kk, 0.0); CROP_speciesCropped_.resize(m_kk, 0); @@ -1210,10 +1199,7 @@ void HMWSoln::calcMolalitiesCropped() const } int cropMethod = 1; - - if (cropMethod == 0) { - /* * Quick return */ @@ -1222,7 +1208,6 @@ void HMWSoln::calcMolalitiesCropped() const } m_molalitiesAreCropped = true; - for (size_t i = 1; i < (m_kk - 1); i++) { double charge_i = charge(i); double abs_charge_i = fabs(charge_i); @@ -1324,11 +1309,9 @@ void HMWSoln::calcMolalitiesCropped() const } m_molalitiesAreCropped = true; - double poly = MC_apCut_ + MC_bpCut_ * xmolSolvent + MC_dpCut_* xmolSolvent * xmolSolvent; double p = xmolSolvent + MC_epCut_ + exp(- xmolSolvent/ MC_cpCut_) * poly; double denomInv = 1.0/ (m_Mnaught * p); - for (size_t k = 0; k < m_kk; k++) { m_molalitiesCropped[k] = molF[k] * denomInv ; } @@ -1349,7 +1332,6 @@ void HMWSoln::calcMolalitiesCropped() const } } } - } void HMWSoln::counterIJ_setup() const @@ -1395,7 +1377,6 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const for (size_t i = 1; i < (m_kk - 1); i++) { for (size_t j = (i+1); j < m_kk; j++) { - /* * Find the counterIJ for the symmetric binary interaction */ @@ -1417,26 +1398,21 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + beta0MX_coeff[1]*tlin; m_Beta0MX_ij_L[counterIJ] = beta0MX_coeff[1]; m_Beta0MX_ij_LL[counterIJ] = 0.0; - m_Beta1MX_ij[counterIJ] = beta1MX_coeff[0] + beta1MX_coeff[1]*tlin; m_Beta1MX_ij_L[counterIJ] = beta1MX_coeff[1]; m_Beta1MX_ij_LL[counterIJ] = 0.0; - m_Beta2MX_ij[counterIJ] = beta2MX_coeff[0] + beta2MX_coeff[1]*tlin; m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1]; m_Beta2MX_ij_LL[counterIJ] = 0.0; - m_CphiMX_ij[counterIJ] = CphiMX_coeff[0] + CphiMX_coeff[1]*tlin; m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1]; m_CphiMX_ij_LL[counterIJ] = 0.0; - m_Theta_ij[counterIJ] = Theta_coeff[0] + Theta_coeff[1]*tlin; m_Theta_ij_L[counterIJ] = Theta_coeff[1]; m_Theta_ij_LL[counterIJ] = 0.0; - break; case PITZER_TEMP_COMPLEX1: @@ -1445,78 +1421,64 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + beta0MX_coeff[2]*tquad + beta0MX_coeff[3]*tinv + beta0MX_coeff[4]*tln; - m_Beta1MX_ij[counterIJ] = beta1MX_coeff[0] + beta1MX_coeff[1]*tlin + beta1MX_coeff[2]*tquad + beta1MX_coeff[3]*tinv + beta1MX_coeff[4]*tln; - m_Beta2MX_ij[counterIJ] = beta2MX_coeff[0] + beta2MX_coeff[1]*tlin + beta2MX_coeff[2]*tquad + beta2MX_coeff[3]*tinv + beta2MX_coeff[4]*tln; - m_CphiMX_ij[counterIJ] = CphiMX_coeff[0] + CphiMX_coeff[1]*tlin + CphiMX_coeff[2]*tquad + CphiMX_coeff[3]*tinv + CphiMX_coeff[4]*tln; - m_Theta_ij[counterIJ] = Theta_coeff[0] + Theta_coeff[1]*tlin + Theta_coeff[2]*tquad + Theta_coeff[3]*tinv + Theta_coeff[4]*tln; - m_Beta0MX_ij_L[counterIJ] = beta0MX_coeff[1] + beta0MX_coeff[2]*twoT - beta0MX_coeff[3]*invT2 + beta0MX_coeff[4]*invT; - m_Beta1MX_ij_L[counterIJ] = beta1MX_coeff[1] + beta1MX_coeff[2]*twoT - beta1MX_coeff[3]*invT2 + beta1MX_coeff[4]*invT; - m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1] + beta2MX_coeff[2]*twoT - beta2MX_coeff[3]*invT2 + beta2MX_coeff[4]*invT; - m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1] + CphiMX_coeff[2]*twoT - CphiMX_coeff[3]*invT2 + CphiMX_coeff[4]*invT; - m_Theta_ij_L[counterIJ] = Theta_coeff[1] + Theta_coeff[2]*twoT - Theta_coeff[3]*invT2 + Theta_coeff[4]*invT; - doDerivs = 2; if (doDerivs > 1) { m_Beta0MX_ij_LL[counterIJ] = + beta0MX_coeff[2]*2.0 + beta0MX_coeff[3]*twoinvT3 - beta0MX_coeff[4]*invT2; - m_Beta1MX_ij_LL[counterIJ] = + beta1MX_coeff[2]*2.0 + beta1MX_coeff[3]*twoinvT3 - beta1MX_coeff[4]*invT2; - m_Beta2MX_ij_LL[counterIJ] = + beta2MX_coeff[2]*2.0 + beta2MX_coeff[3]*twoinvT3 - beta2MX_coeff[4]*invT2; - m_CphiMX_ij_LL[counterIJ] = + CphiMX_coeff[2]*2.0 + CphiMX_coeff[3]*twoinvT3 - CphiMX_coeff[4]*invT2; - m_Theta_ij_LL[counterIJ] = + Theta_coeff[2]*2.0 + Theta_coeff[3]*twoinvT3 @@ -1579,12 +1541,10 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + Mu_coeff[2]*tquad + Mu_coeff[3]*tinv + Mu_coeff[4]*tln; - m_Mu_nnn_L[i] = Mu_coeff[1] + Mu_coeff[2]*twoT - Mu_coeff[3]*invT2 + Mu_coeff[4]*invT; - m_Mu_nnn_LL[i] = Mu_coeff[2]*2.0 + Mu_coeff[3]*twoinvT3 @@ -1631,12 +1591,10 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + Psi_coeff[2]*tquad + Psi_coeff[3]*tinv + Psi_coeff[4]*tln; - m_Psi_ijk_L[n] = Psi_coeff[1] + Psi_coeff[2]*twoT - Psi_coeff[3]*invT2 + Psi_coeff[4]*invT; - m_Psi_ijk_LL[n] = Psi_coeff[2]*2.0 + Psi_coeff[3]*twoinvT3 @@ -1646,7 +1604,6 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const } break; } - } void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const @@ -1676,9 +1633,7 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const const double* thetaij = DATA_PTR(m_Theta_ij); const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); - const double* psi_ijk = DATA_PTR(m_Psi_ijk); - double* gamma_Unscaled = DATA_PTR(m_gamma_tmp); /* * Local variables defined by Coltrin @@ -2000,7 +1955,6 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const } for (size_t i = 1; i < m_kk; i++) { - /* * -------- SUBSECTION FOR CALCULATING THE ACTCOEFF FOR CATIONS ----- * -------- -> equations agree with my notes, Eqn. (118). @@ -2062,7 +2016,6 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const } } - if (charge(j) > 0.0) { // sum over all cations if (j != i) { @@ -2078,7 +2031,6 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const for (size_t k = 1; k < m_kk; k++) { if (charge(k) < 0.0) { // two inner sums over anions - n = k + j * m_kk + i * m_kk * m_kk; sum2 = sum2 + molality[j]*molality[k]*psi_ijk[n]; if (DEBUG_MODE_ENABLED && m_debugCalc) { @@ -2353,7 +2305,6 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const sni.c_str(), m_lnActCoeffMolal_Unscaled[i], gamma_Unscaled[i]); } } - } if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 9: \n"); @@ -2440,7 +2391,6 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const */ size_t n = m_kk*j + k; size_t counterIJ = m_CounterIJ[n]; - sum3 = sum3 + molality[j]*molality[k]*Phiphi[counterIJ]; for (size_t m = 1; m < m_kk; m++) { if (charge(m) > 0.0) { @@ -2561,8 +2511,6 @@ void HMWSoln::s_update_dlnMolalityActCoeff_dT() const * Do the pH scaling to the derivatives */ s_updateScaling_pHScaling_dT(); - - } void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const @@ -2831,7 +2779,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const /* * ------- SUBSECTION TO CALCULATE Phi, PhiPrime, and PhiPhi ---------- - * -------- */ if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 6: \n"); @@ -2914,7 +2861,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const for (size_t i = 1; i < m_kk; i++) { /* * -------- SUBSECTION FOR CALCULATING THE dACTCOEFFdT FOR CATIONS ----- - * -- */ if (charge(i) > 0) { // species i is the cation (positive) to calc the actcoeff @@ -2951,7 +2897,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const } } - if (charge(j) > 0.0) { // sum over all cations if (j != i) { @@ -2960,7 +2905,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const for (size_t k = 1; k < m_kk; k++) { if (charge(k) < 0.0) { // two inner sums over anions - n = k + j * m_kk + i * m_kk * m_kk; sum2 = sum2 + molality[j]*molality[k]*psi_ijk_L[n]; /* @@ -3013,7 +2957,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const /* * ------ SUBSECTION FOR CALCULATING THE dACTCOEFFdT FOR ANIONS ------ - * */ if (charge(i) < 0) { // species i is an anion (negative) @@ -3133,7 +3076,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const sni.c_str(), m_dlnActCoeffMolaldT_Unscaled[i], d_gamma_dT_Unscaled[i]); } } - } if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 9: \n"); @@ -3171,7 +3113,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const */ size_t n = m_kk*j + k; size_t counterIJ = m_CounterIJ[n]; - sum1 = sum1 + molality[j]*molality[k]* (BphiMX_L[counterIJ] + molarcharge*CMX_L[counterIJ]); } @@ -3220,7 +3161,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const */ size_t n = m_kk*j + k; size_t counterIJ = m_CounterIJ[n]; - sum3 = sum3 + molality[j]*molality[k]*Phiphi_L[counterIJ]; for (size_t m = 1; m < m_kk; m++) { if (charge(m) > 0.0) { @@ -3403,7 +3343,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const */ counterIJ_setup(); - /* * ---------- Calculate common sums over solutes --------------------- */ @@ -3459,7 +3398,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const } /* - * * calculate gfunc(x) and hfunc(x) for each cation-anion pair MX * In the original literature, hfunc, was called gprime. However, * it's not the derivative of gfunc(x), so I renamed it. @@ -3566,7 +3504,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const /* * --------- SUBSECTION TO CALCULATE CMX_LL ---------- - * --------- */ if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 5: \n"); @@ -3600,7 +3537,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const /* * ------- SUBSECTION TO CALCULATE Phi, PhiPrime, and PhiPhi ---------- - * -------- */ if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 6: \n"); @@ -3680,10 +3616,8 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const } for (size_t i = 1; i < m_kk; i++) { - /* * -------- SUBSECTION FOR CALCULATING THE dACTCOEFFdT FOR CATIONS ----- - * -- */ if (charge(i) > 0) { // species i is the cation (positive) to calc the actcoeff @@ -3720,7 +3654,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const } } - if (charge(j) > 0.0) { // sum over all cations if (j != i) { @@ -3729,7 +3662,6 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const for (size_t k = 1; k < m_kk; k++) { if (charge(k) < 0.0) { // two inner sums over anions - n = k + j * m_kk + i * m_kk * m_kk; sum2 = sum2 + molality[j]*molality[k]*psi_ijk_LL[n]; /* @@ -3779,10 +3711,8 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const } } - /* * ------ SUBSECTION FOR CALCULATING THE d2ACTCOEFFdT2 FOR ANIONS ------ - * */ if (charge(i) < 0) { // species i is an anion (negative) @@ -4224,7 +4154,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } /* - * * calculate g(x) and hfunc(x) for each cation-anion pair MX * In the original literature, hfunc, was called gprime. However, * it's not the derivative of g(x), so I renamed it. @@ -4365,7 +4294,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const /* * ------- SUBSECTION TO CALCULATE Phi, PhiPrime, and PhiPhi ---------- - * -------- */ if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 6: \n"); @@ -4446,7 +4374,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } for (size_t i = 1; i < m_kk; i++) { - /* * -------- SUBSECTION FOR CALCULATING THE dACTCOEFFdP FOR CATIONS ----- */ @@ -4485,7 +4412,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } } - if (charge(j) > 0.0) { // sum over all cations if (j != i) { @@ -4546,7 +4472,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } } - /* * ------ SUBSECTION FOR CALCULATING THE dACTCOEFFdP FOR ANIONS ------ */ @@ -4668,7 +4593,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const sni.c_str(), m_dlnActCoeffMolaldP_Unscaled[i]); } } - } if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Step 9: \n"); @@ -4706,7 +4630,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const */ size_t n = m_kk*j + k; size_t counterIJ = m_CounterIJ[n]; - sum1 = sum1 + molality[j]*molality[k]* (BphiMX_P[counterIJ] + molarcharge*CMX_P[counterIJ]); } @@ -4738,7 +4661,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } } - /* * Loop Over Anions */ @@ -4828,7 +4750,6 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } double d_lnwateract_dP = -(m_weightSolvent/1000.0) * molalitysum * d_osmotic_coef_dP; - /* * In Cantera, we define the activity coefficient of the solvent as * @@ -4873,7 +4794,6 @@ void HMWSoln::calc_lambdas(double is) const * Calculate E-lambda terms for charge combinations of like sign, * using method of Pitzer (1975). Charges up to 4 are calculated. */ - for (int i=1; i<=4; i++) { for (int j=i; j<=4; j++) { int ij = i*j; @@ -4944,7 +4864,6 @@ void HMWSoln::s_updateIMS_lnMolalityActCoeff() const * State objects' data. */ calcMolalities(); - double xmolSolvent = moleFraction(m_indexSolvent); double xx = std::max(m_xmolSolventMIN, xmolSolvent); if (IMS_typeCutoff_ == 0) { @@ -5015,7 +4934,6 @@ void HMWSoln::s_updateIMS_lnMolalityActCoeff() const IMS_lnActCoeffMolal_[m_indexSolvent] = - log(xx) + (xx - 1.0)/xx; return; } else { - double xoverc = xmolSolvent/IMS_cCut_; double eterm = std::exp(-xoverc); @@ -5077,8 +4995,6 @@ void HMWSoln::printCoeffs() const m_Beta0MX_ij[ct], m_Beta1MX_ij[ct], m_Beta2MX_ij[ct], m_CphiMX_ij[ct], m_Alpha1MX_ij[ct], m_Theta_ij[ct]); - - } } diff --git a/src/thermo/HMWSoln_input.cpp b/src/thermo/HMWSoln_input.cpp index e5a73c576..f1e39a84a 100644 --- a/src/thermo/HMWSoln_input.cpp +++ b/src/thermo/HMWSoln_input.cpp @@ -133,7 +133,6 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } } if (nodeName == "beta1") { - /* * Get the string containing all of the values */ @@ -199,7 +198,6 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } m_Beta2MX_ij[counter] = vParams[0]; } - } if (nodeName == "cphi") { /* @@ -511,7 +509,6 @@ void HMWSoln::readXMLPsiCommonCation(XML_Node& BinSalt) m_Psi_ijk[n] = vParams[0]; } - // fill in the duplicate entries n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies ; for (size_t j = 0; j < nParamsFound; j++) { @@ -612,7 +609,6 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) } } if (nodeName == "psi") { - getFloatArray(xmlChild, vParams, false, "", stemp); size_t nParamsFound = vParams.size(); n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies ; @@ -649,7 +645,6 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) m_Psi_ijk[n] = vParams[0]; } - // fill in the duplicate entries n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies ; for (size_t j = 0; j < nParamsFound; j++) { @@ -680,7 +675,6 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - } } } @@ -735,7 +729,6 @@ void HMWSoln::readXMLLambdaNeutral(XML_Node& BinSalt) } m_Lambda_nj_coeff(0,nCount) = vParams[0]; m_Lambda_nj(iSpecies,jSpecies) = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLLambdaNeutral::Lambda for " + iName @@ -745,7 +738,6 @@ void HMWSoln::readXMLLambdaNeutral(XML_Node& BinSalt) m_Lambda_nj_coeff(0,nCount) = vParams[0]; m_Lambda_nj_coeff(1,nCount) = vParams[1]; m_Lambda_nj(iSpecies, jSpecies) = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); @@ -805,7 +797,6 @@ void HMWSoln::readXMLMunnnNeutral(XML_Node& BinSalt) } m_Mu_nnn_coeff(0,iSpecies) = vParams[0]; m_Mu_nnn[iSpecies] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLMunnnNeutral::Munnn for " + iName, @@ -814,7 +805,6 @@ void HMWSoln::readXMLMunnnNeutral(XML_Node& BinSalt) m_Mu_nnn_coeff(0, iSpecies) = vParams[0]; m_Mu_nnn_coeff(1, iSpecies) = vParams[1]; m_Mu_nnn[iSpecies] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); @@ -923,7 +913,6 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) } m_Psi_ijk[n] = vParams[0]; } - // There are no duplicate entries } } @@ -931,7 +920,6 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) void HMWSoln::readXMLCroppingCoefficients(const XML_Node& acNode) { - if (acNode.hasChild("croppingCoefficients")) { XML_Node& cropNode = acNode.child("croppingCoefficients"); if (cropNode.hasChild("ln_gamma_k_min")) { @@ -963,7 +951,6 @@ void HMWSoln::initThermo() void HMWSoln::constructPhaseFile(std::string inputFile, std::string id_) { - if (inputFile.size() == 0) { throw CanteraError("HMWSoln:constructPhaseFile", "input file is null"); @@ -1101,7 +1088,6 @@ void HMWSoln::constructPhaseXML(XML_Node& phaseNode, std::string id_) } else { m_TempPitzerRef = 273.15 + 25; } - } /* @@ -1209,7 +1195,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) } else { m_TempPitzerRef = 273.15 + 25; } - } /* @@ -1383,13 +1368,11 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) m_maxIionicStrength = getFloat(acNode, "maxIonicStrength"); } - /* * Look for parameters for the Ionic radius */ if (acNode.hasChild("ionicRadius")) { XML_Node& irNode = acNode.child("ionicRadius"); - double Afactor = 1.0; if (irNode.hasAttrib("units")) { string Aunits = irNode.attrib("units"); @@ -1403,7 +1386,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) m_Aionic[k] = ad * Afactor; } } - } /* @@ -1412,7 +1394,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) * in each of the species SS databases. */ std::vector xspecies = speciesData(); - for (size_t k = 0; k < m_kk; k++) { size_t jmap = npos; string kname = speciesName(k); @@ -1436,7 +1417,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (acNodePtr) { if (acNodePtr->hasChild("stoichIsMods")) { XML_Node& sIsNode = acNodePtr->child("stoichIsMods"); - map msIs; getMap(sIsNode, msIs); for (map::const_iterator _b = msIs.begin(); @@ -1451,7 +1431,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) } } - /* * Loop through the children getting multiple instances of * parameters @@ -1486,7 +1465,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) // Go look up the optional Cropping parameters readXMLCroppingCoefficients(acNode); - } /* @@ -1562,7 +1540,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) /* * Lastly calculate the charge balance and then add stuff until the charges compensate */ - vector_fp mf(m_kk, 0.0); getMoleFractions(DATA_PTR(mf)); bool notDone = true; @@ -1580,7 +1557,6 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) size_t kHp = speciesIndex("H+"); size_t kOHm = speciesIndex("OH-"); - if (fabs(sum) > 1.0E-30) { if (kHp != npos) { if (mf[kHp] > sum * 1.1) { diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index a250d68f3..0d831fbc3 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -293,7 +293,6 @@ void IdealMolalSoln::getActivities(doublereal* ac) const double xmolSolvent = moleFraction(m_indexSolvent); ac[m_indexSolvent] = exp(IMS_lnActCoeffMolal_[m_indexSolvent]) * xmolSolvent; - } } @@ -346,7 +345,6 @@ void IdealMolalSoln::getChemPotentials(doublereal* mu) const doublereal RT = GasConstant * temperature(); if (IMS_typeCutoff_ == 0 || xmolSolvent > 3.* IMS_X_o_cutoff_/2.0) { - for (size_t k = 1; k < m_kk; k++) { double xx = std::max(m_molalities[k], SmallNumber); mu[k] += RT * log(xx); @@ -355,7 +353,6 @@ void IdealMolalSoln::getChemPotentials(doublereal* mu) const * Do the solvent * -> see my notes */ - double xx = std::max(xmolSolvent, SmallNumber); mu[m_indexSolvent] += (RT * (xmolSolvent - 1.0) / xx); @@ -366,7 +363,6 @@ void IdealMolalSoln::getChemPotentials(doublereal* mu) const */ s_updateIMS_lnMolalityActCoeff(); - for (size_t k = 1; k < m_kk; k++) { double xx = std::max(m_molalities[k], SmallNumber); mu[k] += RT * (log(xx) + IMS_lnActCoeffMolal_[k]); @@ -375,7 +371,6 @@ void IdealMolalSoln::getChemPotentials(doublereal* mu) const mu[m_indexSolvent] += RT * (log(xx) + IMS_lnActCoeffMolal_[m_indexSolvent]); } - } void IdealMolalSoln::getPartialMolarEnthalpies(doublereal* hbar) const @@ -420,7 +415,6 @@ void IdealMolalSoln::getPartialMolarEntropies(doublereal* sbar) const double xmolSolvent = moleFraction(m_indexSolvent); mm = std::max(SmallNumber, xmolSolvent); sbar[m_indexSolvent] -= GasConstant *(log(mm) + IMS_lnActCoeffMolal_[m_indexSolvent]); - } } @@ -436,7 +430,6 @@ void IdealMolalSoln::getPartialMolarCp(doublereal* cpbar) const * species at the T and P of the solution. */ getCp_R(cpbar); - for (size_t k = 0; k < m_kk; k++) { cpbar[k] *= GasConstant; } @@ -558,12 +551,10 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (ccNode.hasChild("slope_g_limit")) { IMS_slopegCut_ = getFloat(ccNode, "slope_g_limit"); } - } } } - /* * Reconcile the solvent name and index. */ @@ -585,7 +576,6 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) " should be first species"); } - /* * Now go get the molar volumes */ @@ -607,8 +597,6 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) } MolalityVPSSTP::initThermoXML(phaseNode, id_); - - setMoleFSolventMin(1.0E-5); /* * Set the state @@ -617,7 +605,6 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) XML_Node& stateNode = phaseNode.child("state"); setStateFromXML(stateNode); } - } /* @@ -657,7 +644,6 @@ void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const IMS_lnActCoeffMolal_[m_indexSolvent] = log(IMS_gamma_o_min_); return; } else { - /* * If we are in the middle region, calculate the connecting polynomials */ @@ -705,7 +691,6 @@ void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const IMS_lnActCoeffMolal_[m_indexSolvent] = - log(xx) + (xx - 1.0)/xx; return; } else { - double xoverc = xmolSolvent/IMS_cCut_; double eterm = std::exp(-xoverc); diff --git a/src/thermo/IdealSolnGasVPSS.cpp b/src/thermo/IdealSolnGasVPSS.cpp index dfe4e110b..5eb1088dc 100644 --- a/src/thermo/IdealSolnGasVPSS.cpp +++ b/src/thermo/IdealSolnGasVPSS.cpp @@ -96,7 +96,6 @@ doublereal IdealSolnGasVPSS::entropy_mole() const { updateStandardStateThermo(); return GasConstant * (mean_X(m_VPSS_ptr->entropy_R()) - sum_xlogx()); - } doublereal IdealSolnGasVPSS::cp_mole() const @@ -191,7 +190,6 @@ doublereal IdealSolnGasVPSS::standardConcentration(size_t k) const return 1.0/ vss[0]; } return 0.0; - } } diff --git a/src/thermo/IonsFromNeutralVPSSTP.cpp b/src/thermo/IonsFromNeutralVPSSTP.cpp index ebca14a89..6511ed788 100644 --- a/src/thermo/IonsFromNeutralVPSSTP.cpp +++ b/src/thermo/IonsFromNeutralVPSSTP.cpp @@ -116,7 +116,6 @@ IonsFromNeutralVPSSTP::operator=(const IonsFromNeutralVPSSTP& b) GibbsExcessVPSSTP::operator=(b); - ionSolnType_ = b.ionSolnType_; numNeutralMoleculeSpecies_ = b.numNeutralMoleculeSpecies_; indexSpecialSpecies_ = b.indexSpecialSpecies_; @@ -127,11 +126,9 @@ IonsFromNeutralVPSSTP::operator=(const IonsFromNeutralVPSSTP& b) cationList_ = b.cationList_; anionList_ = b.anionList_; passThroughList_ = b.passThroughList_; - y_ = b.y_; dlnActCoeff_NeutralMolecule_ = b.dlnActCoeff_NeutralMolecule_; dX_NeutralMolecule_ = b.dX_NeutralMolecule_; - IOwnNThermoPhase_ = b.IOwnNThermoPhase_; moleFractionsTmp_ = b.moleFractionsTmp_; muNeutralMolecule_ = b.muNeutralMolecule_; @@ -159,7 +156,6 @@ ThermoPhase* IonsFromNeutralVPSSTP::duplMyselfAsThermoPhase() const void IonsFromNeutralVPSSTP::constructPhaseFile(std::string inputFile, std::string id_) { - if (inputFile.size() == 0) { throw CanteraError("MargulesVPSSTP:constructPhaseFile", "input file is null"); @@ -204,8 +200,6 @@ void IonsFromNeutralVPSSTP::constructPhaseXML(XML_Node& phaseNode, std::string i } XML_Node& thermoNode = phaseNode.child("thermo"); - - /* * Make sure that the thermo model is IonsFromNeutralMolecule */ @@ -338,7 +332,6 @@ void IonsFromNeutralVPSSTP::getChemPotentials(doublereal* mu) const break; case cIonSolnType_SINGLEANION: neutralMoleculePhase_->getLnActivityCoefficients(DATA_PTR(lnActCoeff_NeutralMolecule_)); - fact2 = 2.0 * RT_ * log(2.0); // Do the cation list @@ -519,7 +512,6 @@ void IonsFromNeutralVPSSTP::calcIonMoleFractions(doublereal* const mf) const for (size_t k = 0; k < m_kk; k++) { mf[k] /= sum; } - } void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const @@ -544,7 +536,6 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const } switch (ionSolnType_) { - case cIonSolnType_PASSTHROUGH: for (size_t k = 0; k < m_kk; k++) { NeutralMolecMoleFractions_[k] = moleFractions_[k]; @@ -609,25 +600,17 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) { NeutralMolecMoleFractions_[k] /= sum; } - break; case cIonSolnType_SINGLECATION: - throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "Unknown type"); - break; - case cIonSolnType_MULTICATIONANION: - throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "Unknown type"); break; - default: - throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "Unknown type"); break; - } } @@ -636,7 +619,6 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const doublereal sumy, sumdy; //check sum dx = 0 - //! Zero the vector we are trying to find. for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) { y_[k] = 0.0; @@ -688,24 +670,17 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const break; case cIonSolnType_SINGLECATION: - throw CanteraError("IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads", "Unknown type"); - break; - case cIonSolnType_MULTICATIONANION: - throw CanteraError("IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads", "Unknown type"); break; - default: - throw CanteraError("IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads", "Unknown type"); break; - } } @@ -771,11 +746,9 @@ void IonsFromNeutralVPSSTP::initLengths() dlnActCoeffdlnX_diag_NeutralMolecule_.resize(numNeutralMoleculeSpecies_); dlnActCoeffdlnN_diag_NeutralMolecule_.resize(numNeutralMoleculeSpecies_); dlnActCoeffdlnN_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, numNeutralMoleculeSpecies_, 0.0); - y_.resize(numNeutralMoleculeSpecies_, 0.0); dlnActCoeff_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, 0.0); dX_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, 0.0); - } //! Return the factor overlap @@ -830,8 +803,6 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string } XML_Node& thermoNode = phaseNode.child("thermo"); - - /* * Make sure that the thermo model is IonsFromNeutralMolecule */ @@ -899,7 +870,6 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string } } - size_t nElementsN = neutralMoleculePhase_->nElements(); const std::vector& elnamesVN = neutralMoleculePhase_->elementNames(); std::vector elemVectorN(nElementsN); @@ -939,7 +909,6 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string } fm_neutralMolec_ions_[indexSpecialSpecies_ + jNeut * m_kk ] += fac; - for (size_t k = 0; k < m_kk; k++) { for (size_t m = 0; m < nElementsI; m++) { elemVectorI[m] = nAtoms(k, m); @@ -954,7 +923,6 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string if (mName == eName) { elemVectorN[m] -= fac * elemVectorI[mi]; } - } } bool notTaken = true; @@ -980,8 +948,6 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string "Simple formula matrix generation failed"); } } - - } /* * This includes the setStateFromXML calls @@ -1006,7 +972,6 @@ void IonsFromNeutralVPSSTP::s_update_lnActCoeff() const case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { //! Get the id for the next cation @@ -1039,7 +1004,6 @@ void IonsFromNeutralVPSSTP::s_update_lnActCoeff() const throw CanteraError("IonsFromNeutralVPSSTP::s_update_lnActCoeff", "Unimplemented type"); break; } - } void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, @@ -1059,14 +1023,12 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const double getNeutralMoleculeMoleGrads(DATA_PTR(dXds),DATA_PTR(dX_NeutralMolecule_)); // All mole fractions returned to normal - geThermo->getdlnActCoeffds(dTds, DATA_PTR(dX_NeutralMolecule_), DATA_PTR(dlnActCoeff_NeutralMolecule_)); switch (ionSolnType_) { case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { //! Get the id for the next cation @@ -1099,7 +1061,6 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const double throw CanteraError("IonsFromNeutralVPSSTP::s_update_lnActCoeffds", "Unimplemented type"); break; } - } void IonsFromNeutralVPSSTP::s_update_dlnActCoeffdT() const @@ -1119,7 +1080,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeffdT() const case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { //! Get the id for the next cation @@ -1152,7 +1112,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeffdT() const throw CanteraError("IonsFromNeutralVPSSTP::s_update_lnActCoeffdT", "Unimplemented type"); break; } - } void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnX_diag() const @@ -1172,7 +1131,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnX_diag() const case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { //! Get the id for the next cation @@ -1205,7 +1163,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnX_diag() const throw CanteraError("IonsFromNeutralVPSSTP::s_update_lnActCoeff_dlnX_diag()", "Unimplemented type"); break; } - } void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN_diag() const @@ -1225,7 +1182,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN_diag() const case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { //! Get the id for the next cation @@ -1258,7 +1214,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN_diag() const throw CanteraError("IonsFromNeutralVPSSTP::s_update_lnActCoeff_dlnN_diag()", "Unimplemented type"); break; } - } void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const @@ -1279,7 +1234,6 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const case cIonSolnType_PASSTHROUGH: break; case cIonSolnType_SINGLEANION: - // Do the cation list for (size_t k = 0; k < cationList_.size(); k++) { for (size_t m = 0; m < cationList_.size(); m++) { @@ -1323,13 +1277,11 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut, mNeut); } - for (size_t m = 0; m < cationList_.size(); m++) { mcat = cationList_[m]; mNeut = fm_invert_ionForNeutral[mcat]; dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut,mNeut); } - } break; diff --git a/src/thermo/LatticePhase.cpp b/src/thermo/LatticePhase.cpp index ca0da0210..c8da5fb45 100644 --- a/src/thermo/LatticePhase.cpp +++ b/src/thermo/LatticePhase.cpp @@ -1,11 +1,9 @@ /** - * * @file LatticePhase.cpp * Definitions for a simple thermodynamics model of a bulk phase * derived from ThermoPhase, * assuming a lattice of solid atoms * (see \ref thermoprops and class \link Cantera::LatticePhase LatticePhase\endlink). - * */ #include "cantera/thermo/LatticePhase.h" #include "cantera/thermo/ThermoFactory.h" @@ -160,7 +158,6 @@ void LatticePhase::getChemPotentials(doublereal* mu) const mu[k] = RT * (g_RT[k] + log(xx)) + delta_p * m_speciesMolarVolume[k]; } - } void LatticePhase::getPartialMolarEnthalpies(doublereal* hbar) const diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index 98270117f..ed2bfe7e5 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -451,7 +451,6 @@ void LatticeSolidPhase::setParametersFromXML(const XML_Node& eosdata) throw CanteraError("LatticeSolidPhase::setParametersFromXML", "not found"); } } - } void LatticeSolidPhase::modifyOneHf298SS(const size_t k, const doublereal Hf298New) diff --git a/src/thermo/MargulesVPSSTP.cpp b/src/thermo/MargulesVPSSTP.cpp index 4890e4547..8629bc064 100644 --- a/src/thermo/MargulesVPSSTP.cpp +++ b/src/thermo/MargulesVPSSTP.cpp @@ -314,7 +314,6 @@ void MargulesVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (formString != "margules") { throw CanteraError("MargulesVPSSTP::initThermoXML", "model name isn't Margules: " + formString); - } /* @@ -449,7 +448,6 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnN_diag() const { double T = temperature(); double RT = GasConstant*T; - dlnActCoeffdlnN_diag_.assign(m_kk, 0.0); for (size_t iK = 0; iK < m_kk; iK++) { @@ -492,10 +490,8 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnN() const for (size_t iM = 0; iM < m_kk; iM++) { double XM = moleFractions_[iM]; for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - double delAK = 0.0; double delBK = 0.0; double delAM = 0.0; @@ -513,10 +509,8 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnN() const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; - dlnActCoeffdlnN_(iK,iM) += g0*((delAM-XA)*(delBK-XB)+(delAK-XA)*(delBM-XB)); dlnActCoeffdlnN_(iK,iM) += 2*g1*((delAM-XA)*(delBK-XB)*XB+(delAK-XA)*(delBM-XB)*XB+(delBM-XB)*(delBK-XB)*XA); } @@ -619,10 +613,9 @@ void MargulesVPSSTP::readXMLBinarySpecies(XML_Node& xmLBinarySpecies) return; } string aspName = speciesName(aSpecies); - // + // @TODO Figure out what the original reason is for putting an error condition for charged species // Seems OK to me. - // if (charge(aSpecies) != 0.0) { throw CanteraError("MargulesVPSSTP::readXMLBinarySpecies", "speciesA has a charge: " + fp2str(charge(aSpecies))); } diff --git a/src/thermo/MaskellSolidSolnPhase.cpp b/src/thermo/MaskellSolidSolnPhase.cpp index c53bd9c73..c9df9cdbb 100644 --- a/src/thermo/MaskellSolidSolnPhase.cpp +++ b/src/thermo/MaskellSolidSolnPhase.cpp @@ -273,7 +273,6 @@ void MaskellSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string "Unspecified thermo model"); } - // Confirm that the phase only contains 2 species if (m_kk != 2) { throw CanteraError("MaskellSolidSolnPhase::initThermoXML", diff --git a/src/thermo/MetalSHEelectrons.cpp b/src/thermo/MetalSHEelectrons.cpp index f873f3a47..535830c7d 100644 --- a/src/thermo/MetalSHEelectrons.cpp +++ b/src/thermo/MetalSHEelectrons.cpp @@ -133,7 +133,6 @@ doublereal MetalSHEelectrons::isothermalCompressibility() const doublereal MetalSHEelectrons::thermalExpansionCoeff() const { return 1.0/temperature(); - } /* diff --git a/src/thermo/MineralEQ3.cpp b/src/thermo/MineralEQ3.cpp index 7a56d7e0f..80e416628 100644 --- a/src/thermo/MineralEQ3.cpp +++ b/src/thermo/MineralEQ3.cpp @@ -294,7 +294,6 @@ void MineralEQ3::convertDGFormation() /* * Ok let's get the element compositions and conversion factors. */ - doublereal totalSum = 0.0; for (size_t m = 0; m < nElements(); m++) { double na = nAtoms(0, m); diff --git a/src/thermo/MixedSolventElectrolyte.cpp b/src/thermo/MixedSolventElectrolyte.cpp index 60b818a76..8355b4ce1 100644 --- a/src/thermo/MixedSolventElectrolyte.cpp +++ b/src/thermo/MixedSolventElectrolyte.cpp @@ -338,7 +338,6 @@ void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::stri */ if (lowercase(xmlACChild.name()) == "binaryneutralspeciesparameters") { readXMLBinarySpecies(xmlACChild); - } } } @@ -347,8 +346,6 @@ void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::stri * Go down the chain */ MolarityIonicVPSSTP::initThermoXML(phaseNode, id_); - - } void MixedSolventElectrolyte::s_update_lnActCoeff() const @@ -430,10 +427,8 @@ void MixedSolventElectrolyte::getdlnActCoeffds(const doublereal dTds, const dou for (size_t iK = 0; iK < m_kk; iK++) { dlnActCoeffds[iK] = 0.0; for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - int delAK = 0; int delBK = 0; @@ -445,13 +440,10 @@ void MixedSolventElectrolyte::getdlnActCoeffds(const doublereal dTds, const dou double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double dXA = dXds[iA]; double dXB = dXds[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; - dlnActCoeffds[iK] += ((delBK-XB)*dXA + (delAK-XA)*dXB)*(g0+2*g1*XB) + (delBK-XB)*2*g1*XA*dXB + dlnActCoeffdT_Scaled_[iK]*dTds; } @@ -462,17 +454,13 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN_diag() const { double T = temperature(); double RT = GasConstant*T; - dlnActCoeffdlnN_diag_.assign(m_kk, 0); for (size_t iK = 0; iK < m_kk; iK++) { double XK = moleFractions_[iK]; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - int delAK = 0; int delBK = 0; @@ -484,7 +472,6 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN_diag() const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; @@ -498,7 +485,6 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN() const { double T = temperature(); double RT = GasConstant*T; - dlnActCoeffdlnN_.zero(); /* @@ -508,10 +494,8 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN() const for (size_t iM = 0; iM < m_kk; iM++) { double XM = moleFractions_[iM]; for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - double delAK = 0.0; double delBK = 0.0; double delAM = 0.0; @@ -529,10 +513,8 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN() const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; - dlnActCoeffdlnN_(iK,iM) += g0*((delAM-XA)*(delBK-XB)+(delAK-XA)*(delBM-XB)); dlnActCoeffdlnN_(iK,iM) += 2*g1*((delAM-XA)*(delBK-XB)*XB+(delAK-XA)*(delBM-XB)*XB+(delBM-XB)*(delBK-XB)*XA); } @@ -548,22 +530,17 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnX_diag() const doublereal RT = GasConstant * T; for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; - dlnActCoeffdlnX_diag_[iA] += XA*XB*(2*g1*-2*g0-6*g1*XB); dlnActCoeffdlnX_diag_[iB] += XA*XB*(2*g1*-2*g0-6*g1*XB); } } - void MixedSolventElectrolyte::getdlnActCoeffdlnN_diag(doublereal* dlnActCoeffdlnN_diag) const { s_update_dlnActCoeff_dlnN_diag(); @@ -606,10 +583,8 @@ void MixedSolventElectrolyte::resizeNumInteractions(const size_t num) m_VSE_b_ij.resize(num, 0.0); m_VSE_c_ij.resize(num, 0.0); m_VSE_d_ij.resize(num, 0.0); - m_pSpecies_A_ij.resize(num, npos); m_pSpecies_B_ij.resize(num, npos); - } void MixedSolventElectrolyte::readXMLBinarySpecies(XML_Node& xmLBinarySpecies) diff --git a/src/thermo/MixtureFugacityTP.cpp b/src/thermo/MixtureFugacityTP.cpp index c2829dc37..4e6e79959 100644 --- a/src/thermo/MixtureFugacityTP.cpp +++ b/src/thermo/MixtureFugacityTP.cpp @@ -347,7 +347,6 @@ void MixtureFugacityTP::setState_TP(doublereal t, doublereal pres) */ getMoleFractions(DATA_PTR(moleFractions_)); - Phase::setTemperature(t); _updateReferenceStateThermo(); // Depends on the mole fractions and the temperature @@ -375,9 +374,6 @@ void MixtureFugacityTP::setState_TP(doublereal t, doublereal pres) throw CanteraError("MixtureFugacityTP::setState_TP()", "neg rho"); } } - - - } else if (forcedState_ == FLUID_GAS) { // Normal density calculation if (iState_ < FLUID_LIQUID_0) { @@ -393,10 +389,7 @@ void MixtureFugacityTP::setState_TP(doublereal t, doublereal pres) } else { throw CanteraError("MixtureFugacityTP::setState_TP()", "neg rho"); } - } - - } else if (forcedState_ > FLUID_LIQUID_0) { if (iState_ >= FLUID_LIQUID_0) { double rhoNow = Phase::density(); @@ -411,7 +404,6 @@ void MixtureFugacityTP::setState_TP(doublereal t, doublereal pres) } else { throw CanteraError("MixtureFugacityTP::setState_TP()", "neg rho"); } - } } } @@ -497,7 +489,6 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa, */ rhoguess = presPa * mmw / (GasConstant * TKelvin); } - } double molarVolBase = mmw / rhoguess; @@ -524,13 +515,9 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa, * The algorithm is taken from dfind() */ for (int n = 0; n < 200; n++) { - /* * Calculate the predicted reduced pressure, pred0, based on the * current tau and dd. - */ - - /* * Calculate the derivative of the predicted pressure * wrt the molar volume. * This routine also returns the pressure, presBase @@ -622,7 +609,6 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa, molarVolLast = molarVolBase; molarVolBase += delMV; - if (fabs(delMV/molarVolBase) < 1.0E-14) { conv = true; break; @@ -634,10 +620,8 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa, if (molarVolBase <= 0.0) { molarVolBase = std::min(1.0E-30, fabs(delMV*1.0E-4)); } - } - /* * Check for convergence, and return 0.0 if it wasn't achieved. */ @@ -672,7 +656,6 @@ int MixtureFugacityTP::spinodalFunc::evalSS(const doublereal t, const doublereal int MixtureFugacityTP::corr0(doublereal TKelvin, doublereal pres, doublereal& densLiqGuess, doublereal& densGasGuess, doublereal& liqGRT, doublereal& gasGRT) { - int retn = 0; doublereal densLiq = densityCalc(TKelvin, pres, FLUID_LIQUID_0, densLiqGuess); if (densLiq <= 0.0) { @@ -736,7 +719,6 @@ int MixtureFugacityTP::phaseState(bool checkState) const } else { state = FLUID_UNSTABLE; } - } return state; } @@ -787,7 +769,6 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola double pres; doublereal mw = meanMolecularWeight(); if (TKelvin < critTemperature()) { - pres = psatEst(TKelvin); // trial value = Psat from correlation doublereal volLiquid = liquidVolEst(TKelvin, pres); @@ -895,11 +876,9 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola double RhoGas = RhoGasGood; double RhoLiquid = RhoLiquidGood; - /* * Now that we have found a good pressure we can proceed with the algorithm. */ - for (int i = 0; i < 20; i++) { int stab = corr0(TKelvin, pres, RhoLiquid, RhoGas, liqGRT, gasGRT); if (stab == 0) { @@ -916,7 +895,6 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola } } pres += dp; - } else if (stab == -1) { delGRT = 1.0E6; if (presLast > pres) { @@ -936,7 +914,6 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola molarVolGas = mw / RhoGas; molarVolLiquid = mw / RhoLiquid; - if (fabs(delGRT) < 1.0E-8) { // converged break; @@ -947,10 +924,7 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola molarVolLiquid = mw / RhoLiquid; // Put the fluid in the desired end condition setState_TR(tempSave, densSave); - return pres; - - } else { pres = critPressure(); setState_TP(TKelvin, pres); diff --git a/src/thermo/MolalityVPSSTP.cpp b/src/thermo/MolalityVPSSTP.cpp index ad7957d4b..f34ceaa7d 100644 --- a/src/thermo/MolalityVPSSTP.cpp +++ b/src/thermo/MolalityVPSSTP.cpp @@ -234,7 +234,6 @@ void MolalityVPSSTP::setMolalitiesByName(const compositionMap& mMap) "unbalanced charges"); } } - } sum = 0.0; for (size_t k = 0; k < m_kk; k++) { @@ -367,12 +366,10 @@ void MolalityVPSSTP::setState_TPM(doublereal t, doublereal p, const std::string& setState_TP(t, p); } - void MolalityVPSSTP::initThermo() { initLengths(); VPStandardStateTP::initThermo(); - /* * The solvent defaults to species 0 */ @@ -458,19 +455,14 @@ void MolalityVPSSTP::initLengths() void MolalityVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_) { - initLengths(); /* * The solvent defaults to species 0 */ setSolvent(0); - VPStandardStateTP::initThermoXML(phaseNode, id_); } -/** - * Format a summary of the mixture state for output. - */ std::string MolalityVPSSTP::report(bool show_thermo, doublereal threshold) const { char p[800]; diff --git a/src/thermo/MolarityIonicVPSSTP.cpp b/src/thermo/MolarityIonicVPSSTP.cpp index 9eac4f6d5..710891efe 100644 --- a/src/thermo/MolarityIonicVPSSTP.cpp +++ b/src/thermo/MolarityIonicVPSSTP.cpp @@ -272,27 +272,18 @@ void MolarityIonicVPSSTP::calcPseudoBinaryMoleFractions() const sum = std::max(0.0, PBMoleFractions_[0]); for (size_t k = 1; k < numPBSpecies_; k++) { sum += PBMoleFractions_[k]; - } for (size_t k = 0; k < numPBSpecies_; k++) { PBMoleFractions_[k] /= sum; } - break; } case PBTYPE_SINGLECATION: throw CanteraError("eosType", "Unknown type"); - - break; - case PBTYPE_MULTICATIONANION: throw CanteraError("eosType", "Unknown type"); - - break; default: throw CanteraError("eosType", "Unknown type"); - break; - } } @@ -390,7 +381,6 @@ void MolarityIonicVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& } } - /* * Go down the chain */ @@ -436,7 +426,6 @@ std::string MolarityIonicVPSSTP::report(bool show_thermo, doublereal threshold) getStandardChemPotentials(&muss[0]); getActivities(&actMolal[0]); - if (show_thermo) { sprintf(p, " \n"); s += p; @@ -469,7 +458,6 @@ std::string MolarityIonicVPSSTP::report(bool show_thermo, doublereal threshold) s += p; } } - } catch (CanteraError& e) { e.save(); } diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index b830c371b..f2af5c3e8 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -136,9 +136,7 @@ Mu0Poly* newMu0ThermoFromXML(const XML_Node& Mu0Node) } } - vector_fp c(2 + 2 * numPoints); - c[0] = static_cast(numPoints); c[1] = h298; for (size_t i = 0; i < numPoints; i++) { diff --git a/src/thermo/Nasa9Poly1.cpp b/src/thermo/Nasa9Poly1.cpp index 0a061d766..c157e12eb 100644 --- a/src/thermo/Nasa9Poly1.cpp +++ b/src/thermo/Nasa9Poly1.cpp @@ -62,7 +62,6 @@ void Nasa9Poly1::updateProperties(const doublereal* tt, doublereal ct5 = m_coeff[5] * tt[2]; // a5 * T^3 doublereal ct6 = m_coeff[6] * tt[3]; // a6 * T^4 - doublereal cpdivR = ct0 + ct1 + ct2 + ct3 + ct4 + ct5 + ct6; doublereal hdivRT = -ct0 + tt[6]*ct1 + ct2 + 0.5*ct3 + 1.0/3.0*ct4 + 0.25*ct5 + 0.2*ct6 + m_coeff[7] * tt[4]; diff --git a/src/thermo/Nasa9PolyMultiTempRegion.cpp b/src/thermo/Nasa9PolyMultiTempRegion.cpp index 203a20195..a22202c18 100644 --- a/src/thermo/Nasa9PolyMultiTempRegion.cpp +++ b/src/thermo/Nasa9PolyMultiTempRegion.cpp @@ -176,7 +176,6 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type, } index += 11; } - } void Nasa9PolyMultiTempRegion::modifyParameters(doublereal* coeffs) diff --git a/src/thermo/PDSS.cpp b/src/thermo/PDSS.cpp index 481cf242d..7c0f2911c 100644 --- a/src/thermo/PDSS.cpp +++ b/src/thermo/PDSS.cpp @@ -297,7 +297,6 @@ doublereal PDSS::enthalpyDelp_mole() const doublereal PDSS::entropyDelp_mole() const { return entropy_mole() - GasConstant * entropy_R_ref(); - } doublereal PDSS::gibbsDelp_mole() const diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index e5adc0594..cb4e6e98b 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -109,7 +109,6 @@ void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, * The phase object automatically constructs an XML object. * Use this object to store information. */ - XML_Node fxml; fxml.build(fin); XML_Node* fxml_phase = findXMLPhase(&fxml, id); @@ -123,7 +122,6 @@ void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &fxml_phase->root()); const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); } @@ -231,7 +229,6 @@ void PDSS_ConstVol::setTemperature(doublereal temp) m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex]; m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; - } void PDSS_ConstVol::setState_TP(doublereal temp, doublereal pres) diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index f99733b18..1aea7efbe 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -242,11 +242,8 @@ doublereal PDSS_HKFT::cp_mole() const { doublereal pbar = m_pres * 1.0E-5; doublereal c1term = m_c1; - doublereal c2term = m_c2 / (m_temp - 228.) / (m_temp - 228.); - doublereal a3term = -m_a3 / (m_temp - 228.) / (m_temp - 228.) / (m_temp - 228.) * 2.0 * m_temp * (pbar - m_presR_bar); - doublereal a4term = -m_a4 / (m_temp - 228.) / (m_temp - 228.) / (m_temp - 228.) * 2.0 * m_temp * log((2600. + pbar)/(2600. + m_presR_bar)); @@ -260,49 +257,36 @@ doublereal PDSS_HKFT::cp_mole() const } else { doublereal nu = 166027; doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082); - doublereal gval = gstar(m_temp, m_pres, 0); - doublereal dgvaldT = gstar(m_temp, m_pres, 1); doublereal d2gvaldT2 = gstar(m_temp, m_pres, 2); doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; doublereal d2r_e_jdT2 = fabs(m_charge_j) * d2gvaldT2; - doublereal r_e_j2 = r_e_j * r_e_j; doublereal charge2 = m_charge_j * m_charge_j; - doublereal r_e_H = 3.082 + gval; doublereal r_e_H2 = r_e_H * r_e_H; - omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H); - domega_jdT = nu * (-(charge2 / r_e_j2 * dr_e_jdT) +(m_charge_j / r_e_H2 * dgvaldT)); - d2omega_jdT2 = nu * (2.0*charge2*dr_e_jdT*dr_e_jdT/(r_e_j2*r_e_j) - charge2*d2r_e_jdT2/r_e_j2 -2.0*m_charge_j*dgvaldT*dgvaldT/(r_e_H2*r_e_H) + m_charge_j*d2gvaldT2 /r_e_H2); } doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0); doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1); - doublereal Y = drelepsilondT / (relepsilon * relepsilon); - doublereal d2relepsilondT2 = m_waterProps->relEpsilon(m_temp, m_pres, 2); doublereal X = d2relepsilondT2 / (relepsilon* relepsilon) - 2.0 * relepsilon * Y * Y; - doublereal Z = -1.0 / relepsilon; doublereal yterm = 2.0 * m_temp * Y * domega_jdT; - doublereal xterm = omega_j * m_temp * X; - doublereal otterm = m_temp * d2omega_jdT2 * (Z + 1.0); - doublereal rterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); doublereal Cp_calgmol = c1term + c2term + a3term + a4term + yterm + xterm + otterm + rterm; @@ -318,11 +302,8 @@ doublereal PDSS_HKFT::molarVolume() const // Initially do all calculations in (cal/gmol/Pa) doublereal a1term = m_a1 * 1.0E-5; - doublereal a2term = m_a2 / (2600.E5 + m_pres); - doublereal a3term = m_a3 * 1.0E-5/ (m_temp - 228.); - doublereal a4term = m_a4 / (m_temp - 228.) / (2600.E5 + m_pres); doublereal omega_j; @@ -342,25 +323,17 @@ doublereal PDSS_HKFT::molarVolume() const doublereal r_e_H = 3.082 + gval; omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H); - doublereal dr_e_jdP = fabs(m_charge_j) * dgvaldP; - domega_jdP = - nu * (charge2 / (r_e_j * r_e_j) * dr_e_jdP) + nu * m_charge_j / (r_e_H * r_e_H) * dgvaldP; } doublereal drelepsilondP = m_waterProps->relEpsilon(m_temp, m_pres, 3); - doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0); - doublereal Q = drelepsilondP / (relepsilon * relepsilon); - doublereal Z = -1.0 / relepsilon; - doublereal wterm = - domega_jdP * (Z + 1.0); - doublereal qterm = - omega_j * Q; - doublereal molVol_calgmolPascal = a1term + a2term + a3term + a4term + wterm + qterm; // Convert to m**3 / kmol from (cal/gmol/Pa) @@ -434,17 +407,12 @@ void PDSS_HKFT::initThermo() m_temp = 273.15 + 25.; m_pres = OneAtm; doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0); - m_waterSS->setState_TP(m_temp, m_pres); m_densWaterSS = m_waterSS->density(); m_Z_pr_tr = -1.0 / relepsilon; - doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1); - m_Y_pr_tr = drelepsilondT / (relepsilon * relepsilon); - m_waterProps = new WaterProps(m_waterSS); - m_presR_bar = OneAtm / 1.0E5; m_presR_bar = 1.0; m_charge_j = m_tp->charge(m_spindex); @@ -452,32 +420,28 @@ void PDSS_HKFT::initThermo() //! Ok, we have mu. Let's check it against the input value // of DH_F to see that we have some internal consistency - doublereal Hcalc = m_Mu0_tr_pr + 298.15 * (m_Entrop_tr_pr * 1.0E3 * 4.184); - doublereal DHjmol = m_deltaH_formation_tr_pr * 1.0E3 * 4.184; // If the discrepancy is greater than 100 cal gmol-1, print // an error and exit. if (fabs(Hcalc -DHjmol) > 100.* 1.0E3 * 4.184) { - std::string sname = m_tp->speciesName(m_spindex); - if (s_InputInconsistencyErrorExit) { - - throw CanteraError(" PDSS_HKFT::initThermo() for " + sname, - "DHjmol is not consistent with G and S: " + - fp2str(Hcalc/(4.184E3)) + " vs " - + fp2str(m_deltaH_formation_tr_pr) + "cal gmol-1"); - } else { - writelog(" PDSS_HKFT::initThermo() WARNING: " - "DHjmol for " + sname + " is not consistent with G and S: calculated " + - fp2str(Hcalc/(4.184E3)) + " vs input " - + fp2str(m_deltaH_formation_tr_pr) + "cal gmol-1"); - writelog(" : continuing with consistent DHjmol = " + fp2str(Hcalc/(4.184E3))); - m_deltaH_formation_tr_pr = Hcalc / (1.0E3 * 4.184); - } + std::string sname = m_tp->speciesName(m_spindex); + if (s_InputInconsistencyErrorExit) { + throw CanteraError(" PDSS_HKFT::initThermo() for " + sname, + "DHjmol is not consistent with G and S: " + + fp2str(Hcalc/(4.184E3)) + " vs " + + fp2str(m_deltaH_formation_tr_pr) + "cal gmol-1"); + } else { + writelog(" PDSS_HKFT::initThermo() WARNING: " + "DHjmol for " + sname + " is not consistent with G and S: calculated " + + fp2str(Hcalc/(4.184E3)) + " vs input " + + fp2str(m_deltaH_formation_tr_pr) + "cal gmol-1"); + writelog(" : continuing with consistent DHjmol = " + fp2str(Hcalc/(4.184E3))); + m_deltaH_formation_tr_pr = Hcalc / (1.0E3 * 4.184); + } } doublereal nu = 166027; - doublereal r_e_j_pr_tr; if (m_charge_j != 0.0) { r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082); @@ -489,12 +453,9 @@ void PDSS_HKFT::initThermo() m_domega_jdT_prtr = 0.0; } else { doublereal gval = gstar(m_temp, m_pres, 0); - doublereal dgvaldT = gstar(m_temp, m_pres, 1); - doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; - m_domega_jdT_prtr = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } @@ -619,7 +580,6 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, throw CanteraError("PDSS_HKFT::constructPDSSXML", " missing omega_Pr_Tr field"); } - int isum = hasDGO + hasDHO + hasSO; if (isum < 2) { throw CanteraError("PDSS_HKFT::constructPDSSXML", @@ -651,7 +611,6 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, doublereal DHjmol = m_deltaH_formation_tr_pr * 1.0E3 * 4.184; m_Entrop_tr_pr = (DHjmol - m_Mu0_tr_pr) / (298.15 * 1.0E3 * 4.184); } - } void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, @@ -672,7 +631,6 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, * The phase object automatically constructs an XML object. * Use this object to store information. */ - XML_Node fxml; fxml.build(fin); XML_Node* fxml_phase = findXMLPhase(&fxml, id); @@ -686,7 +644,6 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &fxml_phase->root()); const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); } @@ -694,21 +651,13 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, doublereal PDSS_HKFT::deltaH() const { doublereal pbar = m_pres * 1.0E-5; - doublereal c1term = m_c1 * (m_temp - 298.15); - doublereal a1term = m_a1 * (pbar - m_presR_bar); - doublereal a2term = m_a2 * log((2600. + pbar)/(2600. + m_presR_bar)); - doublereal c2term = -m_c2 * (1.0/(m_temp - 228.) - 1.0/(298.15 - 228.)); - double a3tmp = (2.0 * m_temp - 228.)/ (m_temp - 228.) /(m_temp - 228.); - doublereal a3term = m_a3 * a3tmp * (pbar - m_presR_bar); - doublereal a4term = m_a4 * a3tmp * log((2600. + pbar)/(2600. + m_presR_bar)); - doublereal omega_j; doublereal domega_jdT; if (m_charge_j == 0.0) { @@ -719,12 +668,9 @@ doublereal PDSS_HKFT::deltaH() const doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082); doublereal gval = gstar(m_temp, m_pres, 0); doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; - doublereal dgvaldT = gstar(m_temp, m_pres, 1); doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; - omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval)); - domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } @@ -733,7 +679,6 @@ doublereal PDSS_HKFT::deltaH() const doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1); doublereal Y = drelepsilondT / (relepsilon * relepsilon); - doublereal Z = -1.0 / relepsilon; doublereal yterm = m_temp * omega_j * Y; @@ -757,17 +702,12 @@ doublereal PDSS_HKFT::deltaG() const { doublereal pbar = m_pres * 1.0E-5; doublereal sterm = - m_Entrop_tr_pr * (m_temp - 298.15); - doublereal c1term = -m_c1 * (m_temp * log(m_temp/298.15) - (m_temp - 298.15)); doublereal a1term = m_a1 * (pbar - m_presR_bar); - doublereal a2term = m_a2 * log((2600. + pbar)/(2600. + m_presR_bar)); - doublereal c2term = -m_c2 * ((1.0/(m_temp - 228.) - 1.0/(298.15 - 228.)) * (228. - m_temp)/228. - m_temp / (228.*228.) * log((298.15*(m_temp-228.)) / (m_temp*(298.15-228.)))); - doublereal a3term = m_a3 / (m_temp - 228.) * (pbar - m_presR_bar); - doublereal a4term = m_a4 / (m_temp - 228.) * log((2600. + pbar)/(2600. + m_presR_bar)); doublereal omega_j; @@ -782,15 +722,10 @@ doublereal PDSS_HKFT::deltaG() const } doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0); - doublereal Z = -1.0 / relepsilon; - doublereal wterm = - omega_j * (Z + 1.0); - doublereal wrterm = m_omega_pr_tr * (m_Z_pr_tr + 1.0); - doublereal yterm = m_omega_pr_tr * m_Y_pr_tr * (m_temp - 298.15); - doublereal deltaG_calgmol = sterm + c1term + a1term + a2term + c2term + a3term + a4term + wterm + wrterm + yterm; // Convert to Joules / kmol @@ -802,12 +737,9 @@ doublereal PDSS_HKFT::deltaS() const doublereal pbar = m_pres * 1.0E-5; doublereal c1term = m_c1 * log(m_temp/298.15); - doublereal c2term = -m_c2 / 228. * ((1.0/(m_temp - 228.) - 1.0/(298.15 - 228.)) + 1.0 / 228. * log((298.15*(m_temp-228.)) / (m_temp*(298.15-228.)))); - doublereal a3term = m_a3 / (m_temp - 228.) / (m_temp - 228.) * (pbar - m_presR_bar); - doublereal a4term = m_a4 / (m_temp - 228.) / (m_temp - 228.) * log((2600. + pbar)/(2600. + m_presR_bar)); doublereal omega_j; @@ -816,38 +748,25 @@ doublereal PDSS_HKFT::deltaS() const omega_j = m_omega_pr_tr; domega_jdT = 0.0; } else { - doublereal nu = 166027; doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082); - doublereal gval = gstar(m_temp, m_pres, 0); - doublereal dgvaldT = gstar(m_temp, m_pres, 1); - doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; - omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval)); - domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0); doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1); - doublereal Y = drelepsilondT / (relepsilon * relepsilon); - doublereal Z = -1.0 / relepsilon; - doublereal wterm = omega_j * Y; - doublereal wrterm = - m_omega_pr_tr * m_Y_pr_tr; - doublereal otterm = domega_jdT * (Z + 1.0); - doublereal otrterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); - doublereal deltaS_calgmol = c1term + c2term + a3term + a4term + wterm + wrterm + otterm + otrterm; // Convert to Joules / kmol @@ -896,7 +815,6 @@ doublereal PDSS_HKFT::f(const doublereal temp, const doublereal pres, const int return 0.0; } - doublereal T1 = (TC-155.0)/300.; doublereal p2 = (1000. - presBar) * (1000. - presBar); doublereal p3 = (1000. - presBar) * p2; @@ -931,7 +849,6 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int } if (ifunc == 0) { return gval; - } else if (ifunc == 1 || ifunc == 2) { doublereal afuncdT = ag(temp, 1); doublereal bfuncdT = bg(temp, 1); @@ -948,17 +865,13 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int doublereal afuncdT2 = ag(temp, 2); doublereal bfuncdT2 = bg(temp, 2); - doublereal dfac1dT = dgdt * afuncdT / afunc + afuncdT2 * gval / afunc - afuncdT * afuncdT * gval / (afunc * afunc); - doublereal ddensdT = - alpha * dens; doublereal dfac2dT = bfuncdT2 * gval * log(1.0 - dens) + bfuncdT * dgdt * log(1.0 - dens) - bfuncdT * gval /(1.0 - dens) * ddensdT; - doublereal dalphadT = m_waterSS->dthermalExpansionCoeffdT(); - doublereal dfac3dT = dgdt * alpha * bfunc * dens / (1.0 - dens) + gval * dalphadT * bfunc * dens / (1.0 - dens) + gval * alpha * bfuncdT * dens / (1.0 - dens) @@ -966,10 +879,8 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int + gval * alpha * bfunc * dens / ((1.0 - dens) * (1.0 - dens)) * ddensdT; return dfac1dT + dfac2dT + dfac3dT; - } else if (ifunc == 3) { doublereal beta = m_waterSS->isothermalCompressibility(); - return - bfunc * gval * dens * beta / (1.0 - dens); } else { throw CanteraError("HKFT_PDSS::g", "unimplemented"); diff --git a/src/thermo/PDSS_IdealGas.cpp b/src/thermo/PDSS_IdealGas.cpp index 45cbd624c..d1c8bf913 100644 --- a/src/thermo/PDSS_IdealGas.cpp +++ b/src/thermo/PDSS_IdealGas.cpp @@ -200,7 +200,6 @@ void PDSS_IdealGas::setTemperature(doublereal temp) m_cp0_R_ptr, m_h0_RT_ptr, m_s0_R_ptr); m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; m_V0_ptr[m_spindex] = GasConstant * m_temp / m_p0; - m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex]; m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex] + log(m_pres/m_p0); diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index 02b7ef423..e83826baf 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -138,12 +138,10 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde std::vector key; std::vector val; - numMult_ = getPairs(*nsm, key, val); idNeutralMoleculeVec.resize(numMult_); factorVec.resize(numMult_); tmpNM.resize(neutralMoleculePhase_->nSpecies()); - for (size_t i = 0; i < numMult_; i++) { idNeutralMoleculeVec[i] = neutralMoleculePhase_->speciesIndex(key[i]); factorVec[i] = fpValueCheck(val[i]); @@ -180,7 +178,6 @@ void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spind * The phase object automatically constructs an XML object. * Use this object to store information. */ - XML_Node fxml; fxml.build(fin); XML_Node* fxml_phase = findXMLPhase(&fxml, id); @@ -194,7 +191,6 @@ void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spind XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &fxml_phase->root()); const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, id); } diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index a9bd82a33..722fd31c8 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -35,7 +35,6 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, volumeModel_(cSSVOLUME_CONSTANT), m_constMolarVolume(-1.0) { - m_pdssType = cPDSS_SSVOL; constructPDSSFile(tp, spindex, inputFile, id); } @@ -138,7 +137,6 @@ void PDSS_SSVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, * The phase object automatically constructs an XML object. * Use this object to store information. */ - XML_Node fxml; fxml.build(fin); XML_Node* fxml_phase = findXMLPhase(&fxml, id); @@ -152,7 +150,6 @@ void PDSS_SSVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &fxml_phase->root()); const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); } diff --git a/src/thermo/PDSS_Water.cpp b/src/thermo/PDSS_Water.cpp index c467e1fa9..9cf3aea73 100644 --- a/src/thermo/PDSS_Water.cpp +++ b/src/thermo/PDSS_Water.cpp @@ -1,6 +1,5 @@ /** * @file PDSS_Water.cpp - * */ /* * Copyright (2006) Sandia Corporation. Under the terms of @@ -155,7 +154,6 @@ void PDSS_Water::constructPDSSFile(VPStandardStateTP* tp, int spindex, * The phase object automatically constructs an XML object. * Use this object to store information. */ - XML_Node fxml; fxml.build(fin); XML_Node* fxml_phase = findXMLPhase(&fxml, id); @@ -179,9 +177,7 @@ void PDSS_Water::constructSet() * Set the baseline */ doublereal T = 298.15; - m_p0 = OneAtm; - doublereal presLow = 1.0E-2; doublereal oneBar = 1.0E5; doublereal dens = 1.0E-9; diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index 640fa04f5..230fc18e5 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -72,7 +72,6 @@ Phase& Phase::operator=(const Phase& right) m_speciesComp = right.m_speciesComp; m_speciesCharge = right.m_speciesCharge; m_speciesSize = right.m_speciesSize; - m_mm = right.m_mm; m_atomicWeights = right.m_atomicWeights; m_atomicNumbers = right.m_atomicNumbers; @@ -735,7 +734,6 @@ size_t Phase::addElement(const std::string& symbol, doublereal weight, } else { m_elem_type.push_back(elem_type); } - m_mm++; // Update species compositions diff --git a/src/thermo/PhaseCombo_Interaction.cpp b/src/thermo/PhaseCombo_Interaction.cpp index 3f6674a9c..d57808bc0 100644 --- a/src/thermo/PhaseCombo_Interaction.cpp +++ b/src/thermo/PhaseCombo_Interaction.cpp @@ -268,7 +268,6 @@ void PhaseCombo_Interaction::getPartialMolarVolumes(doublereal* vbar) const int delAK = 0; int delBK = 0; for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; @@ -280,10 +279,8 @@ void PhaseCombo_Interaction::getPartialMolarVolumes(doublereal* vbar) const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_VHE_b_ij[i] - T * m_VSE_b_ij[i]); double g1 = (m_VHE_c_ij[i] - T * m_VSE_c_ij[i]); - vbar[iK] += XA*XB*(g0+g1*XB)+((delAK-XA)*XB+XA*(delBK-XB))*(g0+g1*XB)+XA*XB*(delBK-XB)*g1; } } @@ -342,7 +339,6 @@ void PhaseCombo_Interaction::initThermoXML(XML_Node& phaseNode, const std::strin */ if (lowercase(xmlACChild.name()) == "binaryneutralspeciesparameters") { readXMLBinarySpecies(xmlACChild); - } } } @@ -351,8 +347,6 @@ void PhaseCombo_Interaction::initThermoXML(XML_Node& phaseNode, const std::strin * Go down the chain */ GibbsExcessVPSSTP::initThermoXML(phaseNode, id); - - } void PhaseCombo_Interaction::s_update_lnActCoeff() const @@ -456,7 +450,6 @@ void PhaseCombo_Interaction::getdlnActCoeffds(const doublereal dTds, const doub for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - int delAK = 0; int delBK = 0; @@ -468,13 +461,10 @@ void PhaseCombo_Interaction::getdlnActCoeffds(const doublereal dTds, const doub double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double dXA = dXds[iA]; double dXB = dXds[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / (GasConstant*T); double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / (GasConstant*T); - dlnActCoeffds[iK] += ((delBK-XB)*dXA + (delAK-XA)*dXB)*(g0+2*g1*XB) + (delBK-XB)*2*g1*XA*dXB + dlnActCoeffdT_Scaled_[iK]*dTds; } @@ -487,7 +477,6 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN_diag() const dlnActCoeffdlnN_diag_.assign(m_kk, 0.0); for (size_t iK = 0; iK < m_kk; iK++) { - double XK = moleFractions_[iK]; /* * We never sample the end of the mole fraction domains @@ -503,7 +492,6 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN_diag() const for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - int delAK = 0; int delBK = 0; @@ -515,15 +503,12 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN_diag() const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / (GasConstant*T); double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / (GasConstant*T); - dlnActCoeffdlnN_diag_[iK] += 2*(delBK-XB)*(g0*(delAK-XA)+g1*(2*(delAK-XA)*XB+XA*(delBK-XB))); } dlnActCoeffdlnN_diag_[iK] = XK*dlnActCoeffdlnN_diag_[iK]; } - } void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN() const @@ -539,10 +524,8 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN() const * We never sample the end of the mole fraction domains */ double xx = std::max(moleFractions_[iK], SmallNumber); - for (size_t iM = 0; iM < m_kk; iM++) { double XM = moleFractions_[iM]; - if (xx > SmallNumber) { double delKM = 0.0; if (iK == iM) { @@ -555,7 +538,6 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN() const for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; - double delAK = 0.0; double delBK = 0.0; double delAM = 0.0; @@ -573,13 +555,10 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN() const double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; - double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / (GasConstant*T); double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / (GasConstant*T); - dlnActCoeffdlnN_(iK,iM) += g0*((delAM-XA)*(delBK-XB)+(delAK-XA)*(delBM-XB)); dlnActCoeffdlnN_(iK,iM) += 2*g1*((delAM-XA)*(delBK-XB)*XB+(delAK-XA)*(delBM-XB)*XB+(delBM-XB)*(delBK-XB)*XA); - } dlnActCoeffdlnN_(iK,iM) = XM * dlnActCoeffdlnN_(iK,iM); } @@ -648,7 +627,6 @@ void PhaseCombo_Interaction::resizeNumInteractions(const size_t num) m_VSE_b_ij.resize(num, 0.0); m_VSE_c_ij.resize(num, 0.0); m_VSE_d_ij.resize(num, 0.0); - m_pSpecies_A_ij.resize(num, npos); m_pSpecies_B_ij.resize(num, npos); } diff --git a/src/thermo/RedlichKisterVPSSTP.cpp b/src/thermo/RedlichKisterVPSSTP.cpp index dd8f399f4..14915330a 100644 --- a/src/thermo/RedlichKisterVPSSTP.cpp +++ b/src/thermo/RedlichKisterVPSSTP.cpp @@ -4,7 +4,6 @@ * employ excess Gibbs free energy formulations related to RedlichKister * expansions (see \ref thermoprops * and class \link Cantera::RedlichKisterVPSSTP RedlichKisterVPSSTP\endlink). - * */ /* * Copyright (2009) Sandia Corporation. Under the terms of @@ -253,7 +252,6 @@ void RedlichKisterVPSSTP::getPartialMolarVolumes(doublereal* vbar) const */ getStandardVolumes(vbar); for (size_t iK = 0; iK < m_kk; iK++) { - vbar[iK] += 0.0; } } @@ -330,7 +328,6 @@ void RedlichKisterVPSSTP::s_update_lnActCoeff() const * within the routine. There is a severe problem with roundoff error in these calculations. The * dimensionless terms help. */ - for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; @@ -368,7 +365,6 @@ void RedlichKisterVPSSTP::s_update_lnActCoeff() const } // Debug against formula in literature } - } void RedlichKisterVPSSTP::s_update_dlnActCoeff_dT() const @@ -385,7 +381,6 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dT() const size_t N = m_N_ij[i]; doublereal poly = 1.0; doublereal sum = 0.0; - vector_fp& se_vec = m_SE_m_ij[i]; doublereal sumMm1 = 0.0; doublereal polyMm1 = 1.0; @@ -433,7 +428,6 @@ void RedlichKisterVPSSTP::getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) const void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const { doublereal T = temperature(); - dlnActCoeff_dX_.zero(); for (size_t i = 0; i < numBinaryInteractions_; i++) { @@ -471,7 +465,6 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const for (size_t k = 0; k < m_kk; k++) { if (iA == k) { - dlnActCoeff_dX_(k, iA) += (- XB * sum + (1.0 - XA) * XB * sumMm1 + XB * sumMm1 * (1.0 - 2.0 * XA + XB) + XA * XB * sumMm2 * (1.0 - XA + XB)); @@ -479,9 +472,7 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const dlnActCoeff_dX_(k, iB) += ((1.0 - XA) * sum - (1.0 - XA) * XB * sumMm1 + XA * sumMm1 * (1.0 + 2.0 * XB - XA) - XA * XB * sumMm2 * (1.0 - XA + XB)); - } else if (iB == k) { - dlnActCoeff_dX_(k, iA) += ((1.0 - XB) * sum + (1.0 - XA) * XB * sumMm1 + XB * sumMm1 * (1.0 - 2.0 * XA + XB) + XA * XB * sumMm2 * (1.0 - XA + XB)); @@ -490,11 +481,8 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const + XA * sumMm1 * (XB - XA - (1.0 - XB)) - XA * XB * sumMm2 * (-XA - (1.0 - XB))); } else { - dlnActCoeff_dX_(k, iA) += (- XB * sum2 - XA * XB * sum2Mm1); - dlnActCoeff_dX_(k, iB) += (- XA * sum2 + XA * XB * sum2Mm1); - } } } @@ -638,7 +626,6 @@ void RedlichKisterVPSSTP::Vint(double& VintOut, double& voltsOut) double XA; doublereal T = temperature(); double Volts = 0.0; - lnActCoeff_Scaled_.assign(m_kk, 0.0); for (size_t i = 0; i < numBinaryInteractions_; i++) { @@ -671,7 +658,6 @@ void RedlichKisterVPSSTP::Vint(double& VintOut, double& voltsOut) Volts /= Faraday; double termp = GasConstant * T * log((1.0 - XA)/XA) / Faraday; - VintOut = Volts; voltsOut = Volts + termp; } diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 152417343..9a8bc2f60 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -13,7 +13,6 @@ */ #include "cantera/thermo/RedlichKwongMFTP.h" - #include "cantera/thermo/mix_defs.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/numerics/RootFind.h" @@ -203,9 +202,7 @@ doublereal RedlichKwongMFTP::pressure() const // Get a copy of the private variables stored in the State object doublereal T = temperature(); double molarV = meanMolecularWeight() / density(); - double pp = GasConstant * T/(molarV - m_b_current) - m_a_current/(sqrt(T) * molarV * (molarV + m_b_current)); - if (fabs(pp -m_Pcurrent) > 1.0E-5 * fabs(m_Pcurrent)) { throw CanteraError(" RedlichKwongMFTP::pressure()", "setState broken down, maybe"); } @@ -218,7 +215,6 @@ void RedlichKwongMFTP::calcDensity() /* * Calculate the molarVolume of the solution (m**3 kmol-1) */ - const doublereal* const dtmp = moleFractdivMMW(); getPartialMolarVolumes(DATA_PTR(m_tmpV)); double invDens = dot(m_tmpV.begin(), m_tmpV.end(), dtmp); @@ -376,10 +372,8 @@ void RedlichKwongMFTP::getPartialMolarEnthalpies(doublereal* hbar) const doublereal TKelvin = temperature(); doublereal mv = molarVolume(); doublereal sqt = sqrt(TKelvin); - doublereal vpb = mv + m_b_current; doublereal vmb = mv - m_b_current; - for (size_t k = 0; k < m_kk; k++) { m_pp[k] = 0.0; for (size_t i = 0; i < m_kk; i++) { @@ -387,9 +381,6 @@ void RedlichKwongMFTP::getPartialMolarEnthalpies(doublereal* hbar) const m_pp[k] += moleFractions_[i] * a_vec_Curr_[counter]; } } - - - for (size_t k = 0; k < m_kk; k++) { dpdni_[k] = rt/vmb + rt * b_vec_Curr_[k] / (vmb * vmb) - 2.0 * m_pp[k] / (sqt * mv * vpb) + m_a_current * b_vec_Curr_[k]/(sqt * mv * vpb * vpb); @@ -407,17 +398,13 @@ void RedlichKwongMFTP::getPartialMolarEnthalpies(doublereal* hbar) const pressureDerivatives(); doublereal fac2 = mv + TKelvin * dpdT_ / dpdV_; - for (size_t k = 0; k < m_kk; k++) { double hE_v = (mv * dpdni_[k] - rt - b_vec_Curr_[k]/ (m_b_current * m_b_current * sqt) * log(vpb/mv)*fac + 1.0 / (m_b_current * sqt) * log(vpb/mv) * m_tmpV[k] + b_vec_Curr_[k] / vpb / (m_b_current * sqt) * fac); hbar[k] = hbar[k] + hE_v; - - hbar[k] -= fac2 * dpdni_[k]; } - } void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const @@ -434,7 +421,6 @@ void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const doublereal xx = std::max(SmallNumber, moleFraction(k)); sbar[k] += r * (- log(xx)); } - for (size_t k = 0; k < m_kk; k++) { m_pp[k] = 0.0; for (size_t i = 0; i < m_kk; i++) { @@ -442,7 +428,6 @@ void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const m_pp[k] += moleFractions_[i] * a_vec_Curr_[counter]; } } - for (size_t k = 0; k < m_kk; k++) { m_tmpV[k] = 0.0; for (size_t i = 0; i < m_kk; i++) { @@ -451,13 +436,10 @@ void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const } } - doublereal dadt = da_dt(); doublereal fac = dadt - m_a_current / (2.0 * TKelvin); doublereal vmb = mv - m_b_current; doublereal vpb = mv + m_b_current; - - for (size_t k = 0; k < m_kk; k++) { sbar[k] -=(GasConstant * log(GasConstant * TKelvin / (refP * mv)) + GasConstant @@ -500,7 +482,6 @@ void RedlichKwongMFTP::getPartialMolarVolumes(doublereal* vbar) const m_pp[k] += moleFractions_[i] * a_vec_Curr_[counter]; } } - for (size_t k = 0; k < m_kk; k++) { m_tmpV[k] = 0.0; for (size_t i = 0; i < m_kk; i++) { @@ -512,26 +493,19 @@ void RedlichKwongMFTP::getPartialMolarVolumes(doublereal* vbar) const doublereal TKelvin = temperature(); doublereal sqt = sqrt(TKelvin); doublereal mv = molarVolume(); - doublereal rt = GasConstant * TKelvin; - doublereal vmb = mv - m_b_current; doublereal vpb = mv + m_b_current; - for (size_t k = 0; k < m_kk; k++) { - doublereal num = (rt + rt * m_b_current/ vmb + rt * b_vec_Curr_[k] / vmb + rt * m_b_current * b_vec_Curr_[k] /(vmb * vmb) - 2.0 * m_pp[k] / (sqt * vpb) + m_a_current * b_vec_Curr_[k] / (sqt * vpb * vpb) ); - doublereal denom = (m_Pcurrent + rt * m_b_current/(vmb * vmb) - m_a_current / (sqt * vpb * vpb) ); - vbar[k] = num / denom; } - } doublereal RedlichKwongMFTP::critTemperature() const @@ -563,7 +537,6 @@ doublereal RedlichKwongMFTP::critPressure() const } } calcCriticalConditions(m_a_current, m_b_current, a0, aT, pc, tc, vc); - return pc; } @@ -612,7 +585,6 @@ doublereal RedlichKwongMFTP::critDensity() const } } calcCriticalConditions(m_a_current, m_b_current, a0, aT, pc, tc, vc); - double mmw = meanMolecularWeight(); return mmw / vc; } @@ -627,10 +599,8 @@ void RedlichKwongMFTP::setToEquilState(const doublereal* mu_RT) { double tmp, tmp2; _updateReferenceStateThermo(); - getGibbs_RT_ref(DATA_PTR(m_tmpV)); - /* * Within the method, we protect against inf results if the * exponent is too high. @@ -744,7 +714,6 @@ void RedlichKwongMFTP::initThermoXML(XML_Node& phaseNode, const std::string& id) readXMLCrossFluid(xmlACChild); } } - } } @@ -950,23 +919,18 @@ doublereal RedlichKwongMFTP::liquidVolEst(doublereal TKelvin, doublereal& presGu double atmp; double btmp; calculateAB(TKelvin, atmp, btmp); - doublereal pres = std::max(psatEst(TKelvin), presGuess); double Vroot[3]; - bool foundLiq = false; int m = 0; while (m < 100 && !foundLiq) { - int nsol = NicholsSolve(TKelvin, pres, atmp, btmp, Vroot); - if (nsol == 1 || nsol == 2) { double pc = critPressure(); if (pres > pc) { foundLiq = true; } pres *= 1.04; - } else { foundLiq = true; } @@ -983,7 +947,6 @@ doublereal RedlichKwongMFTP::liquidVolEst(doublereal TKelvin, doublereal& presGu doublereal RedlichKwongMFTP::densityCalc(doublereal TKelvin, doublereal presPa, int phaseRequested, doublereal rhoguess) { - /* * It's necessary to set the temperature so that m_a_current is set correctly. */ @@ -1009,7 +972,6 @@ doublereal RedlichKwongMFTP::densityCalc(doublereal TKelvin, doublereal presPa, */ rhoguess = presPa * mmw / (GasConstant * TKelvin); } - } doublereal volguess = mmw / rhoguess; @@ -1063,7 +1025,6 @@ doublereal RedlichKwongMFTP::densSpinodalLiquid() const double vbest = 0.5 * (Vroot_[0]+Vroot_[1]); double funcNeeded = 0.0; - int status = rf.solve(vmin, vmax, 100, funcNeeded, &vbest); if (status != ROOTFIND_SUCCESS) { throw CanteraError(" RedlichKwongMFTP::densSpinodalLiquid() ", "didn't converge"); @@ -1086,7 +1047,6 @@ doublereal RedlichKwongMFTP::densSpinodalGas() const double vbest = 0.5 * (Vroot_[1]+Vroot_[2]); double funcNeeded = 0.0; - int status = rf.solve(vmin, vmax, 100, funcNeeded, &vbest); if (status != ROOTFIND_SUCCESS) { throw CanteraError(" RedlichKwongMFTP::densSpinodalGas() ", "didn't converge"); @@ -1123,13 +1083,11 @@ void RedlichKwongMFTP::pressureDerivatives() const doublereal pres; dpdV_ = dpdVCalc(TKelvin, mv, pres); - doublereal sqt = sqrt(TKelvin); doublereal vpb = mv + m_b_current; doublereal vmb = mv - m_b_current; doublereal dadt = da_dt(); doublereal fac = dadt - m_a_current/(2.0 * TKelvin); - dpdT_ = (GasConstant / vmb - fac / (sqt * mv * vpb)); } @@ -1222,7 +1180,6 @@ void RedlichKwongMFTP::calcCriticalConditions(doublereal a, doublereal b, double doublereal sqrttc, f, dfdt, deltatc; if (m_formTempParam == 0) { - tc = pow(tmp, pp); } else { tc = pow(tmp, pp); @@ -1268,7 +1225,6 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do // Derive the center of the cubic, x_N doublereal xN = - bn /(3 * an); - // Derive the value of delta**2. This is a key quantity that determines the number of turning points doublereal delta2 = (bn * bn - 3 * an * cn) / (9 * an * an); doublereal delta = 0.0; @@ -1295,16 +1251,13 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do } int nSolnValues; - double h2 = 4. * an * an * delta2 * delta2 * delta2; if (delta2 > 0.0) { delta = sqrt(delta2); } doublereal h = 2.0 * an * delta * delta2; - doublereal yN = 2.0 * bn * bn * bn / (27.0 * an * an) - bn * cn / (3.0 * an) + dn; - doublereal desc = yN * yN - h2; if (fabs(fabs(h) - fabs(yN)) < 1.0E-10) { @@ -1344,28 +1297,19 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do } doublereal p1 = pow(tmp1, 1./3.); doublereal p2 = pow(tmp2, 1./3.); - doublereal alpha = xN + sgn1 * p1 + sgn2 * p2; Vroot[0] = alpha; Vroot[1] = 0.0; Vroot[2] = 0.0; - tmp = an * Vroot[0] * Vroot[0] * Vroot[0] + bn * Vroot[0] * Vroot[0] + cn * Vroot[0] + dn; - } else if (desc < 0.0) { doublereal tmp = - yN/h; - doublereal val = acos(tmp); doublereal theta = val / 3.0; - doublereal oo = 2. * Pi / 3.; doublereal alpha = xN + 2. * delta * cos(theta); - doublereal beta = xN + 2. * delta * cos(theta + oo); - doublereal gamma = xN + 2. * delta * cos(theta + 2.0 * oo); - - Vroot[0] = beta; Vroot[1] = gamma; Vroot[2] = alpha; @@ -1426,7 +1370,6 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do } dresdV = 3.0 * an * Vroot[i] * Vroot[i] + 2.0 * bn * Vroot[i] + cn; double del = - res / dresdV; - Vroot[i] += del; if (fabs(del) / (fabs(Vroot[i]) + fabs(del)) < 1.0E-14) { break; @@ -1456,7 +1399,6 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do nSolnValues = -1; } } - } else { if (nSolnValues == 2) { if (delta > 0.0) { diff --git a/src/thermo/SemiconductorPhase.cpp b/src/thermo/SemiconductorPhase.cpp index 724379fd5..54749286f 100644 --- a/src/thermo/SemiconductorPhase.cpp +++ b/src/thermo/SemiconductorPhase.cpp @@ -10,7 +10,6 @@ static doublereal JoyceDixon(doublereal r) return log(r) + 1.0/sqrt(8.0)*r - (3.0/16.0 - sqrt(3.0)/9.0)*r*r; } - SemiconductorPhase::SemiconductorPhase(std::string infile, std::string id_) {} @@ -51,7 +50,6 @@ doublereal SemiconductorPhase::ec() const return ev() + bandgap(); } - // private void SemiconductorPhase::initLengths() { diff --git a/src/thermo/Species.cpp b/src/thermo/Species.cpp index dd2abee36..713f62a16 100644 --- a/src/thermo/Species.cpp +++ b/src/thermo/Species.cpp @@ -1,5 +1,4 @@ #include "cantera/thermo/Species.h" - #include "cantera/thermo/SpeciesThermoInterpType.h" #include "cantera/thermo/SpeciesThermoFactory.h" #include "cantera/transport/TransportData.h" diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index 8b174d0cc..b46ffd869 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -94,7 +94,6 @@ static SpeciesThermoInterpType* newNasaThermoFromXML(vector nodes) { const XML_Node& f0 = *nodes[0]; bool dualRange = (nodes.size() > 1); - double tmin0 = fpValue(f0["Tmin"]); double tmax0 = fpValue(f0["Tmax"]); @@ -192,16 +191,13 @@ SpeciesThermoInterpType* newShomateForMineralEQ3(const XML_Node& MinEQ3node) double t = 298.15 / 1000.; double H298smFs = As * t + Bs * t * t / 2.0 - Es / t; - double HcalcS = Hcalc / 1.0E6; double Fs = HcalcS - H298smFs; - double S298smGs = As * log(t) + Bs * t - Es/(2.0*t*t); double ScalcS = e / 1.0E3; double Gs = ScalcS - S298smGs; double c0[7] = {As, Bs, Cs, Ds, Es, Fs, Gs}; - return newSpeciesThermoInterpType(SHOMATE1, tmin0, tmax0, p0, c0); } @@ -303,7 +299,6 @@ static SpeciesThermoInterpType* newConstCpThermoFromXML(XML_Node& f) return newSpeciesThermoInterpType(CONSTANT_CP, tmin, tmax, p0, &c[0]); } - //! Create a NASA9 polynomial thermodynamic property parameterization for a //! species /*! diff --git a/src/thermo/SurfPhase.cpp b/src/thermo/SurfPhase.cpp index f10bba876..780d5f05c 100644 --- a/src/thermo/SurfPhase.cpp +++ b/src/thermo/SurfPhase.cpp @@ -370,7 +370,6 @@ void SurfPhase::setParametersFromXML(const XML_Node& eosdata) void SurfPhase::setStateFromXML(const XML_Node& state) { - double t; if (getOptionalFloat(state, "temperature", t, "temperature")) { setTemperature(t); diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index f0526edc5..9bdd036de 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -21,14 +21,11 @@ #include "cantera/thermo/RedlichKisterVPSSTP.h" #include "cantera/thermo/IonsFromNeutralVPSSTP.h" #include "cantera/thermo/PhaseCombo_Interaction.h" - #include "cantera/thermo/PureFluidPhase.h" #include "cantera/thermo/RedlichKwongMFTP.h" - #include "cantera/thermo/ConstDensityThermo.h" #include "cantera/thermo/SurfPhase.h" #include "cantera/thermo/EdgePhase.h" - #include "cantera/thermo/MetalPhase.h" #include "cantera/thermo/SemiconductorPhase.h" @@ -42,17 +39,14 @@ #include "cantera/thermo/MineralEQ3.h" #include "cantera/thermo/MetalSHEelectrons.h" #include "cantera/thermo/FixedChemPotSSTP.h" - #include "cantera/thermo/LatticeSolidPhase.h" #include "cantera/thermo/LatticePhase.h" - #include "cantera/thermo/HMWSoln.h" #include "cantera/thermo/DebyeHuckel.h" #include "cantera/thermo/IdealMolalSoln.h" #include "cantera/thermo/MolarityIonicVPSSTP.h" #include "cantera/thermo/MixedSolventElectrolyte.h" #include "cantera/thermo/IdealSolnGasVPSS.h" - #include "cantera/base/stringUtils.h" using namespace std; @@ -102,7 +96,6 @@ ThermoPhase* ThermoFactory::newThermoPhase(const std::string& model) } switch (ieos) { - case cIdealGas: return new IdealGasPhase; case cIncompressible: @@ -397,7 +390,6 @@ void importPhase(XML_Node& phase, ThermoPhase* th) // loop over the speciesArray elements for (size_t jsp = 0; jsp < sparrays.size(); jsp++) { - const XML_Node& speciesArray = *sparrays[jsp]; // If the speciesArray element has a child element diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 6adfc8d96..27662e5bd 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -181,8 +181,8 @@ void ThermoPhase::setState_TP(doublereal t, doublereal p) void ThermoPhase::setState_RPX(doublereal rho, doublereal p, const doublereal* x) { - setMoleFractions(x); - setState_RP(rho, p); + setMoleFractions(x); + setState_RP(rho, p); } void ThermoPhase::setState_RPX(doublereal rho, doublereal p, const compositionMap& x) @@ -484,7 +484,6 @@ void ThermoPhase::setState_SPorSV(doublereal Starget, doublereal p, double Snew = entropy_mass(); double Cpnew = (doSV) ? cv_mass() : cp_mass(); - double Stop = Snew; double Ttop = Tnew; double Sbot = Snew; @@ -758,7 +757,6 @@ void ThermoPhase::equilibrate(const std::string& XY, const std::string& solver, double rtol, int max_steps, int max_iter, int estimate_equil, int log_level) { - if (solver == "auto" || solver == "element_potential") { vector_fp initial_state; saveState(initial_state); @@ -968,7 +966,6 @@ std::string ThermoPhase::report(bool show_thermo, doublereal threshold) const getMassFractions(&y[0]); getChemPotentials(&mu[0]); doublereal rt = GasConstant * temperature(); - int nMinor = 0; doublereal xMinor = 0.0; doublereal yMinor = 0.0; @@ -1030,10 +1027,8 @@ void ThermoPhase::reportCSV(std::ofstream& csvFile) const int tabS = 15; int tabM = 30; csvFile.precision(8); - vector_fp X(nSpecies()); getMoleFractions(&X[0]); - std::vector pNames; std::vector data; getCsvReportData(pNames, data); diff --git a/src/thermo/VPSSMgr.cpp b/src/thermo/VPSSMgr.cpp index 47c7df86e..8f0ff8b86 100644 --- a/src/thermo/VPSSMgr.cpp +++ b/src/thermo/VPSSMgr.cpp @@ -95,7 +95,6 @@ VPSSMgr& VPSSMgr::operator=(const VPSSMgr& right) m_gss_RT = right.m_gss_RT; m_sss_R = right.m_sss_R; m_Vss = right.m_Vss; - mPDSS_h0_RT = right.mPDSS_h0_RT; mPDSS_cp0_R = right.mPDSS_cp0_R; mPDSS_g0_RT = right.mPDSS_g0_RT; @@ -122,7 +121,6 @@ void VPSSMgr::initAllPtrs(VPStandardStateTP* vp_ptr, m_spthermo = sp_ptr; // Take care of STITTbyPDSS objects - // Go see if the SpeciesThermo type is a GeneralSpeciesThermo GeneralSpeciesThermo* gst = dynamic_cast(sp_ptr); if (gst) { @@ -135,7 +133,6 @@ void VPSSMgr::initAllPtrs(VPStandardStateTP* vp_ptr, } } } - } // Standard States @@ -327,7 +324,6 @@ void VPSSMgr::_updateRefStateThermo() const } } - /*****************************************************************/ void VPSSMgr::initThermo() diff --git a/src/thermo/VPSSMgrFactory.cpp b/src/thermo/VPSSMgrFactory.cpp index 72ec768b2..2fb641d53 100644 --- a/src/thermo/VPSSMgrFactory.cpp +++ b/src/thermo/VPSSMgrFactory.cpp @@ -65,7 +65,6 @@ static void getVPSSMgrTypes(std::vector & spDataNodeList, int& has_hptx, int& has_other) { - string ssModel = "idealGas"; for (size_t n = 0; n < spDataNodeList.size(); n++) { bool ifound = false; @@ -204,7 +203,6 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, XML_Node* phaseNode_ptr, std::vector & spDataNodeList) { - std::string ssManager; std::string vpssManager; @@ -243,7 +241,6 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, return new VPSSMgr_ConstVol(vp_ptr, spth); } - int inasaIG = 0, inasaCV = 0, ishomateIG = 0, ishomateCV = 0, isimpleIG = 0, isimpleCV = 0, iwater = 0, itpx = 0, iother = 0; int ihptx = 0; @@ -278,7 +275,6 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, return new VPSSMgr_ConstVol(vp_ptr, spth); } } - return new VPSSMgr_General(vp_ptr, spth); } @@ -319,7 +315,6 @@ VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, VPStandardStateTP* vp_ptr, return f->newVPSSMgr(type, vp_ptr); } - VPSSMgr* newVPSSMgr(VPStandardStateTP* tp_ptr, XML_Node* phaseNode_ptr, std::vector & spDataNodeList, diff --git a/src/thermo/VPSSMgrFactory.h b/src/thermo/VPSSMgrFactory.h index 2d5005f23..795685308 100644 --- a/src/thermo/VPSSMgrFactory.h +++ b/src/thermo/VPSSMgrFactory.h @@ -67,9 +67,7 @@ public: */ class VPSSMgrFactory : public FactoryBase { - public: - //! Static method to return an instance of this class /*! * This class is implemented as a singleton -- one in which @@ -146,15 +144,11 @@ private: VPSSMgrFactory() {} }; - ////////////////////// Convenience functions //////////////////// -// // These functions allow using a different factory class that // derives from VPSSMgrFactory. -// ////////////////////////////////////////////////////////////////// - //! Create a new species thermo manager instance, by specifying //! the type and (optionally) a pointer to the factory to use to create it. /*! @@ -195,7 +189,6 @@ VPSSMgr* newVPSSMgr(VPStandardStateTP* vp_ptr, XML_Node* phaseNode_ptr, std::vector & spDataNodeList, VPSSMgrFactory* f=0); - } #endif diff --git a/src/thermo/VPSSMgr_ConstVol.cpp b/src/thermo/VPSSMgr_ConstVol.cpp index 9e9e55abe..23d7635cd 100644 --- a/src/thermo/VPSSMgr_ConstVol.cpp +++ b/src/thermo/VPSSMgr_ConstVol.cpp @@ -37,7 +37,6 @@ VPSSMgr_ConstVol::VPSSMgr_ConstVol(const VPSSMgr_ConstVol& right) : *this = right; } - VPSSMgr_ConstVol& VPSSMgr_ConstVol::operator=(const VPSSMgr_ConstVol& b) { if (&b == this) { @@ -59,7 +58,6 @@ VPSSMgr* VPSSMgr_ConstVol::duplMyselfAsVPSSMgr() const */ void VPSSMgr_ConstVol::_updateStandardStateThermo() { - doublereal del_pRT = (m_plast - m_p0) / (GasConstant * m_tlast); for (size_t k = 0; k < m_kk; k++) { @@ -99,7 +97,6 @@ void VPSSMgr_ConstVol::initThermo() void VPSSMgr_ConstVol::initThermoXML(XML_Node& phaseNode, const std::string& id) { VPSSMgr::initThermoXML(phaseNode, id); - XML_Node& speciesList = phaseNode.child("speciesArray"); XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &phaseNode.root()); diff --git a/src/thermo/VPSSMgr_General.cpp b/src/thermo/VPSSMgr_General.cpp index da319a2af..711814356 100644 --- a/src/thermo/VPSSMgr_General.cpp +++ b/src/thermo/VPSSMgr_General.cpp @@ -146,7 +146,6 @@ PDSS* VPSSMgr_General::returnPDSS_ptr(size_t k, const XML_Node& speciesNode, doST = true; GeneralSpeciesThermo* genSpthermo = dynamic_cast(m_spthermo); - const XML_Node* const ss = speciesNode.findByName("standardState"); if (!ss) { VPSSMgr::installSTSpecies(k, speciesNode, phaseNode_ptr); @@ -176,7 +175,6 @@ PDSS* VPSSMgr_General::returnPDSS_ptr(size_t k, const XML_Node& speciesNode, "failed dynamic cast"); } genSpthermo->installPDSShandler(k, kPDSS, this); - } else if (model == "IonFromNeutral") { if (!genSpthermo) { throw CanteraError("VPSSMgr_General::returnPDSS_ptr", @@ -189,7 +187,6 @@ PDSS* VPSSMgr_General::returnPDSS_ptr(size_t k, const XML_Node& speciesNode, "new PDSS_IonsFromNeutral failed"); } genSpthermo->installPDSShandler(k, kPDSS, this); - } else if (model == "constant" || model == "temperature_polynomial" || model == "density_temperature_polynomial") { VPSSMgr::installSTSpecies(k, speciesNode, phaseNode_ptr); kPDSS = new PDSS_SSVol(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true); @@ -215,7 +212,6 @@ PDSS* VPSSMgr_General::createInstallPDSS(size_t k, const XML_Node& speciesNode, m_kk = std::max(m_kk, k+1); m_minTemp = std::max(m_minTemp, kPDSS->minTemp()); m_maxTemp = std::min(m_maxTemp, kPDSS->maxTemp()); - doublereal p0 = kPDSS->refPressure(); if (k == 0) { m_p0 = p0; diff --git a/src/thermo/VPSSMgr_IdealGas.cpp b/src/thermo/VPSSMgr_IdealGas.cpp index 2cfbca966..44e9defa4 100644 --- a/src/thermo/VPSSMgr_IdealGas.cpp +++ b/src/thermo/VPSSMgr_IdealGas.cpp @@ -67,7 +67,6 @@ void VPSSMgr_IdealGas::getStandardVolumes(doublereal* vol) const void VPSSMgr_IdealGas::_updateStandardStateThermo() { - doublereal pp = log(m_plast / m_p0); doublereal v = temperature() *GasConstant /m_plast; diff --git a/src/thermo/VPSSMgr_Water_ConstVol.cpp b/src/thermo/VPSSMgr_Water_ConstVol.cpp index 65075ee39..56d43f024 100644 --- a/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -194,7 +194,6 @@ void VPSSMgr_Water_ConstVol::initThermoXML(XML_Node& phaseNode, const std::string& id) { VPSSMgr::initThermoXML(phaseNode, id); - XML_Node& speciesList = phaseNode.child("speciesArray"); XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &phaseNode.root()); @@ -256,9 +255,7 @@ PDSS* VPSSMgr_Water_ConstVol::createInstallPDSS(size_t k, genSpthermo->installPDSShandler(k, m_waterSS, this); kPDSS = m_waterSS; } else { - VPSSMgr::installSTSpecies(k, speciesNode, phaseNode_ptr); - const XML_Node* ss = speciesNode.findByName("standardState"); if (!ss) { throw CanteraError("VPSSMgr_Water_ConstVol::installSpecies", diff --git a/src/thermo/VPSSMgr_Water_HKFT.cpp b/src/thermo/VPSSMgr_Water_HKFT.cpp index 0cfc1a81a..0c78e3f86 100644 --- a/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -47,9 +47,7 @@ VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT(const VPSSMgr_Water_HKFT& right) : *this = right; } - -VPSSMgr_Water_HKFT& -VPSSMgr_Water_HKFT::operator=(const VPSSMgr_Water_HKFT& b) +VPSSMgr_Water_HKFT& VPSSMgr_Water_HKFT::operator=(const VPSSMgr_Water_HKFT& b) { if (&b == this) { return *this; @@ -192,12 +190,10 @@ void VPSSMgr_Water_HKFT::initThermo() VPSSMgr::initThermo(); } - void VPSSMgr_Water_HKFT::initThermoXML(XML_Node& phaseNode, const std::string& id) { VPSSMgr::initThermoXML(phaseNode, id); - XML_Node& speciesList = phaseNode.child("speciesArray"); XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &phaseNode.root()); @@ -229,7 +225,6 @@ PDSS* VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr) { PDSS* kPDSS = 0; - const XML_Node* ss = speciesNode.findByName("standardState"); if (!ss) { throw CanteraError("VPSSMgr_Water_HKFT::installSpecies", @@ -258,7 +253,6 @@ PDSS* VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, "failed dynamic cast"); } genSpthermo->installPDSShandler(k, m_waterSS, this); - kPDSS = m_waterSS; } else { if (ss->attrib("model") != "HKFT") { @@ -268,7 +262,6 @@ PDSS* VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, } kPDSS = new PDSS_HKFT(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true); - GeneralSpeciesThermo* genSpthermo = dynamic_cast(m_spthermo); if (!genSpthermo) { throw CanteraError("VPSSMgr_Water_HKFT::installSpecies", diff --git a/src/thermo/VPStandardStateTP.cpp b/src/thermo/VPStandardStateTP.cpp index 7ca15c999..ffeac6cf7 100644 --- a/src/thermo/VPStandardStateTP.cpp +++ b/src/thermo/VPStandardStateTP.cpp @@ -284,7 +284,6 @@ void VPStandardStateTP::calcDensity() "but EOS for phase is not known"); } - void VPStandardStateTP::setState_TP(doublereal t, doublereal pres) { /* @@ -310,8 +309,6 @@ void VPStandardStateTP::setState_TP(doublereal t, doublereal pres) calcDensity(); } - - void VPStandardStateTP::createInstallPDSS(size_t k, const XML_Node& s, const XML_Node* phaseNode_ptr) { @@ -345,7 +342,6 @@ void VPStandardStateTP::initThermoXML(XML_Node& phaseNode, const std::string& id ThermoPhase::initThermoXML(phaseNode, id); } - VPSSMgr* VPStandardStateTP::provideVPSSMgr() { return m_VPSS_ptr; diff --git a/src/thermo/WaterProps.cpp b/src/thermo/WaterProps.cpp index 75f7fe588..56b0b8103 100644 --- a/src/thermo/WaterProps.cpp +++ b/src/thermo/WaterProps.cpp @@ -132,7 +132,6 @@ doublereal WaterProps::density_T(doublereal T, doublereal P, int ifunc) - 2.0*tmp1 * t4t4/(t3t3*tmp3)); return d2rhodT2; } - return rho; } @@ -153,7 +152,6 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, doublereal eps1000 = U1 * exp(U2 * T + U3 * T2); doublereal C = U4 + U5/(U6 + T); doublereal B = U7 + U8/T + U9 * T; - doublereal Pbar = P_pascal * 1.0E-5; doublereal tmpBpar = B + Pbar; doublereal tmpB1000 = B + 1000.0; @@ -163,11 +161,8 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, if (ifunc == 1 || ifunc == 2) { doublereal tmpC = U6 + T; doublereal dCdT = - U5/(tmpC * tmpC); - doublereal dBdT = - U8/(T * T) + U9; - doublereal deps1000dT = eps1000 * (U2 + 2.0 * U3 * T); - doublereal dltmpdT = (dBdT/tmpBpar - dBdT/tmpB1000); if (ifunc == 1) { return deps1000dT + dCdT * ltmp + C * dltmpdT; @@ -175,10 +170,8 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, doublereal T3 = T2 * T; doublereal d2CdT2 = - 2.0 * dCdT / tmpC; doublereal d2BdT2 = 2.0 * U8 / (T3); - doublereal d2ltmpdT2 = (d2BdT2*(1.0/tmpBpar - 1.0/tmpB1000) + dBdT*dBdT*(1.0/(tmpB1000*tmpB1000) - 1.0/(tmpBpar*tmpBpar))); - doublereal d2eps1000dT2 = (deps1000dT * (U2 + 2.0 * U3 * T) + eps1000 * (2.0 * U3)); if (ifunc == 2) { @@ -191,11 +184,9 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, doublereal dltmpdP = 1.0E-5 / tmpBpar; return C * dltmpdP; } - return epsRel; } - doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) { doublereal psat = satPressure(T); @@ -214,10 +205,8 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) doublereal tmp3 = tmp2 * sqrt(tmp2); doublereal A_Debye = tmp * tmp3 / (8.0 * Pi); - /* * dAdT = - 3/2 Ad/T + 1/2 Ad/dw d(dw)/dT - 3/2 Ad/eps d(eps)/dT - * * dAdT = - 3/2 Ad/T - 1/2 Ad/Vw d(Vw)/dT - 3/2 Ad/eps d(eps)/dT */ if (ifunc == 1 || ifunc == 2) { @@ -244,20 +233,16 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) * it again. */ doublereal d2AdT2 = 1.5 / T * (A_Debye/T - dAdT); - doublereal d2epsRelWaterdT2 = relEpsilon(T, P, 2); - d2AdT2 += 1.5 * (- dAdT * depsRelWaterdT / epsRelWater - A_Debye / epsRelWater * (d2epsRelWaterdT2 - depsRelWaterdT * depsRelWaterdT / epsRelWater)); - doublereal deltaT = -0.1; doublereal Tdel = T + deltaT; doublereal cte_del = coeffThermalExp_IAPWS(Tdel, P); doublereal dctedT = (cte_del - cte) / Tdel; doublereal contrib3 = 0.5 * (-(dAdT * cte) -(A_Debye * dctedT)); d2AdT2 += contrib3; - return d2AdT2; } } @@ -266,26 +251,19 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) * (e e/(epsilon R T))^3/2 * * dAdP = + 1/2 Ad/dw d(dw)/dP - 3/2 Ad/eps d(eps)/dP - * * dAdP = - 1/2 Ad/Vw d(Vw)/dP - 3/2 Ad/eps d(eps)/dP - * * dAdP = + 1/2 Ad * kappa - 3/2 Ad/eps d(eps)/dP * * where kappa = - 1/Vw d(Vw)/dP_T (isothermal compressibility) */ if (ifunc == 3) { - doublereal dAdP = 0.0; - doublereal depsRelWaterdP = relEpsilon(T, P, 3); dAdP -= A_Debye * (1.5 * depsRelWaterdP / epsRelWater); - doublereal kappa = isothermalCompressibility_IAPWS(T,P); dAdP += A_Debye * (0.5 * kappa); - return dAdP; } - return A_Debye; } @@ -349,7 +327,6 @@ doublereal WaterProps::viscosityWater() const doublereal tbar = temp / TStar; doublereal tbar2 = tbar * tbar; doublereal tbar3 = tbar2 * tbar; - doublereal mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3); doublereal tfac1 = 1.0 / tbar - 1.0; @@ -388,7 +365,6 @@ doublereal WaterProps::viscosityWater() const } doublereal mubar = mu0bar * mu1bar * mu2bar; - return mubar * muStar; } @@ -441,9 +417,7 @@ doublereal WaterProps::thermalConductivityWater() const Lji[5][0]*rfac5 + Lji[5][1]*tfac1*rfac5 + Lji[5][2]*tfac2*rfac5 ); doublereal lambda1bar = exp(rhobar * sum); - doublereal mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3); - doublereal tfac5 = tfac4 * tfac1; doublereal rfac6 = rfac5 * rfac1; @@ -455,7 +429,6 @@ doublereal WaterProps::thermalConductivityWater() const Hij[1][5]*tfac1*rfac5 + Hij[3][6]*tfac3*rfac6 ); doublereal mu1bar = std::exp(rhobar * sum); - doublereal t2r2 = tbar * tbar / (rhobar * rhobar); doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho(); drhodp *= presStar / rhoStar; @@ -475,13 +448,10 @@ doublereal WaterProps::thermalConductivityWater() const * - tau delta (phi0_dt() + phiR_dt()) */ doublereal beta = m_waterIAPWS->coeffPresExp(); - doublereal dpdT_const_rho = beta * GasConstant * dens / 18.015268; dpdT_const_rho *= Tstar / presstar; - doublereal lambda2bar = 0.0013848 / (mu0bar * mu1bar) * t2r2 * dpdT_const_rho * dpdT_const_rho * xsipow * sqrt(rhobar) * exp(-18.66*temp2 - rho4); - return (lambda0bar * lambda1bar + lambda2bar) * lambdastar; } diff --git a/src/thermo/WaterPropsIAPWS.cpp b/src/thermo/WaterPropsIAPWS.cpp index 435ff34f2..38056de4a 100644 --- a/src/thermo/WaterPropsIAPWS.cpp +++ b/src/thermo/WaterPropsIAPWS.cpp @@ -140,7 +140,6 @@ doublereal WaterPropsIAPWS::density(doublereal temperature, doublereal pressure, */ rhoguess = pressure * M_water / (Rgas * temperature); } - } doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c); deltaGuess = rhoguess / Rho_c; @@ -159,8 +158,6 @@ doublereal WaterPropsIAPWS::density(doublereal temperature, doublereal pressure, * a duplication. However, let's just be sure. */ setState_TR(temperature, density_retn); - - } else { density_retn = -1.0; } @@ -201,7 +198,6 @@ doublereal WaterPropsIAPWS::density_const(doublereal pressure, */ rhoguess = pressure * M_water / (Rgas * temperature); } - } doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c); deltaGuess = rhoguess / Rho_c; @@ -310,7 +306,6 @@ doublereal WaterPropsIAPWS::Gibbs() const void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure, doublereal& densLiq, doublereal& densGas, doublereal& delGRT) { - densLiq = density(temperature, pressure, WATER_LIQUID, densLiq); if (densLiq <= 0.0) { throw CanteraError("WaterPropsIAPWS::corr", @@ -335,7 +330,6 @@ void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure, void WaterPropsIAPWS::corr1(doublereal temperature, doublereal pressure, doublereal& densLiq, doublereal& densGas, doublereal& pcorr) { - densLiq = density(temperature, pressure, WATER_LIQUID, densLiq); if (densLiq <= 0.0) { throw CanteraError("WaterPropsIAPWS::corr1", @@ -353,10 +347,8 @@ void WaterPropsIAPWS::corr1(doublereal temperature, doublereal pressure, } setState_TR(temperature, densGas); doublereal prG = m_phi->phiR(); - doublereal rhs = (prL - prG) + log(densLiq/densGas); rhs /= (1.0/densGas - 1.0/densLiq); - pcorr = rhs * Rgas * temperature / M_water; } @@ -435,7 +427,6 @@ int WaterPropsIAPWS::phaseState(bool checkState) const iState = WATER_UNSTABLEGAS; } delta = deltaSave; - m_phi->tdpolycalc(tau, delta); } } @@ -456,7 +447,6 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const doublereal p = psat_est(temperature); doublereal rho_low = 0.0; doublereal rho_high = 1000; - doublereal densSatLiq = density_const(p, WATER_LIQUID); doublereal dens_old = densSatLiq; delta = dens_old / Rho_c; @@ -500,7 +490,6 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const dens_est = 0.5 * (rho_high + dens_new); } - dens_old = dens_new; dpdrho_old = dpdrho_new; dens_new = dens_est; @@ -530,7 +519,6 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const // Restore the original delta delta = delta_save; m_phi->tdpolycalc(tau, delta); - return dens_new; } @@ -547,7 +535,6 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const doublereal p = psat_est(temperature); doublereal rho_low = 0.0; doublereal rho_high = 1000; - doublereal densSatGas = density_const(p, WATER_GAS); doublereal dens_old = densSatGas; delta = dens_old / Rho_c; @@ -568,7 +555,6 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const rho_low = std::max(rho_low, dens_new); } bool conv = false; - for (int it = 0; it < 50; it++) { doublereal slope = (dpdrho_new - dpdrho_old)/(dens_new - dens_old); if (slope >= 0.0) { @@ -592,11 +578,9 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const dens_est = 0.5 * (rho_high + dens_new); } - dens_old = dens_new; dpdrho_old = dpdrho_new; dens_new = dens_est; - delta = dens_new / Rho_c; m_phi->tdpolycalc(tau, delta); dpdrho_new = dpdrho(); @@ -622,7 +606,6 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const // Restore the original delta delta = delta_save; m_phi->tdpolycalc(tau, delta); - return dens_new; } diff --git a/src/thermo/WaterPropsIAPWSphi.cpp b/src/thermo/WaterPropsIAPWSphi.cpp index 06f7164bb..755201dde 100644 --- a/src/thermo/WaterPropsIAPWSphi.cpp +++ b/src/thermo/WaterPropsIAPWSphi.cpp @@ -499,9 +499,7 @@ doublereal WaterPropsIAPWSphi::phiR() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); val += (ni[i] * triagtmp * delta * phi); } @@ -565,7 +563,6 @@ doublereal WaterPropsIAPWSphi::phiR_d() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); doublereal triagtmpm1 = pow(triag, bi[j]-1.0); doublereal atmpM1 = atmp - 1.0; @@ -574,16 +571,13 @@ doublereal WaterPropsIAPWSphi::phiR_d() const doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - doublereal tmp = ni[i] * (triagtmp * (phi + delta*dphiddelta) + dtriagtmpddelta * delta * phi); val += tmp; } - return val; } @@ -670,7 +664,6 @@ doublereal WaterPropsIAPWSphi::phiR_dd() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); doublereal triagtmpm1 = pow(triag, bi[j]-1.0); doublereal atmpM1 = atmp - 1.0; @@ -679,32 +672,24 @@ doublereal WaterPropsIAPWSphi::phiR_dd() const doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - - doublereal d2phiddelta2 = 2.0 * Ci[j] * phi * (2.0*Ci[j]*dtmp2 - 1.0); - doublereal pptmp = ptmp / dtmp2; doublereal d2triagddelta2 = dtriagddelta / deltam1; d2triagddelta2 += dtmp2 *(4.0*Bi[j]*ai[j]*(ai[j]-1.0)*pow(dtmp2,ai[j]-2.0) + 2.0*Ai[j]*Ai[j]/(Bbetai[j]*Bbetai[j])*ptmp*ptmp + Ai[j]*theta*4.0/Bbetai[j]*(atmp-1.0)*pptmp); - doublereal d2triagtmpd2delta = bi[j] * (triagtmpm1 * d2triagddelta2 + (bi[j]-1.0)*triagtmpm1/triag*dtriagddelta*dtriagddelta); - doublereal ctmp = (triagtmp * (2.0*dphiddelta + delta*d2phiddelta2) + 2.0*dtriagtmpddelta*(phi + delta * dphiddelta) + d2triagtmpd2delta * delta * phi); - val += ni[i] * ctmp; } - return val; } @@ -799,19 +784,12 @@ doublereal WaterPropsIAPWSphi::phiR_t() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; - val += ni[i] * delta * (dtriagtmpdtau * phi + triagtmp * dphidtau); } - return val; } @@ -886,23 +864,15 @@ doublereal WaterPropsIAPWSphi::phiR_tt() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); doublereal triagtmpM1 = triagtmp / triag; - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; - doublereal d2triagtmpdtau2 = (2 * bi[j] * triagtmpM1 + 4 * theta * theta * bi[j] * (bi[j]-1.0) * triagtmpM1 / triag); - doublereal d2phidtau2 = 2.0*Di[j]*phi *(2.0*Di[j]*ttmp*ttmp - 1.0); - tmp = (d2triagtmpdtau2 * phi + 2 * dtriagtmpdtau * dphidtau + triagtmp * d2phidtau2); @@ -975,7 +945,6 @@ doublereal WaterPropsIAPWSphi::phiR_dt() const doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); doublereal triagtmpm1 = pow(triag, bi[j]-1.0); doublereal atmpM1 = atmp - 1.0; @@ -984,30 +953,21 @@ doublereal WaterPropsIAPWSphi::phiR_dt() const doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; - doublereal d2phiddeltadtau = 4.0 * Ci[j] * Di[j] * deltam1 * ttmp * phi; - doublereal d2triagtmpddeltadtau = (-Ai[j] * bi[j] * 2.0 / Bbetai[j] * triagtmpm1 * deltam1 * ptmp -2.0 * theta * bi[j] * (bi[j] - 1.0) * triagtmpm1 / triag * dtriagddelta); - - doublereal tmp = ni[i] * (triagtmp * (dphidtau + delta*d2phiddeltadtau) + delta * dtriagtmpddelta * dphidtau + dtriagtmpdtau * (phi + delta * dphiddelta) + d2triagtmpddeltadtau * delta * phi); val += tmp; } - return val; } diff --git a/src/thermo/WaterSSTP.cpp b/src/thermo/WaterSSTP.cpp index 7655058a4..071b7e0ab 100644 --- a/src/thermo/WaterSSTP.cpp +++ b/src/thermo/WaterSSTP.cpp @@ -177,7 +177,6 @@ void WaterSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id) m_waterProps = new WaterProps(m_sub); - /* * We have to do something with the thermo function here. */ @@ -274,7 +273,6 @@ void WaterSSTP::getGibbs_RT_ref(doublereal* grt) const doublereal g = m_sub->Gibbs(); *grt = (g + EW_Offset - SW_Offset*T)/ (GasConstant * T); dd = m_sub->density(T, p, waterState, dens); - } void WaterSSTP::getGibbs_ref(doublereal* g) const @@ -306,7 +304,6 @@ void WaterSSTP::getEntropy_R_ref(doublereal* sr) const doublereal s = m_sub->entropy(); *sr = (s + SW_Offset)/ GasConstant; dd = m_sub->density(T, p, waterState, dens); - } void WaterSSTP::getCp_R_ref(doublereal* cpr) const diff --git a/src/tpx/CarbonDioxide.cpp b/src/tpx/CarbonDioxide.cpp index 6abb5b03d..3fd457744 100644 --- a/src/tpx/CarbonDioxide.cpp +++ b/src/tpx/CarbonDioxide.cpp @@ -151,7 +151,6 @@ inline double CarbonDioxide::Cprime(int j, double T2inverse, double T3inverse, d inline double CarbonDioxide::I(int j, double ergho, double Gamma) { switch (j) { - case 0: return Rho; case 1: @@ -193,19 +192,16 @@ double CarbonDioxide::up() double egrho = exp(-Gamma*Rho*Rho); double sum = 0.0; - // Equation C-6 integrated sum += G[0]*log(T/To); int i; for (i=1; i<=5; i++) { sum += G[i]*(pow(T,i) - pow(To,i))/double(i); } - for (i=0; i<=6; i++) { sum += I(i,egrho, Gamma) * (C(i, Tinverse, T2inverse, T3inverse, T4inverse) - T*Cprime(i,T2inverse, T3inverse, T4inverse)); } - sum += u0; return sum + m_energy_offset; } @@ -218,21 +214,15 @@ double CarbonDioxide::sp() double egrho = exp(-Gamma*Rho*Rho); double sum = 0.0; - for (int i=2; i<=5; i++) { sum += G[i]*(pow(T,i-1) - pow(To,i-1))/double(i-1); } - sum += G[1]*log(T/To); sum -= G[0]*(1.0/T - 1.0/To); - - for (int i=0; i<=6; i++) { sum -= Cprime(i,T2inverse, T3inverse, T4inverse)*I(i,egrho,Gamma); } - sum += s0 - R*log(Rho); - return sum + m_entropy_offset; } @@ -243,7 +233,6 @@ double CarbonDioxide::Pp() double T3inverse = pow(T, -3); double T4inverse = pow(T, -4); double egrho = exp(-Gamma*Rho*Rho); - double P = Rho*R*T; // when i=0 we are on second sum of equation (where rho^2) @@ -267,7 +256,6 @@ double CarbonDioxide::Psat() log = ((Tc/T)-1)*sum; P=exp(log)*Pc; return P; - } double CarbonDioxide::ldens() @@ -280,7 +268,6 @@ double CarbonDioxide::ldens() for (int i=1; i<=6; i++) { sum+=D[i-1]*pow(xx,double(i-1)/3.0); } - return sum; } diff --git a/src/tpx/HFC134a.cpp b/src/tpx/HFC134a.cpp index fcdae9f8a..69ce84a17 100644 --- a/src/tpx/HFC134a.cpp +++ b/src/tpx/HFC134a.cpp @@ -123,7 +123,6 @@ double HFC134a::Pp() sum4 = 0.0, sum5 = 0.0; double tau = Tc/T; double delta = Rho/Roc; - double phi0d = 1.0/delta; int i; @@ -151,7 +150,6 @@ double HFC134a::Pp() return R*T*delta*delta*Roc*(phird + phi0d); } - double HFC134a::Psat() { if ((T < Tmn) || (T > Tc)) { diff --git a/src/tpx/Heptane.cpp b/src/tpx/Heptane.cpp index 48eddf5b5..b2c330354 100644 --- a/src/tpx/Heptane.cpp +++ b/src/tpx/Heptane.cpp @@ -157,15 +157,11 @@ double Heptane::up() for (i=1; i<=5; i++) { sum += G[i]*(pow(T,i) - pow(To,i))/double(i); } - sum += G[0]*log(T/To); - for (i=0; i<=6; i++) { sum += (C(i, Tinverse, T2inverse, T3inverse, T4inverse) - T*Cprime(i,T2inverse, T3inverse, T4inverse))*I(i,egrho, Gamma); } - sum += u0; - return sum + m_energy_offset; } @@ -177,20 +173,15 @@ double Heptane::sp() double egrho = exp(-Gamma*Rho*Rho); double sum = 0.0; - for (int i=2; i<=5; i++) { sum += G[i]*(pow(T,i-1) - pow(To,i-1))/double(i-1); } - sum += G[1]*log(T/To); sum -= G[0]*(1.0/T - 1.0/To); - for (int i=0; i<=6; i++) { sum -= Cprime(i,T2inverse, T3inverse, T4inverse)*I(i,egrho, Gamma); } - sum += s0 - R*log(Rho); - return sum + m_entropy_offset; } @@ -203,11 +194,9 @@ double Heptane::Pp() double egrho = exp(-Gamma*Rho*Rho); double P = Rho*R*T; - for (int i=0; i<=3; i++) { P += C(i,Tinverse, T2inverse, T3inverse, T4inverse)*H(i,egrho); } - return P; } diff --git a/src/tpx/Hydrogen.cpp b/src/tpx/Hydrogen.cpp index 992bf6730..46d0ad0d1 100644 --- a/src/tpx/Hydrogen.cpp +++ b/src/tpx/Hydrogen.cpp @@ -169,7 +169,6 @@ double hydrogen::up() sum += Ghydro[i+12] * T2 * icv(i, x, log(x)); } } - return sum + m_energy_offset; } @@ -198,7 +197,6 @@ double hydrogen::sp() sum += Ghydro[i+12] / (i + 1) * pow(xlg, i+1); } } - return sum + m_entropy_offset; } diff --git a/src/tpx/Methane.cpp b/src/tpx/Methane.cpp index 9606bccec..a5288afed 100644 --- a/src/tpx/Methane.cpp +++ b/src/tpx/Methane.cpp @@ -146,7 +146,6 @@ double methane::up() for (int i=0; i<14; i++) { sum += (C(i, rt, rt2) - T*Cprime(i, rt, rt2, rt3))*I(i, egrho); } - sum += T*(Gmeth[0] + 0.75*Gmeth[1]*t3 + 0.6*Gmeth[2]*t3*t3 + 0.5*Gmeth[3]*T) + Gmeth[4]*beta/(exp(beta*rt) - 1.0) + u0; return sum + m_energy_offset; diff --git a/src/tpx/Nitrogen.cpp b/src/tpx/Nitrogen.cpp index 176ba9883..c92fabfc6 100644 --- a/src/tpx/Nitrogen.cpp +++ b/src/tpx/Nitrogen.cpp @@ -152,13 +152,11 @@ double nitrogen::up() for (int i=0; i<14; i++) { sum += (C(i,rt,rt2) - T*Cprime(i,rt,rt2,rt3))*I(i,egrho); } - sum += (((0.25*Gnn[6]*T + Gnn[5]/3.0)*T + 0.5*Gnn[4])*T + Gnn[3])*T + Gnn[2]*log(T) - (Gnn[1] + 0.5*Gnn[0]*rt)*rt + Gnn[7]*beta/(exp(beta*rt) - 1.0) + u0 + m_energy_offset; - return sum; } @@ -174,7 +172,6 @@ double nitrogen::sp() for (int i=0; i<14; i++) { sum -= Cprime(i,rt,rt2,rt3)*I(i,egrho); } - sum += (((Gnn[6]/3.0)*T + 0.5*Gnn[5])*T + Gnn[4])*T + Gnn[3]*log(T) -((Gnn[0]*rt/3.0 + 0.5*Gnn[1])*rt + Gnn[2])*rt + Gnn[7]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0) diff --git a/src/tpx/Oxygen.cpp b/src/tpx/Oxygen.cpp index 247f9ed11..cbf27e1b7 100644 --- a/src/tpx/Oxygen.cpp +++ b/src/tpx/Oxygen.cpp @@ -148,10 +148,8 @@ double oxygen::up() for (int i=0; i<14; i++) { sum += (C(i,rt,rt2) - T*Cprime(i,rt,rt2,rt3))*I(i,egrho); } - sum += (((0.25*Goxy[6]*T + Goxy[5]/3.0)*T + 0.5*Goxy[4])*T + Goxy[3])*T + Goxy[2]*log(T) - (Goxy[1] + 0.5*Goxy[0]*rt)*rt + Goxy[7]*beta/(exp(beta*rt) - 1.0) + u0; - return sum + m_energy_offset; } @@ -167,7 +165,6 @@ double oxygen::sp() for (int i=0; i<14; i++) { sum -= Cprime(i,rt,rt2,rt3)*I(i,egrho); } - sum += (((Goxy[6]/3.0)*T + 0.5*Goxy[5])*T + Goxy[4])*T + Goxy[3]*log(T) -((Goxy[0]*rt/3.0 + 0.5*Goxy[1])*rt + Goxy[2])*rt + Goxy[7]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0) diff --git a/src/tpx/Sub.cpp b/src/tpx/Sub.cpp index 72cf1b7b7..e2076d8b0 100644 --- a/src/tpx/Sub.cpp +++ b/src/tpx/Sub.cpp @@ -139,7 +139,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_T(x0); set_v(y0); break; - case PropertyPair::HP: if (Lever(Pgiven, y0, x0, propertyFlag::H)) { return; @@ -147,7 +146,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::H, propertyFlag::P, x0, y0, TolAbsH, TolAbsP, TolRel, TolRel); break; - case PropertyPair::SP: if (Lever(Pgiven, y0, x0, propertyFlag::S)) { return; @@ -155,7 +153,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::S, propertyFlag::P, x0, y0, TolAbsS, TolAbsP, TolRel, TolRel); break; - case PropertyPair::PV: if (Lever(Pgiven, x0, y0, propertyFlag::V)) { return; @@ -163,7 +160,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::P, propertyFlag::V, x0, y0, TolAbsP, TolAbsV, TolRel, TolRel); break; - case PropertyPair::TP: if (x0 < Tcrit()) { set_T(x0); @@ -178,12 +174,10 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::T, propertyFlag::P, x0, y0, TolAbsT, TolAbsP, TolRel, TolRel); break; - case PropertyPair::UV: set_xy(propertyFlag::U, propertyFlag::V, x0, y0, TolAbsU, TolAbsV, TolRel, TolRel); break; - case PropertyPair::ST: if (Lever(Tgiven, y0, x0, propertyFlag::S)) { return; @@ -191,12 +185,10 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::S, propertyFlag::T, x0, y0, TolAbsS, TolAbsT, TolRel, TolRel); break; - case PropertyPair::SV: set_xy(propertyFlag::S, propertyFlag::V, x0, y0, TolAbsS, TolAbsV, TolRel, TolRel); break; - case PropertyPair::UP: if (Lever(Pgiven, y0, x0, propertyFlag::U)) { return; @@ -204,22 +196,18 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) set_xy(propertyFlag::U, propertyFlag::P, x0, y0, TolAbsU, TolAbsP, TolRel, TolRel); break; - case PropertyPair::VH: set_xy(propertyFlag::V, propertyFlag::H, x0, y0, TolAbsV, TolAbsH, TolRel, TolRel); break; - case PropertyPair::TH: set_xy(propertyFlag::T, propertyFlag::H, x0, y0, TolAbsT, TolAbsH, TolRel, TolRel); break; - case PropertyPair::SH: set_xy(propertyFlag::S, propertyFlag::H, x0, y0, TolAbsS, TolAbsH, TolRel, TolRel); break; - case PropertyPair::PX: temp = Tsat(x0); if (y0 > 1.0 || y0 < 0.0) { @@ -234,7 +222,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) Rho = 1.0/((1.0 - y0)/Rhf + y0/Rhv); } break; - case PropertyPair::TX: if (y0 > 1.0 || y0 < 0.0) { throw TPX_Error("Substance::Set", @@ -248,7 +235,6 @@ void Substance::Set(PropertyPair::type XY, double x0, double y0) Rho = 1.0/((1.0 - y0)/Rhf + y0/Rhv); } break; - default: throw TPX_Error("Substance::Set", "Invalid input."); } @@ -298,12 +284,10 @@ void Substance::update_sat() { if ((T != Tslast) && (T < Tcrit())) { double Rho_save = Rho; - double pp = Psat(); double lps = log(pp); // trial value = Psat from correlation int i; - for (i = 0; i<20; i++) { if (i==0) { Rho = ldens(); // trial value = liquid density @@ -324,7 +308,6 @@ void Substance::update_sat() Rhv = Rho; // sat vapor density double gv = hp() - T*sp(); double dg = gv - gf; - if (Rhv > Rhf) { std::swap(Rhv, Rhf); dg = - dg; @@ -335,7 +318,6 @@ void Substance::update_sat() } double dp = dg/(1.0/Rhv - 1.0/Rhf); double psold = pp; - if (fabs(dp) > pp) { lps -= dg/(pp*(1.0/Rhv - 1.0/Rhf)); pp = exp(lps); @@ -457,7 +439,6 @@ void Substance::set_xy(propertyFlag::type ifx, propertyFlag::type ify, double Xa = fabs(X); double Ya = fabs(Y); - while (true) { double x_here = prop(ifx); double y_here = prop(ify); diff --git a/src/tpx/lk.cpp b/src/tpx/lk.cpp index 5b50f6503..fea8c7c11 100644 --- a/src/tpx/lk.cpp +++ b/src/tpx/lk.cpp @@ -105,7 +105,6 @@ double leekesler::z() return zz; } - double leekesler::Pp() { return 8314.3*z()*Rho*T/Mw; diff --git a/src/tpx/lk.h b/src/tpx/lk.h index bf8f465f9..92dab75d4 100644 --- a/src/tpx/lk.h +++ b/src/tpx/lk.h @@ -9,9 +9,7 @@ namespace tpx class leekesler : public Substance { - public: - leekesler(double tc = 1.0, double pc = 1.0, double wt = 1.0, int itype = 0) { Tcr = tc; @@ -47,12 +45,10 @@ public: double ldens(); protected: - double Tcr, Pcr, Mw; int Isr; private: - double W(int n, double egrho, double gamma); double I(); double J(); diff --git a/src/transport/DustyGasTransport.cpp b/src/transport/DustyGasTransport.cpp index 6f087eca0..b38af5a07 100644 --- a/src/transport/DustyGasTransport.cpp +++ b/src/transport/DustyGasTransport.cpp @@ -74,7 +74,6 @@ DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right) delete m_gastran; m_gastran = right.duplMyselfAsTransport(); - return *this; } @@ -91,14 +90,12 @@ Transport* DustyGasTransport::duplMyselfAsTransport() const void DustyGasTransport::setThermo(thermo_t& thermo) { - Transport::setThermo(thermo); m_gastran->setThermo(thermo); } void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr) { - // constant mixture attributes m_thermo = phase; m_nsp = m_thermo->nSpecies(); @@ -163,7 +160,6 @@ void DustyGasTransport::eval_H_matrix() updateKnudsenDiffCoeffs(); doublereal sum; for (size_t k = 0; k < m_nsp; k++) { - // evaluate off-diagonal terms for (size_t l = 0; l < m_nsp; l++) { m_multidiff(k,l) = -m_x[k]/m_d(k,l); @@ -186,7 +182,6 @@ void DustyGasTransport::getMolarFluxes(const doublereal* const state1, doublereal* const fluxes) { doublereal conc1, conc2; - // cbar will be the average concentration between the two points doublereal* const cbar = DATA_PTR(m_spwork); doublereal* const gradc = DATA_PTR(m_spwork2); @@ -213,14 +208,11 @@ void DustyGasTransport::getMolarFluxes(const doublereal* const state1, doublereal pbar = 0.5*(p1 + p2); doublereal gradp = (p2 - p1)/delta; doublereal tbar = 0.5*(t1 + t2); - m_thermo->setState_TPX(tbar, pbar, cbar); - updateMultiDiffCoeffs(); // Multiply m_multidiff and gradc together and store the result in fluxes[] multiply(m_multidiff, gradc, fluxes); - divide_each(cbar, cbar + m_nsp, m_dk.begin()); // if no permeability has been specified, use result for @@ -249,12 +241,10 @@ void DustyGasTransport::updateMultiDiffCoeffs() // update the mole fractions updateTransport_C(); - eval_H_matrix(); // invert H int ierr = invert(m_multidiff); - if (ierr != 0) { throw CanteraError("DustyGasTransport::updateMultiDiffCoeffs", "invert returned ierr = "+int2str(ierr)); diff --git a/src/transport/GasTransport.cpp b/src/transport/GasTransport.cpp index ead4e2f1f..e9d47542d 100644 --- a/src/transport/GasTransport.cpp +++ b/src/transport/GasTransport.cpp @@ -155,7 +155,6 @@ doublereal GasTransport::viscosity() void GasTransport::updateViscosity_T() { doublereal vratiokj, wratiojk, factor1; - if (!m_spvisc_ok) { updateSpeciesViscosities(); } @@ -420,7 +419,6 @@ void GasTransport::setupMM() double d = m_diam(i,j); m_delta(i,j) = 0.5 * m_dipole(i,j)*m_dipole(i,j) / (4 * Pi * epsilon_0 * m_epsilon(i,j) * d * d * d); - makePolarCorrections(i, j, f_eps, f_sigma); m_diam(i,j) *= f_sigma; m_epsilon(i,j) *= f_eps; @@ -497,10 +495,8 @@ void GasTransport::makePolarCorrections(size_t i, size_t j, // corrections to the effective diameter and well depth // if one is polar and one is non-polar - size_t kp = (m_polar[i] ? i : j); // the polar one size_t knp = (i == kp ? j : i); // the nonpolar one - double d3np, d3p, alpha_star, mu_p_star, xi; d3np = pow(m_sigma[knp],3); d3p = pow(m_sigma[kp],3); @@ -569,9 +565,7 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) int ndeg = 0; // number of points to use in generating fit data const size_t np = 50; - int degree = (m_mode == CK_Mode ? 3 : 4); - double dt = (m_thermo->maxTemp() - m_thermo->minTemp())/(np-1); vector_fp tlog(np), spvisc(np), spcond(np); vector_fp w(np), w2(np); @@ -609,12 +603,10 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) for (size_t k = 0; k < m_nsp; k++) { for (size_t n = 0; n < np; n++) { double t = m_thermo->minTemp() + dt*n; - m_thermo->setTemperature(t); vector_fp cp_R_all(m_thermo->nSpecies()); m_thermo->getCp_R_ref(&cp_R_all[0]); cp_R = cp_R_all[k]; - double tstar = Boltzmann * t/ m_eps[k]; sqrt_T = sqrt(t); double om22 = integrals.omega22(tstar, m_delta(k,k)); @@ -633,15 +625,12 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) w_RT = mw[k]/(GasConstant * t); f_int = w_RT * diffcoeff/visc; cv_rot = m_crot[k]; - A_factor = 2.5 - f_int; B_factor = m_zrot[k] + 2.0/Pi * (5.0/3.0 * cv_rot + f_int); c1 = 2.0/Pi * A_factor/B_factor; cv_int = cp_R - 2.5 - cv_rot; - f_rot = f_int * (1.0 + c1); f_trans = 2.5 * (1.0 - c1 * cv_rot/1.5); - cond = (visc/mw[k])*GasConstant*(f_trans * 1.5 + f_rot * cv_rot + f_int * cv_int); @@ -715,7 +704,6 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) if (DEBUG_MODE_ENABLED && m_log_level) { writelogf("Maximum viscosity absolute error: %12.6g\n", mxerr); writelogf("Maximum viscosity relative error: %12.6g\n", mxrelerr); - writelog("\nPolynomial fits for conductivity:\n"); if (m_mode == CK_Mode) { writelog("log(conductivity) fit to cubic polynomial in log(T)"); @@ -752,7 +740,6 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) double tstar = Boltzmann * t/eps; sigma = m_diam(j,k); om11 = integrals.omega11(tstar, m_delta(j,k)); - diffcoeff = 3.0/16.0 * sqrt(2.0 * Pi/m_reducedMass(k,j)) * pow(Boltzmann * t, 1.5) / (Pi * sigma * sigma * om11); @@ -812,18 +799,15 @@ void GasTransport::getBinDiffCorrection(double t, MMCollisionInt& integrals, double wsum = w1 + w2; double wmwp = (w1 - w2)/wsum; double sqw12 = sqrt(w1*w2); - double sig1 = m_sigma[k]; double sig2 = m_sigma[j]; double sig12 = 0.5*(m_sigma[k] + m_sigma[j]); double sigratio = sig1*sig1/(sig2*sig2); double sigratio2 = sig1*sig1/(sig12*sig12); double sigratio3 = sig2*sig2/(sig12*sig12); - double tstar1 = Boltzmann * t / m_eps[k]; double tstar2 = Boltzmann * t / m_eps[j]; double tstar12 = Boltzmann * t / sqrt(m_eps[k] * m_eps[j]); - double om22_1 = integrals.omega22(tstar1, m_delta(k,k)); double om22_2 = integrals.omega22(tstar2, m_delta(j,j)); double om11_12 = integrals.omega11(tstar12, m_delta(k,j)); @@ -836,7 +820,6 @@ void GasTransport::getBinDiffCorrection(double t, MMCollisionInt& integrals, cnst = (1.0/sigratio) * sqrt(2.0*w1/wsum) * 2.0*w2*w2/(wsum*w1); double p2 = cnst * om22_2 / om11_12; - double p12 = 15.0 * wmwp*wmwp + 8.0*w1*w2*astar_12/(wsum*wsum); cnst = (2.0/(w2*wsum))*sqrt(2.0*w2/wsum)*sigratio2; @@ -846,7 +829,6 @@ void GasTransport::getBinDiffCorrection(double t, MMCollisionInt& integrals, cnst = (2.0/(w1*wsum))*sqrt(2.0*w1/wsum)*sigratio3; double q2 = cnst*((2.5 - 1.2*bstar_12)*w2*w2 + 3.0*w1*w1 + 1.6*w1*w2*astar_12); - double q12 = wmwp*wmwp*15.0*(2.5 - 1.2*bstar_12) + 4.0*w1*w2*astar_12*(11.0 - 2.4*bstar_12)/(wsum*wsum) + 1.6*wsum*om22_1*om22_2/(om11_12*om11_12*sqw12) diff --git a/src/transport/HighPressureGasTransport.cpp b/src/transport/HighPressureGasTransport.cpp index 53bfcd090..a5ccbea60 100755 --- a/src/transport/HighPressureGasTransport.cpp +++ b/src/transport/HighPressureGasTransport.cpp @@ -8,7 +8,6 @@ * All methods are described in Reid, Prausnitz, and Polling, "The Properties * of Gases and Liquids, 4th ed., 1987 (viscosity in Ch. 9, Thermal * conductivity in Ch. 10, and Diffusion coefficients in Ch. 11). - * **/ #include "cantera/transport/HighPressureGasTransport.h" #include "cantera/numerics/ctlapack.h" @@ -24,7 +23,6 @@ using namespace std; namespace Cantera { - //////////////////// class HighPressureGasTransport methods ////////////// HighPressureGasTransport::HighPressureGasTransport(thermo_t* thermo) @@ -36,11 +34,8 @@ double HighPressureGasTransport::thermalConductivity() { // Method of Ely and Hanley: update_T(); - doublereal Lprime_m = 0.0; - const doublereal c1 = 1./16.04; - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -53,7 +48,6 @@ double HighPressureGasTransport::thermalConductivity() std::vector V_k(nsp); m_thermo -> getPartialMolarVolumes(&V_k[0]); - doublereal L_i_min = BigNumber; for (size_t i = 0; i < m_nsp; i++) { @@ -123,9 +117,7 @@ double HighPressureGasTransport::thermalConductivity() *sqrt(rho_0)*(0.3594685 + 69.79841/T_0 - 872.8833*pow(T_0,-2))) - 1.)*1e-3; doublereal H_m = sqrt(f_m*16.04/mw_m)*pow(h_m,-2./3.); doublereal Lstar_m = H_m*(L_1m + L_2m + L_3m); - return Lprime_m + Lstar_m; - } void HighPressureGasTransport::getThermalDiffCoeffs(doublereal* const dt) @@ -144,7 +136,6 @@ void HighPressureGasTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* { doublereal P_corr_ij, Tr_ij, Pr_ij; std::vector PcP(5); - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -217,11 +208,9 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c // Correct the binary diffusion coefficients for high-pressure effects; this // is basically the same routine used in 'getBinaryDiffCoeffs,' above: doublereal P_corr_ij, Tr_ij, Pr_ij; - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - update_T(); // Evaluate the binary diffusion coefficients from the polynomial fits - // this should perhaps be preceded by a check for changes in T, P, or C. @@ -239,7 +228,6 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c // zero (this would lead to Pr_ij = Inf): doublereal x_i = std::max(Tiny, molefracs[i]); doublereal x_j = std::max(Tiny, molefracs[j]); - x_i = x_i/(x_i+x_j); x_j = x_j/(x_i+x_j); Tr_ij = m_temp/(x_i*Tcrit_i(i) + x_j*Tcrit_i(j)); @@ -293,7 +281,6 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c doublereal HighPressureGasTransport::viscosity() { // Calculate the high-pressure mixture viscosity, based on the Lucas method. - double Tc_mix = 0.; double Pc_mix_n = 0.; double Pc_mix_d = 0.; @@ -305,7 +292,6 @@ doublereal HighPressureGasTransport::viscosity() doublereal FQ_mix_o = 0; doublereal tKelvin = m_thermo->temperature(); double Pvp_mix = m_thermo->satPressure(tKelvin); - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -360,7 +346,6 @@ doublereal HighPressureGasTransport::viscosity() double Pc_mix = GasConstant*Tc_mix*Pc_mix_n/Pc_mix_d; double Pr_mix = m_thermo->pressure()/Pc_mix; double ratio = MW_H/MW_L; - double ksi = pow(GasConstant*Tc_mix*3.6277*pow(10.0,53.0)/(pow(MW_mix,3) *pow(Pc_mix,4)),1.0/6.0); @@ -459,7 +444,6 @@ doublereal HighPressureGasTransport::Zcrit_i(size_t i) double zc = m_thermo->critCompressibility(); // Restore actual molefracs: m_thermo->setMoleFractions(&molefracs[0]); - return zc; } @@ -467,7 +451,6 @@ vector_fp HighPressureGasTransport::store(size_t i, size_t nsp) { vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - vector_fp mf_temp(nsp); for (size_t j = 0; j < nsp; j++) { if (j == i) { @@ -475,7 +458,6 @@ vector_fp HighPressureGasTransport::store(size_t i, size_t nsp) } else {mf_temp[j] = 0;} } m_thermo->setMoleFractions(&mf_temp[0]); - return molefracs; } @@ -533,9 +515,7 @@ doublereal HighPressureGasTransport::setPcorr(doublereal Pr, doublereal Tr) doublereal P_corr_2 = DP_Rt_lookup[Pr_i+1]*(1.0 - A_ij_lookup[Pr_i+1] *pow(Tr,-B_ij_lookup[Pr_i+1]))*(1-C_ij_lookup[Pr_i+1] *pow(Tr,-E_ij_lookup[Pr_i+1])); - return P_corr_1*(1.0-frac) + P_corr_2*frac; - } -} \ No newline at end of file +} diff --git a/src/transport/LTPspecies.cpp b/src/transport/LTPspecies.cpp index ffc9c57e3..a1b3f2b69 100644 --- a/src/transport/LTPspecies.cpp +++ b/src/transport/LTPspecies.cpp @@ -47,7 +47,6 @@ static void getArrhenius(const XML_Node& node, b = getFloat(node, "b"); E = getFloat(node, "E", "actEnergy"); E /= GasConstant; - } LTPspecies::LTPspecies(const XML_Node* const propNode, const std::string name, @@ -67,7 +66,6 @@ LTPspecies::LTPspecies(const XML_Node* const propNode, const std::string name, LTPspecies::LTPspecies(const LTPspecies& right) { - *this = right; } @@ -97,7 +95,6 @@ doublereal LTPspecies::getSpeciesTransProp() bool LTPspecies::checkPositive() const { return (m_coeffs[0] > 0); - } doublereal LTPspecies::getMixWeight() const @@ -144,14 +141,12 @@ LTPspecies* LTPspecies_Const::duplMyselfAsLTPspecies() const doublereal LTPspecies_Const::getSpeciesTransProp() { return m_coeffs[0]; - } LTPspecies_Arrhenius::LTPspecies_Arrhenius(const XML_Node& propNode, const std::string name, TransportPropertyType tp_ind, const thermo_t* thermo) : LTPspecies(&propNode, name, tp_ind, thermo) { - m_model = LTP_TD_ARRHENIUS; m_temp = 0.0; m_prop = 0.0; diff --git a/src/transport/LiquidTranInteraction.cpp b/src/transport/LiquidTranInteraction.cpp index 5a690332a..f3c37495f 100644 --- a/src/transport/LiquidTranInteraction.cpp +++ b/src/transport/LiquidTranInteraction.cpp @@ -69,11 +69,9 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, thermo_t* thermo) { m_thermo = thermo; - size_t nsp = thermo->nSpecies(); m_Dij.resize(nsp, nsp, 0.0); m_Eij.resize(nsp, nsp, 0.0); - std::string speciesA; std::string speciesB; @@ -198,7 +196,6 @@ doublereal LTI_Solvent::getMixTransProp(doublereal* speciesValues, doublereal* s doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0.0; //if weightings are specified, use those @@ -227,7 +224,6 @@ doublereal LTI_Solvent::getMixTransProp(doublereal* speciesValues, doublereal* s } } } - return value; } @@ -237,7 +233,6 @@ doublereal LTI_Solvent::getMixTransProp(std::vector LTPptrs) doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0.0; for (size_t k = 0; k < nsp; k++) { @@ -256,7 +251,6 @@ doublereal LTI_Solvent::getMixTransProp(std::vector LTPptrs) } } } - return value; } @@ -271,7 +265,6 @@ doublereal LTI_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal* doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; //if weightings are specified, use those @@ -294,7 +287,6 @@ doublereal LTI_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal* } } } - return value; } @@ -304,7 +296,6 @@ doublereal LTI_MoleFracs::getMixTransProp(std::vector LTPptrs) doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; for (size_t k = 0; k < nsp; k++) { @@ -331,7 +322,6 @@ doublereal LTI_MassFracs::getMixTransProp(doublereal* speciesValues, doublereal* doublereal temp = m_thermo->temperature(); vector_fp massfracs(nsp); m_thermo->getMassFractions(&massfracs[0]); - doublereal value = 0; //if weightings are specified, use those @@ -364,7 +354,6 @@ doublereal LTI_MassFracs::getMixTransProp(std::vector LTPptrs) doublereal temp = m_thermo->temperature(); vector_fp massfracs(nsp); m_thermo->getMassFractions(&massfracs[0]); - doublereal value = 0; for (size_t k = 0; k < nsp; k++) { @@ -382,7 +371,6 @@ doublereal LTI_MassFracs::getMixTransProp(std::vector LTPptrs) } } } - return value; } @@ -392,9 +380,6 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(doublereal* speciesValues, doubler doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - - - doublereal value = 0; //if weightings are specified, use those @@ -417,7 +402,6 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(doublereal* speciesValues, doubler } } } - return exp(value); } @@ -427,12 +411,9 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - - doublereal value = 0; //if weightings are specified, use those - for (size_t k = 0; k < nsp; k++) { molefracs[k] = molefracs[k]*LTPptrs[k]->getMixWeight(); } @@ -448,7 +429,6 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) } } } - value = exp(value); return value; } @@ -471,11 +451,8 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(doublereal* speciesValues, size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_Pairwise_Interaction::getMixTransProp does not make sense."); - return value; } @@ -484,11 +461,8 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(std::vector LT size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_Pairwise_Interaction::getMixTransProp does not make sense."); - return value; } @@ -515,7 +489,6 @@ void LTI_StefanMaxwell_PPN::setParameters(LiquidTransportParams& trParam) { size_t nsp = m_thermo->nSpecies(); size_t nsp2 = nsp*nsp; - m_ionCondMix = 0; m_ionCondMixModel = trParam.ionConductivity; m_ionCondSpecies.resize(nsp,0); @@ -552,11 +525,8 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(doublereal* speciesValues, dou size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_StefanMaxwell_PPN::getMixTransProp does not make sense."); - return value; } @@ -565,11 +535,8 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(std::vector LTPpt size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_StefanMaxwell_PPN::getMixTransProp does not make sense."); - return value; } @@ -607,7 +574,6 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe } m_ionCondMix = m_ionCondMixModel->getMixTransProp(m_ionCondSpecies); - MargulesVPSSTP* marg_thermo = dynamic_cast(ions_thermo->neutralMoleculePhase_); doublereal vol = m_thermo->molarVolume(); @@ -624,7 +590,6 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe } } - for (k = 0; k < nsp; k++) { m_selfDiffMix[k] = m_selfDiffMixModel[k]->getMixTransProp(m_selfDiffSpecies[k]); } @@ -655,11 +620,8 @@ doublereal LTI_StokesEinstein::getMixTransProp(doublereal* speciesValues, double size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_StokesEinstein::getMixTransProp does not make sense."); - return value; } @@ -668,11 +630,8 @@ doublereal LTI_StokesEinstein::getMixTransProp(std::vector LTPptrs) size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; - throw LTPmodelError("Calling LTI_StokesEinstein::getMixTransProp does not make sense."); - return value; } @@ -692,7 +651,6 @@ void LTI_StokesEinstein::getMatrixTransProp(DenseMatrix& mat, doublereal* specie { size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); - vector_fp viscSpec(nsp); vector_fp radiusSpec(nsp); @@ -714,7 +672,6 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(doublereal* speciesValues, double doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; //if weightings are specified, use those @@ -734,7 +691,6 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(doublereal* speciesValues, double } } } - return value; } @@ -744,7 +700,6 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(std::vector LTPptrs) doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); - doublereal value = 0; for (size_t k = 0; k < nsp; k++) { diff --git a/src/transport/LiquidTransport.cpp b/src/transport/LiquidTransport.cpp index 81d45cf79..6f5846251 100644 --- a/src/transport/LiquidTransport.cpp +++ b/src/transport/LiquidTransport.cpp @@ -214,16 +214,13 @@ LiquidTransport::~LiquidTransport() bool LiquidTransport::initLiquid(LiquidTransportParams& tr) { - // // Transfer quantitities from the database to the Transport object - // m_thermo = tr.thermo; m_velocityBasis = tr.velocityBasis_; m_nsp = m_thermo->nSpecies(); m_nsp2 = m_nsp*m_nsp; - // + // Resize the local storage according to the number of species - // m_mw.resize(m_nsp, 0.0); m_viscSpecies.resize(m_nsp, 0.0); m_viscTempDep_Ns.resize(m_nsp, 0); @@ -247,15 +244,13 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) m_lambdaTempDep_Ns.resize(m_nsp, 0); m_hydrodynamic_radius.resize(m_nsp, 0.0); m_radiusTempDep_Ns.resize(m_nsp, 0); - // + // Make a local copy of the molecular weights - // copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); - // + // First populate mixing rules and indices // (NOTE, we transfer pointers of malloced quantities. We zero out pointers so that // we only have one copy of the malloced quantity) - // for (size_t k = 0; k < m_nsp; k++) { m_selfDiffMixModel[k] = tr.selfDiffusion[k]; tr.selfDiffusion[k] = 0; @@ -286,7 +281,6 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) ltd.hydroRadius = 0; } - /* * Get the input Species Diffusivities * Note that species diffusivities are not what is needed. @@ -318,8 +312,6 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) * species diffusivity and hydrodynamics radius (perhaps not needed in the * present class). */ - - m_viscMixModel = tr.viscosity; tr.viscosity = 0; @@ -342,9 +334,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) //It is updated in updateDiff_T() m_diffMixModel->getMatrixTransProp(m_bdiff); - m_mode = tr.mode_; - m_massfracs.resize(m_nsp, 0.0); m_massfracs_tran.resize(m_nsp, 0.0); m_molefracs.resize(m_nsp, 0.0); @@ -364,11 +354,9 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) m_Grad_T.resize(m_nDim, 0.0); m_Grad_V.resize(m_nDim, 0.0); m_Grad_mu.resize(m_nDim * m_nsp, 0.0); - m_flux.resize(m_nsp, m_nDim, 0.0); m_Vdiff.resize(m_nsp, m_nDim, 0.0); - // set all flags to false m_visc_mix_ok = false; m_visc_temp_ok = false; @@ -388,7 +376,6 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) m_lambda_mix_ok = false; m_diff_temp_ok = false; m_diff_mix_ok = false; - return true; } @@ -396,14 +383,11 @@ doublereal LiquidTransport::viscosity() { update_T(); update_C(); - if (m_visc_mix_ok) { return m_viscmix; } - ////// LiquidTranInteraction method m_viscmix = m_viscMixModel->getMixTransProp(m_viscTempDep_Ns); - return m_viscmix; } @@ -420,14 +404,11 @@ doublereal LiquidTransport::ionConductivity() { update_T(); update_C(); - if (m_ionCond_mix_ok) { return m_ionCondmix; } - ////// LiquidTranInteraction method m_ionCondmix = m_ionCondMixModel->getMixTransProp(m_ionCondTempDep_Ns); - return m_ionCondmix; } @@ -442,10 +423,8 @@ void LiquidTransport::getSpeciesIonConductivity(doublereal* ionCond) void LiquidTransport::mobilityRatio(doublereal* mobRat) { - update_T(); update_C(); - // LiquidTranInteraction method if (!m_mobRat_mix_ok) { for (size_t k = 0; k < m_nsp2; k++) { @@ -509,20 +488,16 @@ void LiquidTransport::getSpeciesHydrodynamicRadius(doublereal* const radius) updateHydrodynamicRadius_T(); } copy(m_hydrodynamic_radius.begin(), m_hydrodynamic_radius.end(), radius); - } doublereal LiquidTransport::thermalConductivity() { - update_T(); update_C(); - if (!m_lambda_mix_ok) { m_lambda = m_lambdaMixModel->getMixTransProp(m_lambdaTempDep_Ns); m_cond_mix_ok = true; } - return m_lambda; } @@ -539,13 +514,11 @@ void LiquidTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d) throw CanteraError("LiquidTransport::getBinaryDiffCoeffs", "First argument does not correspond to number of species in model.\nDiff Coeff matrix may be misdimensioned"); update_T(); - // if necessary, evaluate the binary diffusion coefficients // from the polynomial fits if (!m_diff_temp_ok) { updateDiff_T(); } - for (size_t i = 0; i < m_nsp; i++) { for (size_t j = 0; j < m_nsp; j++) { d[ld*j + i] = 1.0 / m_bdiff(i,j); @@ -612,7 +585,6 @@ doublereal LiquidTransport::getElectricConduct() vector_fp fluxes(m_nsp * m_nDim); doublereal current; - getSpeciesFluxesExt(m_nDim, &fluxes[0]); //sum over species charges, fluxes, Faraday to get current @@ -641,7 +613,6 @@ void LiquidTransport::getElectricCurrent(int ndim, set_Grad_V(grad_V); vector_fp fluxes(m_nsp * m_nDim); - getSpeciesFluxesExt(ldf, &fluxes[0]); //sum over species charges, fluxes, Faraday to get current @@ -705,7 +676,6 @@ void LiquidTransport::getSpeciesFluxesES(size_t ndim, void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff) { stefan_maxwell_solve(); - for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { Vdiff[n*ldf + k] = m_Vdiff(k,n); @@ -716,7 +686,6 @@ void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff) void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) { stefan_maxwell_solve(); - for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { fluxes[n*ldf + k] = m_flux(k,n); @@ -727,7 +696,6 @@ void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) void LiquidTransport::getMixDiffCoeffs(doublereal* const d) { stefan_maxwell_solve(); - for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { if (m_Grad_X[n*m_nsp + k] != 0.0) { @@ -941,7 +909,6 @@ void LiquidTransport::update_Grad_lnAC() m_Grad_lnAC[start+i] += m_Grad_X[start+i]/m_molefracs[i]; } } - return; } @@ -966,9 +933,7 @@ void LiquidTransport::stefan_maxwell_solve() } double T = m_thermo->temperature(); - update_Grad_lnAC() ; - m_thermo->getActivityCoefficients(DATA_PTR(m_actCoeff)); /* @@ -994,7 +959,6 @@ void LiquidTransport::stefan_maxwell_solve() * * Note, we have broken the symmetry of the matrix here, due to * considerations involving species concentrations going to zero. - * */ for (size_t a = 0; a < m_nDim; a++) { for (size_t i = 0; i < m_nsp; i++) { @@ -1021,12 +985,10 @@ void LiquidTransport::stefan_maxwell_solve() * Just for Note, m_A(i,j) refers to the ith row and jth column. * They are still fortran ordered, so that i varies fastest. */ - double condSum1; const doublereal invRT = 1.0 / (GasConstant * T); switch (m_nDim) { case 1: /* 1-D approximation */ - m_B(0,0) = 0.0; //equation for the reference velocity for (size_t j = 0; j < m_nsp; j++) { @@ -1060,7 +1022,6 @@ void LiquidTransport::stefan_maxwell_solve() //! invert and solve the system Ax = b. Answer is in m_B solve(m_A, m_B); - condSum1 = 0; for (size_t i = 0; i < m_nsp; i++) { condSum1 -= Faraday*m_chargeSpecies[i]*m_B(i,0)*m_molefracs_tran[i]/vol; @@ -1102,10 +1063,7 @@ void LiquidTransport::stefan_maxwell_solve() //! invert and solve the system Ax = b. Answer is in m_B solve(m_A, m_B); - - break; - case 3: /* 3-D approximation */ m_B(0,0) = 0.0; m_B(0,1) = 0.0; @@ -1144,7 +1102,6 @@ void LiquidTransport::stefan_maxwell_solve() //! invert and solve the system Ax = b. Answer is in m_B solve(m_A, m_B); - break; default: printf("unimplemented\n"); diff --git a/src/transport/LiquidTransportData.cpp b/src/transport/LiquidTransportData.cpp index d7a6fc998..49539660b 100644 --- a/src/transport/LiquidTransportData.cpp +++ b/src/transport/LiquidTransportData.cpp @@ -17,7 +17,6 @@ LiquidTransportData::LiquidTransportData() : electCond(0), speciesDiffusivity(0) { - } LiquidTransportData::LiquidTransportData(const LiquidTransportData& right) : diff --git a/src/transport/LiquidTransportParams.cpp b/src/transport/LiquidTransportParams.cpp index 533a397da..bb1b84a43 100644 --- a/src/transport/LiquidTransportParams.cpp +++ b/src/transport/LiquidTransportParams.cpp @@ -103,7 +103,6 @@ LiquidTransportParams& LiquidTransportParams::operator=(const LiquidTransportPa compositionDepTypeDefault_ = right.compositionDepTypeDefault_; throw CanteraError("LiquidTransportParams(const LiquidTransportParams &right)", "not tested"); - return *this; } diff --git a/src/transport/MMCollisionInt.h b/src/transport/MMCollisionInt.h index 516ac2a35..856d1286b 100644 --- a/src/transport/MMCollisionInt.h +++ b/src/transport/MMCollisionInt.h @@ -50,14 +50,11 @@ private: doublereal fitDelta(int table, int ntstar, int degree, doublereal* c); std::vector m_o22poly; - std::vector m_apoly; std::vector m_bpoly; - std::vector m_cpoly; static doublereal delta[8]; - static doublereal tstar22[37]; //! Table of omega22 values from MM @@ -82,7 +79,6 @@ private: vector_fp m_logTemp; int m_nmin; - int m_nmax; //! loglevel diff --git a/src/transport/MixTransport.cpp b/src/transport/MixTransport.cpp index f2edc03b8..c9d8c4be2 100644 --- a/src/transport/MixTransport.cpp +++ b/src/transport/MixTransport.cpp @@ -53,7 +53,6 @@ Transport* MixTransport::duplMyselfAsTransport() const void MixTransport::init(ThermoPhase* thermo, int mode, int log_level) { GasTransport::init(thermo, mode, log_level); - m_cond.resize(m_nsp); // set flags all false @@ -74,7 +73,6 @@ doublereal MixTransport::thermalConductivity() { update_T(); update_C(); - if (!m_spcond_ok) { updateCond_T(); } @@ -103,13 +101,10 @@ void MixTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, { update_T(); update_C(); - getMixDiffCoeffs(DATA_PTR(m_spwork)); - const vector_fp& mw = m_thermo->molecularWeights(); const doublereal* y = m_thermo->massFractions(); doublereal rhon = m_thermo->molarDensity(); - vector_fp sum(ndim,0.0); for (size_t n = 0; n < ndim; n++) { for (size_t k = 0; k < m_nsp; k++) { @@ -147,10 +142,8 @@ void MixTransport::update_C() // signal that concentration-dependent quantities will need to // be recomputed before use, and update the local mole // fractions. - m_visc_ok = false; m_condmix_ok = false; - m_thermo->getMoleFractions(DATA_PTR(m_molefracs)); // add an offset to avoid a pure species condition diff --git a/src/transport/MultiTransport.cpp b/src/transport/MultiTransport.cpp index aafc3765b..c5a9b41f2 100644 --- a/src/transport/MultiTransport.cpp +++ b/src/transport/MultiTransport.cpp @@ -49,12 +49,9 @@ void MultiTransport::init(ThermoPhase* thermo, int mode, int log_level) m_b.resize(3*m_nsp, 0.0); m_aa.resize(m_nsp, m_nsp, 0.0); m_molefracs_last.resize(m_nsp, -1.0); - m_frot_298.resize(m_nsp); m_rotrelax.resize(m_nsp); - m_cinternal.resize(m_nsp); - m_om22.resize(m_nsp, m_nsp); m_astar.resize(m_nsp, m_nsp); m_bstar.resize(m_nsp, m_nsp); @@ -64,7 +61,6 @@ void MultiTransport::init(ThermoPhase* thermo, int mode, int log_level) m_abc_ok = false; m_l0000_ok = false; m_lmatrix_soln_ok = false; - m_thermal_tlast = 0.0; // some work space @@ -142,7 +138,6 @@ void MultiTransport::solveLMatrixEquation() // all *monatomic* species are excluded. Since monatomic // radicals can have non-zero internal heat capacities due to // electronic excitation, they should be retained. - for (size_t k = 0; k < m_nsp; k++) { if (!hasInternalModes(k)) { m_b[2*m_nsp + k] = 0.0; @@ -166,7 +161,6 @@ void MultiTransport::solveLMatrixEquation() // Solve it using GMRES or LU decomposition. The last solution // in m_a should provide a good starting guess, so convergence // should be fast. - copy(m_b.begin(), m_b.end(), m_a.begin()); try { solve(m_Lmatrix, DATA_PTR(m_a)); @@ -312,7 +306,6 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s // If there is a temperature gradient, then get the // thermal diffusion coefficients - bool addThermalDiffusion = false; if (state1[0] != state2[0]) { addThermalDiffusion = true; @@ -321,7 +314,6 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s const doublereal* y = m_thermo->massFractions(); doublereal rho = m_thermo->density(); - for (size_t i = 0; i < m_nsp; i++) { doublereal sum = 0.0; for (size_t j = 0; j < m_nsp; j++) { @@ -345,7 +337,6 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s // set the matrix elements in this row to the mass fractions, // and set the entry in gradx to zero - for (size_t j = 0; j < m_nsp; j++) { m_aa(jmax,j) = y[j]; fluxes[j] = x2[j] - x1[j]; @@ -365,7 +356,6 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s } doublereal pp = pressure_ig(); - // multiply diffusion velocities by rho * Y_k to create // mass fluxes, and divide by pressure for (size_t i = 0; i < m_nsp; i++) { @@ -421,7 +411,6 @@ void MultiTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d) doublereal prefactor = 16.0 * m_temp * m_thermo->meanMolecularWeight()/(25.0 * p); doublereal c; - for (size_t i = 0; i < m_nsp; i++) { for (size_t j = 0; j < m_nsp; j++) { c = prefactor/m_mw[j]; @@ -436,9 +425,7 @@ void MultiTransport::update_T() if (m_temp == m_thermo->temperature()) { return; } - GasTransport::update_T(); - // temperature has changed, so polynomial fits will need to be // redone, and the L matrix reevaluated. m_abc_ok = false; @@ -524,11 +511,9 @@ void MultiTransport::updateThermal_T() */ vector_fp cp(m_thermo->nSpecies()); m_thermo->getCp_R_ref(&cp[0]); - for (size_t k = 0; k < m_nsp; k++) { m_cinternal[k] = cp[k] - 2.5; } - m_thermal_tlast = m_thermo->temperature(); } @@ -547,7 +532,6 @@ void MultiTransport::eval_L0000(const doublereal* const x) for (size_t i = 0; i < m_nsp; i++) { // subtract-off the k=i term to account for the first delta // function in Eq. (12.121) - sum = -x[i]/m_bdiff(i,i); for (size_t k = 0; k < m_nsp; k++) { sum += x[k]/m_bdiff(i,k); @@ -566,7 +550,6 @@ void MultiTransport::eval_L0000(const doublereal* const x) void MultiTransport::eval_L0010(const doublereal* const x) { doublereal prefactor = 1.6*m_temp; - doublereal sum, wj, xj; for (size_t j = 0; j < m_nsp; j++) { xj = x[j]; @@ -598,15 +581,12 @@ void MultiTransport::eval_L1010(const doublereal* x) { const doublereal fiveover3pi = 5.0/(3.0*Pi); doublereal prefactor = (16.0*m_temp)/25.0; - doublereal constant1, wjsq, constant2, constant3, constant4, fourmj, threemjsq, sum, sumwij;; doublereal term1, term2; for (size_t j = 0; j < m_nsp; j++) { - // get constant terms that depend on just species "j" - constant1 = prefactor*x[j]; wjsq = m_mw[j]*m_mw[j]; constant2 = 13.75*wjsq; @@ -616,7 +596,6 @@ void MultiTransport::eval_L1010(const doublereal* x) threemjsq = 3.0*m_mw[j]*m_mw[j]; sum = 0.0; for (size_t i = 0; i < m_nsp; i++) { - sumwij = m_mw[i] + m_mw[j]; term1 = m_bdiff(i,j) * sumwij*sumwij; term2 = fourmj*m_astar(i,j)*(1.0 + fiveover3pi* @@ -695,7 +674,6 @@ void MultiTransport::eval_L0101(const doublereal* x) { const doublereal fivepi = 5.00*Pi; const doublereal eightoverpi = 8.0 / Pi; - doublereal prefactor = 4.00*m_temp; size_t n2 = 2*m_nsp; doublereal constant1, constant2, diff_int, sum; diff --git a/src/transport/SimpleTransport.cpp b/src/transport/SimpleTransport.cpp index 0eb99a9ae..6bff5d739 100644 --- a/src/transport/SimpleTransport.cpp +++ b/src/transport/SimpleTransport.cpp @@ -104,7 +104,6 @@ SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) m_Grad_T = right.m_Grad_T; m_Grad_P = right.m_Grad_P; m_Grad_V = right.m_Grad_V; - m_diffSpecies = right.m_diffSpecies; m_viscSpecies = right.m_viscSpecies; m_condSpecies = right.m_condSpecies; @@ -115,7 +114,6 @@ SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) meanMolecularWeight_ = right.meanMolecularWeight_; dens_ = right.dens_; m_chargeSpecies = right.m_chargeSpecies; - m_temp = right.m_temp; m_press = right.m_press; m_lambda = right.m_lambda; @@ -168,13 +166,11 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) XML_Node& transportNode = phaseNode.child("transport"); string transportModel = transportNode.attrib("model"); if (transportModel == "Simple") { - - compositionDepType_ = tr.compositionDepTypeDefault_; - + compositionDepType_ = tr.compositionDepTypeDefault_; } else { - throw CanteraError("SimpleTransport::initLiquid()", - "transport model isn't the correct type: " + transportModel); - } + throw CanteraError("SimpleTransport::initLiquid()", + "transport model isn't the correct type: " + transportModel); + } } // make a local copy of the molecular weights @@ -187,9 +183,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) m_viscSpecies.resize(m_nsp); m_coeffVisc_Ns.clear(); m_coeffVisc_Ns.resize(m_nsp); - std::string spName = m_thermo->speciesName(0); - for (size_t k = 0; k < m_nsp; k++) { spName = m_thermo->speciesName(k); LiquidTransportData& ltd = tr.LTData[k]; @@ -203,7 +197,6 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) m_condSpecies.resize(m_nsp); m_coeffLambda_Ns.clear(); m_coeffLambda_Ns.resize(m_nsp); - for (size_t k = 0; k < m_nsp; k++) { spName = m_thermo->speciesName(k); LiquidTransportData& ltd = tr.LTData[k]; @@ -215,17 +208,14 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) * Get the input species diffusivities */ useHydroRadius_ = false; - m_diffSpecies.resize(m_nsp); m_coeffDiff_Ns.clear(); m_coeffDiff_Ns.resize(m_nsp); - for (size_t k = 0; k < m_nsp; k++) { spName = m_thermo->speciesName(k); LiquidTransportData& ltd = tr.LTData[k]; m_coeffDiff_Ns[k] = ltd.speciesDiffusivity; ltd.speciesDiffusivity = 0; - if (!m_coeffDiff_Ns[k]) { if (ltd.hydroRadius) { m_coeffHydroRadius_Ns[k] = (ltd.hydroRadius)->duplMyselfAsLTPspecies(); @@ -239,7 +229,6 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) m_molefracs.resize(m_nsp); m_concentrations.resize(m_nsp); - m_chargeSpecies.resize(m_nsp); for (size_t k = 0; k < m_nsp; k++) { m_chargeSpecies[k] = m_thermo->charge(k); @@ -255,13 +244,10 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) // set all flags to false m_visc_mix_ok = false; m_visc_temp_ok = false; - m_cond_temp_ok = false; m_cond_mix_ok = false; - m_diff_temp_ok = false; m_diff_mix_ok = false; - return true; } @@ -383,7 +369,7 @@ doublereal SimpleTransport::thermalConductivity() } } else { throw CanteraError("SimpleTransport::thermalConductivity()", - "Unknown compositionDepType"); + "Unknown compositionDepType"); } m_cond_mix_ok = true; } @@ -408,9 +394,7 @@ void SimpleTransport::getSpeciesVdiff(size_t ndim, set_Grad_X(grad_X); const doublereal* y = m_thermo->massFractions(); const doublereal rho = m_thermo->density(); - getSpeciesFluxesExt(m_nsp, DATA_PTR(Vdiff)); - for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { if (y[k] > 1.0E-200) { @@ -432,9 +416,7 @@ void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, set_Grad_V(grad_Phi); const doublereal* y = m_thermo->massFractions(); const doublereal rho = m_thermo->density(); - getSpeciesFluxesExt(m_nsp, DATA_PTR(Vdiff)); - for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { if (y[k] > 1.0E-200) { @@ -465,12 +447,9 @@ void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) const vector_fp& mw = m_thermo->molecularWeights(); const doublereal* y = m_thermo->massFractions(); - doublereal concTotal = m_thermo->molarDensity(); // Unroll wrt ndim - - if (doMigration_) { double FRT = ElectronCharge / (Boltzmann * m_temp); for (size_t n = 0; n < m_nDim; n++) { @@ -528,7 +507,6 @@ void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) } fluxes[n*ldf + m_velocityBasis] = 0.0; } - } else { throw CanteraError("SimpleTransport::getSpeciesFluxesExt()", "unknown velocity basis"); @@ -575,12 +553,10 @@ bool SimpleTransport::update_C() return false; } - // Mixture stuff needs to be evaluated m_visc_mix_ok = false; m_diff_mix_ok = false; m_cond_mix_ok = false; - return true; } @@ -651,10 +627,8 @@ bool SimpleTransport::update_T() // Set all of these flags to false m_visc_mix_ok = false; m_visc_temp_ok = false; - m_cond_temp_ok = false; m_cond_mix_ok = false; - m_diff_mix_ok = false; m_diff_temp_ok = false; diff --git a/src/transport/SolidTransport.cpp b/src/transport/SolidTransport.cpp index df7e1a2fc..5010aa6aa 100644 --- a/src/transport/SolidTransport.cpp +++ b/src/transport/SolidTransport.cpp @@ -75,7 +75,6 @@ bool SolidTransport::initSolid(SolidTransportData& tr) tr.defectDiffusivity = 0; m_defectActivity = tr.defectActivity; tr.defectActivity = 0; - return true; } @@ -83,7 +82,6 @@ void SolidTransport::setParameters(const int n, const int k, const doublereal* c { warn_deprecated("SolidTransport::setParameters"); switch (n) { - case 0: // set the Arrhenius parameters for the diffusion coefficient // of species k. @@ -93,20 +91,16 @@ void SolidTransport::setParameters(const int n, const int k, const doublereal* c m_Ediff.push_back(p[2]); m_nmobile = m_sp.size(); break; - case 1: // set the thermal conductivity Arrhenius parameters. m_Alam = p[0]; m_Nlam = p[2]; m_Elam = p[2]; break; - default: ; } - m_work.resize(m_thermo->nSpecies()); - } doublereal SolidTransport::ionConductivity() @@ -164,7 +158,6 @@ void SolidTransport::getMobilities(doublereal* const mobil) for (size_t k = 0; k < m_thermo->nSpecies(); k++) { mobil[k] *= c1; } - } void SolidTransport::getMixDiffCoeffs(doublereal* const d) diff --git a/src/transport/SolidTransportData.cpp b/src/transport/SolidTransportData.cpp index 35fa2b490..a0f3f1838 100644 --- a/src/transport/SolidTransportData.cpp +++ b/src/transport/SolidTransportData.cpp @@ -17,7 +17,6 @@ SolidTransportData::SolidTransportData() : defectDiffusivity(0), defectActivity(0) { - } SolidTransportData::SolidTransportData(const SolidTransportData& right) : diff --git a/src/transport/TransportBase.cpp b/src/transport/TransportBase.cpp index e6fa6893b..cd3055a92 100644 --- a/src/transport/TransportBase.cpp +++ b/src/transport/TransportBase.cpp @@ -26,7 +26,6 @@ Transport::Transport(const Transport& right) m_velocityBasis = right.m_velocityBasis; } - Transport& Transport::operator=(const Transport& right) { if (&right != this) { diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 875479826..2388b2d92 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -14,7 +14,6 @@ #include "cantera/transport/HighPressureGasTransport.h" #include "cantera/transport/TransportFactory.h" #include "cantera/transport/SolidTransportData.h" - #include "cantera/base/ctml.h" #include "cantera/base/stringUtils.h" #include "cantera/base/utilities.h" @@ -134,9 +133,7 @@ LiquidTranInteraction* TransportFactory::newLTI(const XML_Node& trNode, LiquidTransportParams& trParam) { LiquidTranInteraction* lti = 0; - thermo_t* thermo = trParam.thermo; - std::string model = trNode["model"]; switch (m_LTImodelMap[model]) { case LTI_MODEL_SOLVENT: @@ -181,9 +178,7 @@ LiquidTranInteraction* TransportFactory::newLTI(const XML_Node& trNode, lti->init(trNode, thermo); break; default: - // // @TODO make sure we can throw an error here with existing datasets and tests before changing code - // lti = new LiquidTranInteraction(tp_ind); lti->init(trNode, thermo); } @@ -193,12 +188,10 @@ LiquidTranInteraction* TransportFactory::newLTI(const XML_Node& trNode, Transport* TransportFactory::newTransport(const std::string& transportModel, thermo_t* phase, int log_level, int ndim) { - if (transportModel == "") { return new Transport; } - vector_fp state; Transport* tr = 0, *gastr = 0; DustyGasTransport* dtr = 0; @@ -229,7 +222,6 @@ Transport* TransportFactory::newTransport(const std::string& transportModel, tr->init(phase, 0, log_level); break; case cSolidTransport: - tr = new SolidTransport; initSolidTransport(tr, phase, log_level); tr->setThermo(*phase); @@ -271,7 +263,6 @@ Transport* TransportFactory::newTransport(thermo_t* phase, int log_level) void TransportFactory::setupLiquidTransport(thermo_t* thermo, int log_level, LiquidTransportParams& trParam) { - const std::vector & species_database = thermo->speciesData(); const XML_Node* phase_database = &thermo->xml(); @@ -279,7 +270,6 @@ void TransportFactory::setupLiquidTransport(thermo_t* thermo, int log_level, trParam.thermo = thermo; trParam.nsp_ = trParam.thermo->nSpecies(); size_t nsp = trParam.nsp_; - trParam.tmin = thermo->minTemp(); trParam.tmax = thermo->maxTemp(); trParam.log_level = log_level; @@ -309,7 +299,6 @@ void TransportFactory::setupLiquidTransport(thermo_t* thermo, int log_level, XML_Node& transportNode = phase_database->child("transport"); getLiquidInteractionsTransportData(transportNode, log, trParam.thermo->speciesNames(), trParam); } - } void TransportFactory::setupSolidTransport(thermo_t* thermo, int log_level, @@ -321,7 +310,6 @@ void TransportFactory::setupSolidTransport(thermo_t* thermo, int log_level, trParam.thermo = thermo; trParam.nsp_ = trParam.thermo->nSpecies(); size_t nsp = trParam.nsp_; - trParam.tmin = thermo->minTemp(); trParam.tmax = thermo->maxTemp(); trParam.log_level = log_level; @@ -401,7 +389,6 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vector(name,data)); } @@ -493,7 +478,6 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vector &names, - LiquidTransportParams& trParam) + XML_Node& log, + const std::vector &names, + LiquidTransportParams& trParam) { try { - size_t nsp = trParam.nsp_; size_t nBinInt = nsp*(nsp-1)/2; - size_t num = transportNode.nChildren(); for (size_t iChild = 0; iChild < num; iChild++) { //tranTypeNode is a type of transport property like viscosity XML_Node& tranTypeNode = transportNode.child(iChild); std::string nodeName = tranTypeNode.name(); - trParam.mobilityRatio.resize(nsp*nsp,0); trParam.selfDiffusion.resize(nsp,0); ThermoPhase* temp_thermo = trParam.thermo; - if (tranTypeNode.name() == "compositionDependence") { - std::string modelName = tranTypeNode.attrib("model"); - std::map::iterator it = m_LTImodelMap.find(modelName); - if (it == m_LTImodelMap.end()) { - throw CanteraError("TransportFactory::getLiquidInteractionsTransportData", - "Unknown compositionDependence string: " + modelName); - } else { - trParam.compositionDepTypeDefault_ = it->second; - } - } else { - if (tranTypeNode.hasChild("compositionDependence")) { - //compDepNode contains the interaction model - XML_Node& compDepNode = tranTypeNode.child("compositionDependence"); - switch (m_tranPropMap[nodeName]) { - break; - case TP_VISCOSITY: - trParam.viscosity = newLTI(compDepNode, m_tranPropMap[nodeName], trParam); - break; - case TP_IONCONDUCTIVITY: - trParam.ionConductivity = newLTI(compDepNode, - m_tranPropMap[nodeName], - trParam); - break; - case TP_MOBILITYRATIO: { - for (size_t iSpec = 0; iSpec< nBinInt; iSpec++) { - XML_Node& propSpecNode = compDepNode.child(iSpec); - string specName = propSpecNode.name(); - size_t loc = specName.find(":"); - string firstSpec = specName.substr(0,loc); - string secondSpec = specName.substr(loc+1); - size_t index = temp_thermo->speciesIndex(firstSpec.c_str())+nsp*temp_thermo->speciesIndex(secondSpec.c_str()); - trParam.mobilityRatio[index] = newLTI(propSpecNode, - m_tranPropMap[nodeName], - trParam); - }; - }; - break; - case TP_SELFDIFFUSION: { - for (size_t iSpec = 0; iSpec< nsp; iSpec++) { - XML_Node& propSpecNode = compDepNode.child(iSpec); - string specName = propSpecNode.name(); - size_t index = temp_thermo->speciesIndex(specName.c_str()); - trParam.selfDiffusion[index] = newLTI(propSpecNode, - m_tranPropMap[nodeName], - trParam); - }; - }; - break; - case TP_THERMALCOND: - trParam.thermalCond = newLTI(compDepNode, - m_tranPropMap[nodeName], - trParam); - break; - case TP_DIFFUSIVITY: - trParam.speciesDiffusivity = newLTI(compDepNode, - m_tranPropMap[nodeName], - trParam); - break; - case TP_HYDRORADIUS: - trParam.hydroRadius = newLTI(compDepNode, - m_tranPropMap[nodeName], - trParam); - break; - case TP_ELECTCOND: - trParam.electCond = newLTI(compDepNode, - m_tranPropMap[nodeName], - trParam); - break; - default: - throw CanteraError("getLiquidInteractionsTransportData","unknown transport property: " + nodeName); - - } - } - /* Allow a switch between mass-averaged, mole-averaged - * and solvent specified reference velocities. - * XML code within the transportProperty node - * (i.e. within ) should read as follows - * - * - * - */ - if (tranTypeNode.hasChild("velocityBasis")) { - std::string velocityBasis = - tranTypeNode.child("velocityBasis").attrib("basis"); - if (velocityBasis == "mass") { - trParam.velocityBasis_ = VB_MASSAVG; - } else if (velocityBasis == "mole") { - trParam.velocityBasis_ = VB_MOLEAVG; - } else if (trParam.thermo->speciesIndex(velocityBasis) > 0) { - trParam.velocityBasis_ = static_cast(trParam.thermo->speciesIndex(velocityBasis)); - } else { - int linenum = __LINE__; - throw TransportDBError(linenum, "Unknown attribute \"" + velocityBasis + "\" for node. "); - } - } - } - } + if (tranTypeNode.name() == "compositionDependence") { + std::string modelName = tranTypeNode.attrib("model"); + std::map::iterator it = m_LTImodelMap.find(modelName); + if (it == m_LTImodelMap.end()) { + throw CanteraError("TransportFactory::getLiquidInteractionsTransportData", + "Unknown compositionDependence string: " + modelName); + } else { + trParam.compositionDepTypeDefault_ = it->second; + } + } else { + if (tranTypeNode.hasChild("compositionDependence")) { + //compDepNode contains the interaction model + XML_Node& compDepNode = tranTypeNode.child("compositionDependence"); + switch (m_tranPropMap[nodeName]) { + break; + case TP_VISCOSITY: + trParam.viscosity = newLTI(compDepNode, m_tranPropMap[nodeName], trParam); + break; + case TP_IONCONDUCTIVITY: + trParam.ionConductivity = newLTI(compDepNode, + m_tranPropMap[nodeName], + trParam); + break; + case TP_MOBILITYRATIO: { + for (size_t iSpec = 0; iSpec< nBinInt; iSpec++) { + XML_Node& propSpecNode = compDepNode.child(iSpec); + string specName = propSpecNode.name(); + size_t loc = specName.find(":"); + string firstSpec = specName.substr(0,loc); + string secondSpec = specName.substr(loc+1); + size_t index = temp_thermo->speciesIndex(firstSpec.c_str())+nsp*temp_thermo->speciesIndex(secondSpec.c_str()); + trParam.mobilityRatio[index] = newLTI(propSpecNode, + m_tranPropMap[nodeName], + trParam); + }; + }; + break; + case TP_SELFDIFFUSION: { + for (size_t iSpec = 0; iSpec< nsp; iSpec++) { + XML_Node& propSpecNode = compDepNode.child(iSpec); + string specName = propSpecNode.name(); + size_t index = temp_thermo->speciesIndex(specName.c_str()); + trParam.selfDiffusion[index] = newLTI(propSpecNode, + m_tranPropMap[nodeName], + trParam); + }; + }; + break; + case TP_THERMALCOND: + trParam.thermalCond = newLTI(compDepNode, + m_tranPropMap[nodeName], + trParam); + break; + case TP_DIFFUSIVITY: + trParam.speciesDiffusivity = newLTI(compDepNode, + m_tranPropMap[nodeName], + trParam); + break; + case TP_HYDRORADIUS: + trParam.hydroRadius = newLTI(compDepNode, + m_tranPropMap[nodeName], + trParam); + break; + case TP_ELECTCOND: + trParam.electCond = newLTI(compDepNode, + m_tranPropMap[nodeName], + trParam); + break; + default: + throw CanteraError("getLiquidInteractionsTransportData","unknown transport property: " + nodeName); + } + } + /* Allow a switch between mass-averaged, mole-averaged + * and solvent specified reference velocities. + * XML code within the transportProperty node + * (i.e. within ) should read as follows + * + * + * + */ + if (tranTypeNode.hasChild("velocityBasis")) { + std::string velocityBasis = + tranTypeNode.child("velocityBasis").attrib("basis"); + if (velocityBasis == "mass") { + trParam.velocityBasis_ = VB_MASSAVG; + } else if (velocityBasis == "mole") { + trParam.velocityBasis_ = VB_MOLEAVG; + } else if (trParam.thermo->speciesIndex(velocityBasis) > 0) { + trParam.velocityBasis_ = static_cast(trParam.thermo->speciesIndex(velocityBasis)); + } else { + int linenum = __LINE__; + throw TransportDBError(linenum, "Unknown attribute \"" + velocityBasis + "\" for node. "); + } + } + } + } } catch (CanteraError& err) { std::cout << err.what() << std::endl; } @@ -631,13 +611,11 @@ void TransportFactory::getSolidTransportData(const XML_Node& transportNode, SolidTransportData& trParam) { try { - size_t num = transportNode.nChildren(); for (size_t iChild = 0; iChild < num; iChild++) { //tranTypeNode is a type of transport property like viscosity XML_Node& tranTypeNode = transportNode.child(iChild); std::string nodeName = tranTypeNode.name(); - ThermoPhase* temp_thermo = trParam.thermo; //tranTypeNode contains the interaction model @@ -669,7 +647,6 @@ void TransportFactory::getSolidTransportData(const XML_Node& transportNode, break; default: throw CanteraError("getSolidTransportData","unknown transport property: " + nodeName); - } } } catch (CanteraError) { diff --git a/src/transport/WaterTransport.cpp b/src/transport/WaterTransport.cpp index 0afc0eff8..661e60fc7 100644 --- a/src/transport/WaterTransport.cpp +++ b/src/transport/WaterTransport.cpp @@ -1,6 +1,5 @@ //! @file WaterTransport.cpp #include "cantera/transport/WaterTransport.h" - #include "cantera/thermo/VPStandardStateTP.h" #include "cantera/thermo/PDSS_Water.h" #include "cantera/thermo/WaterSSTP.h" @@ -46,13 +45,11 @@ void WaterTransport::initTP() // The expectation is that we have a VPStandardStateTP derived object VPStandardStateTP* vpthermo = dynamic_cast(m_thermo); if (!vpthermo) { - WaterSSTP* wsstp = dynamic_cast(m_thermo); if (!wsstp) { throw CanteraError("WaterTransport::initTP()", "Expectation is that ThermoPhase be a VPStandardStateTP"); } else { - m_sub = wsstp->getWater(); AssertTrace(m_sub != 0); // Get a pointer to a changeable WaterProps object diff --git a/src/zeroD/ConstPressureReactor.cpp b/src/zeroD/ConstPressureReactor.cpp index b230d0201..cd237114a 100644 --- a/src/zeroD/ConstPressureReactor.cpp +++ b/src/zeroD/ConstPressureReactor.cpp @@ -67,7 +67,6 @@ void ConstPressureReactor::evalEqs(doublereal time, doublereal* y, { double dmdt = 0.0; // dm/dt (gas phase) double* dYdt = ydot + 2; - m_thermo->restoreState(m_state); applySensitivity(params); evalWalls(time); diff --git a/src/zeroD/FlowReactor.cpp b/src/zeroD/FlowReactor.cpp index 3cc41f3c1..9ef906380 100644 --- a/src/zeroD/FlowReactor.cpp +++ b/src/zeroD/FlowReactor.cpp @@ -31,9 +31,7 @@ void FlowReactor::getInitialConditions(double t0, size_t leny, double* y) return; } m_thermo->restoreState(m_state); - m_thermo->getMassFractions(y+2); - y[0] = 0.0; // distance // set the second component to the initial speed @@ -48,13 +46,11 @@ void FlowReactor::initialize(doublereal t0) void FlowReactor::updateState(doublereal* y) { - // Set the mass fractions and density of the mixture. m_dist = y[0]; m_speed = y[1]; doublereal* mss = y + 2; m_thermo->setMassFractions(mss); - doublereal rho = m_rho0 * m_speed0/m_speed; // assumes frictionless diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index e229099df..46fc09525 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -137,20 +137,17 @@ void Reactor::updateState(doublereal* y) // species, and [K+3...] are the coverages of surface species on each wall. m_mass = y[0]; m_vol = y[1]; - m_thermo->setMassFractions_NoNorm(y+3); if (m_energy) { // Use a damped Newton's method to determine the mixture temperature. // Tight tolerances are required both for Jacobian evaluation and for // sensitivity analysis to work correctly. - doublereal U = y[2]; doublereal T = temperature(); double dT = 100; double dUprev = 1e10; double dU = 1e10; - int i = 0; double damp = 1.0; while (abs(dT / T) > 10 * DBL_EPSILON) { @@ -274,7 +271,6 @@ void Reactor::evalEqs(doublereal time, doublereal* y, AssertFinite(ydot[i], "Reactor::evalEqs", "ydot[" + int2str(i) + "] is not finite"); } - resetSensitivity(params); } @@ -292,7 +288,6 @@ void Reactor::evalWalls(double t) double Reactor::evalSurfaces(double t, double* ydot) { const vector_fp& mw = m_thermo->molecularWeights(); - fill(m_sdot.begin(), m_sdot.end(), 0.0); size_t loc = 0; // offset into ydot double mdot_surf = 0.0; // net mass flux from surface diff --git a/src/zeroD/ReactorFactory.cpp b/src/zeroD/ReactorFactory.cpp index 070b65902..ad781c394 100644 --- a/src/zeroD/ReactorFactory.cpp +++ b/src/zeroD/ReactorFactory.cpp @@ -4,7 +4,6 @@ // Copyright 2006 California Institute of Technology #include "cantera/zeroD/ReactorFactory.h" - #include "cantera/zeroD/Reservoir.h" #include "cantera/zeroD/Reactor.h" #include "cantera/zeroD/FlowReactor.h" @@ -36,15 +35,12 @@ static int _itypes[] = {ReservoirType, ReactorType, ConstPressureReactorType, */ ReactorBase* ReactorFactory::newReactor(const std::string& reactorType) { - int ir=-1; - for (int n = 0; n < ntypes; n++) { if (reactorType == _types[n]) { ir = _itypes[n]; } } - return newReactor(ir); } @@ -72,4 +68,3 @@ ReactorBase* ReactorFactory::newReactor(int ir) } } - diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index 41e0effe5..04e6bbb70 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -21,7 +21,6 @@ ReactorNet::ReactorNet() : // use backward differencing, with a full Jacobian computed // numerically, and use a Newton linear iterator - m_integ->setMethod(BDF_Method); m_integ->setProblemType(DENSE + NOJAC); m_integ->setIterator(Newton_Iter); @@ -150,7 +149,6 @@ void ReactorNet::eval(doublereal t, doublereal* y, { size_t n; size_t pstart = 0; - updateState(y); for (n = 0; n < m_reactors.size(); n++) { m_reactors[n]->evalEqs(t, y + m_start[n], @@ -168,7 +166,6 @@ void ReactorNet::evalJacobian(doublereal t, doublereal* y, //evaluate the unperturbed ydot eval(t, y, ydot, p); for (size_t n = 0; n < m_nv; n++) { - // perturb x(n) ysave = y[n]; dy = m_atol[n] + fabs(ysave)*m_rtol; diff --git a/test/SConscript b/test/SConscript index 3c97f95fe..47e7773bc 100644 --- a/test/SConscript +++ b/test/SConscript @@ -255,7 +255,7 @@ if localenv['python3_package'] == 'y': if localenv['matlab_toolbox'] == 'y': matlabTest = addMatlabTest('runCanteraTests.m', 'matlab', dependencies=mglob(localenv, 'matlab', 'm'), - env_vars=python_env_vars) + env_vars=python_env_vars) localenv.Alias('test-matlab', matlabTest) env['testNames'].append('matlab') diff --git a/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp index 0cccbb754..827996413 100644 --- a/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp +++ b/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp @@ -12,7 +12,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; string fName = "DH_graph_1.log"; diff --git a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp b/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp index 8effabbde..9948ffbd2 100644 --- a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp +++ b/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp @@ -14,7 +14,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; diff --git a/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp b/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp index dea1e2797..d053993b0 100644 --- a/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp +++ b/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp @@ -14,7 +14,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; diff --git a/test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp b/test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp index 582ac5113..2fd168021 100644 --- a/test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp +++ b/test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp @@ -12,7 +12,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; string commandFile; diff --git a/test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp b/test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp index 7c8e4e99c..99c22a809 100644 --- a/test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp +++ b/test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp @@ -16,7 +16,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; int extraCols = 1; diff --git a/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp b/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp index 537aff2df..0ae544f29 100644 --- a/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp +++ b/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp @@ -14,7 +14,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; diff --git a/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp b/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp index c36524520..cc1371c1d 100644 --- a/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp +++ b/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp @@ -13,7 +13,6 @@ using namespace Cantera; int main(int argc, char** argv) { - int retn = 0; size_t i; diff --git a/test_problems/cathermo/wtWater/wtWater.cpp b/test_problems/cathermo/wtWater/wtWater.cpp index da0d94568..8c21ca3fd 100644 --- a/test_problems/cathermo/wtWater/wtWater.cpp +++ b/test_problems/cathermo/wtWater/wtWater.cpp @@ -18,7 +18,6 @@ double tvalue(double val, double atol = 1.0E-9) int main() { - try { double lambda; WaterSSTP* w = new WaterSSTP("waterTPphase.xml", ""); diff --git a/test_problems/cxx_ex/equil_example1.cpp b/test_problems/cxx_ex/equil_example1.cpp index 7f44410c2..06603db40 100644 --- a/test_problems/cxx_ex/equil_example1.cpp +++ b/test_problems/cxx_ex/equil_example1.cpp @@ -47,7 +47,6 @@ void plotEquilSoln(const std::string& fname, const std::string& fmt, int equil_example1(int job) { - std::cout << "Chemical equilibrium." << std::endl; if (job > 0) { std::cout << "Equilibrium composition and pressure for a " diff --git a/test_problems/cxx_ex/kinetics_example1.cpp b/test_problems/cxx_ex/kinetics_example1.cpp index 3229a4e3f..0d058986a 100644 --- a/test_problems/cxx_ex/kinetics_example1.cpp +++ b/test_problems/cxx_ex/kinetics_example1.cpp @@ -18,14 +18,12 @@ using namespace std; // job = 0: print a one-line description of the example. // job = 1: print a longer description // job = 2: print description, then run the example. -// // Note: although this simulation can be done in C++, as shown here, // it is much easier in Python or Matlab! int kinetics_example1(int job) { - try { cout << "Ignition simulation using class IdealGasMix " diff --git a/test_problems/cxx_ex/kinetics_example3.cpp b/test_problems/cxx_ex/kinetics_example3.cpp index 57210720c..c1775ba50 100644 --- a/test_problems/cxx_ex/kinetics_example3.cpp +++ b/test_problems/cxx_ex/kinetics_example3.cpp @@ -20,7 +20,6 @@ using std::endl; // job = 0: print a one-line description of the example. // job = 1: print a longer description // job = 2: print description, then run the example. -// // Note: although this simulation can be done in C++, as shown here, // it is much easier in Python or Matlab! diff --git a/test_problems/cxx_ex/rxnpath_example1.cpp b/test_problems/cxx_ex/rxnpath_example1.cpp index e7398c957..b33a87b2a 100644 --- a/test_problems/cxx_ex/rxnpath_example1.cpp +++ b/test_problems/cxx_ex/rxnpath_example1.cpp @@ -18,7 +18,6 @@ using std::endl; void writeRxnPathDiagram(double time, ReactionPathBuilder& b, IdealGasMix& gas, std::ostream& logfile, std::ostream& outfile) { - // create a new empty diagram ReactionPathDiagram d; diff --git a/test_problems/diamondSurf/diamond.cti b/test_problems/diamondSurf/diamond.cti index 2cb6cb0d2..f17ed90d3 100644 --- a/test_problems/diamondSurf/diamond.cti +++ b/test_problems/diamondSurf/diamond.cti @@ -25,14 +25,14 @@ stoichiometric_solid(name = 'diamond', species = 'C(d)') species(name = 'C(d)', - atoms = 'C:1') #no thermo needed (rxn is ireversible) + atoms = 'C:1') #no thermo needed (rxn is ireversible) #------------- the diamond surface ------------------------------------- ideal_interface(name = 'diamond_100', - elements = ' H C ', - species = 'c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B', + elements = ' H C ', + species = 'c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B', reactions = 'all', phases = 'gas diamond', site_density = (3.0E-9, 'mol/cm2'), @@ -105,5 +105,3 @@ surface_reaction( 'c6H* <=> c6*H', [1.0E8, 0.0, 0.0]) #t # reaction to add new carbon atom to bulk and regenerate a new site # surface_reaction( 'c6B <=> c6HH + C(d)', [1.0E9, 0.0, 0.0]) #u - - diff --git a/test_problems/rankine_democxx/rankine.cpp b/test_problems/rankine_democxx/rankine.cpp index 13e545d7a..0f76aad3d 100644 --- a/test_problems/rankine_democxx/rankine.cpp +++ b/test_problems/rankine_democxx/rankine.cpp @@ -36,7 +36,6 @@ void printStates() int openRankine(int np, void* p) { - double etap = 0.6; // pump isentropic efficiency double etat = 0.8; // turbine isentropic efficiency double phigh = 8.0e5; // high pressure diff --git a/test_problems/simpleTransport/simpleTransportTest.cpp b/test_problems/simpleTransport/simpleTransportTest.cpp index 5acaa482b..bf750ed2f 100644 --- a/test_problems/simpleTransport/simpleTransportTest.cpp +++ b/test_problems/simpleTransport/simpleTransportTest.cpp @@ -70,9 +70,7 @@ int main(int argc, char** argv) Cantera::appdelete(); return 0; - } catch (CanteraError) { - showErrors(); return -1; } diff --git a/test_problems/surfSolverTest/haca2.cti b/test_problems/surfSolverTest/haca2.cti index 1a81035e5..15e45d2b6 100644 --- a/test_problems/surfSolverTest/haca2.cti +++ b/test_problems/surfSolverTest/haca2.cti @@ -51,8 +51,8 @@ species(name = 'CB-CB3', # Site density taken from Frenklach/Wang p. 179. # ideal_interface(name = 'soot_interface', - elements = 'O H C N Ar ', - species = 'Csoot-* Csoot-H', + elements = 'O H C N Ar ', + species = 'Csoot-* Csoot-H', reactions = 'all', phases = 'gas soot', site_density = (3.8E-9, 'mol/cm2'), @@ -64,7 +64,7 @@ ideal_interface(name = 'soot_interface', # the reconstructed diamond (100) surface, 'J. Phys. Chem. vo. 97, # 23-28 (1993). reactions a - t are taken directly from Table II, # with thermochemistry from Table IV. -# -> Thermo needs to be reviewed, as deltaG for reactions are +# -> Thermo needs to be reviewed, as deltaG for reactions are # very important. # species(name = 'Csoot-*', @@ -79,7 +79,7 @@ species(name = 'Csoot-H', thermo = const_cp(t0 = (1000., 'K'), h0 = (11.4, 'kcal/mol'), s0 = (21.0, 'cal/mol/K'), - cp0 = (8.41, 'cal/mol/K')) ) + cp0 = (8.41, 'cal/mol/K')) ) # # Forward rate constant taken from Frenklach/Wang: surface_reaction( 'Csoot-H + H => Csoot-* + H2', [4.17E13, 0.0, 13.0]) diff --git a/test_problems/surfSolverTest/surfaceSolver.cpp b/test_problems/surfSolverTest/surfaceSolver.cpp index a405b34d8..a34e4ebc9 100644 --- a/test_problems/surfSolverTest/surfaceSolver.cpp +++ b/test_problems/surfSolverTest/surfaceSolver.cpp @@ -31,7 +31,6 @@ using namespace Cantera; /*****************************************************************/ static void printUsage() { - } void printGas(ostream& oooo, ThermoPhase* gasTP, InterfaceKinetics* iKin_ptr, double* src) diff --git a/test_problems/surfSolverTest/surfaceSolver2.cpp b/test_problems/surfSolverTest/surfaceSolver2.cpp index 5793f1efd..99c9eab8e 100644 --- a/test_problems/surfSolverTest/surfaceSolver2.cpp +++ b/test_problems/surfSolverTest/surfaceSolver2.cpp @@ -21,7 +21,6 @@ /*****************************************************************/ static void printUsage() { - } #include "cantera/Interface.h" diff --git a/test_problems/surfkin/surfdemo.cpp b/test_problems/surfkin/surfdemo.cpp index f2817e821..3f0fca029 100644 --- a/test_problems/surfkin/surfdemo.cpp +++ b/test_problems/surfkin/surfdemo.cpp @@ -11,7 +11,6 @@ using namespace std; int main() { - try { IdealGasMix gas("gri30.xml", "gri30"); gas.setState_TPX(1200.0, OneAtm,