diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C index dabdc9ae5b..5bb1758577 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C @@ -64,43 +64,47 @@ int main(int argc, char *argv[]) bool newFormat = args.optionFound("newFormat"); speciesTable species; - chemkinReader cr(species, args[1], args[3], args[2], newFormat); + const HashPtrTable& speciesThermo = cr.speciesThermo(); - OFstream reactionsFile(args[4]); - writeEntry(reactionsFile, "elements", cr.elementNames()); - reactionsFile << nl; - writeEntry(reactionsFile, "species", cr.species()); - reactionsFile << nl; - cr.reactions().write(reactionsFile); + dictionary thermoDict; + thermoDict.add("species", cr.species()); + + // Add the species thermo formatted entries + { + OStringStream os; + speciesThermo.write(os); + dictionary speciesThermoDict(IStringStream(os.str())()); + thermoDict.merge(speciesThermoDict); + } // Temporary hack to splice the specie composition data into the thermo file // pending complete integration into the thermodynamics structure - OStringStream os; - cr.speciesThermo().write(os); - dictionary thermoDict(IStringStream(os.str())()); - - wordList speciesList(thermoDict.toc()); - // Add elements - forAll(speciesList, si) + forAllConstIter(HashPtrTable, speciesThermo, iter) { + const word specieName(iter.key()); + dictionary elementsDict("elements"); - forAll(cr.specieComposition()[speciesList[si]], ei) + forAll(cr.specieComposition()[specieName], ei) { elementsDict.add ( - cr.specieComposition()[speciesList[si]][ei].name(), - cr.specieComposition()[speciesList[si]][ei].nAtoms() + cr.specieComposition()[specieName][ei].name(), + cr.specieComposition()[specieName][ei].nAtoms() ); } - thermoDict.subDict(speciesList[si]).add("elements", elementsDict); + thermoDict.subDict(specieName).add("elements", elementsDict); } thermoDict.write(OFstream(args[5])(), false); + + OFstream reactionsFile(args[4]); + cr.reactions().write(reactionsFile); + reactionsFile << nl; writeEntry diff --git a/etc/caseDicts/annotated/collapseDict b/etc/caseDicts/annotated/collapseDict index f8bcef89d4..762623088c 100644 --- a/etc/caseDicts/annotated/collapseDict +++ b/etc/caseDicts/annotated/collapseDict @@ -72,7 +72,7 @@ controlMeshQualityCoeffs { // Name of the dictionary that has the mesh quality coefficients used // by motionSmoother::checkMesh - #include "meshQualityDict"; + #include "meshQualityDict" // The amount that minimumEdgeLength will be reduced by for each // edge if that edge's collapse generates a poor quality face diff --git a/etc/templates/singleFluidCHT/templates/0/fluid/T b/etc/templates/singleFluidCHT/templates/0/fluid/T index fa5585b887..ce5bce2ca0 100644 --- a/etc/templates/singleFluidCHT/templates/0/fluid/T +++ b/etc/templates/singleFluidCHT/templates/0/fluid/T @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "$FOAM_CASE/constant/initialConditions"; +#include "$FOAM_CASE/constant/initialConditions" dimensions [0 0 0 1 0 0 0]; diff --git a/etc/templates/singleFluidCHT/templates/0/fluid/p b/etc/templates/singleFluidCHT/templates/0/fluid/p index fbc3458cb7..afd98aede4 100644 --- a/etc/templates/singleFluidCHT/templates/0/fluid/p +++ b/etc/templates/singleFluidCHT/templates/0/fluid/p @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "$FOAM_CASE/constant/initialConditions"; +#include "$FOAM_CASE/constant/initialConditions" dimensions [1 -1 -2 0 0 0 0]; diff --git a/etc/templates/singleFluidCHT/templates/0/fluid/p_rgh b/etc/templates/singleFluidCHT/templates/0/fluid/p_rgh index 40508e261e..cc9d4b9bcd 100644 --- a/etc/templates/singleFluidCHT/templates/0/fluid/p_rgh +++ b/etc/templates/singleFluidCHT/templates/0/fluid/p_rgh @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "$FOAM_CASE/constant/initialConditions"; +#include "$FOAM_CASE/constant/initialConditions" dimensions [ 1 -1 -2 0 0 0 0 ]; diff --git a/etc/templates/singleFluidCHT/templates/0/solid/T b/etc/templates/singleFluidCHT/templates/0/solid/T index 9908547d97..b882807c73 100644 --- a/etc/templates/singleFluidCHT/templates/0/solid/T +++ b/etc/templates/singleFluidCHT/templates/0/solid/T @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "$FOAM_CASE/constant/initialConditions"; +#include "$FOAM_CASE/constant/initialConditions" dimensions [ 0 0 0 1 0 0 0 ]; diff --git a/etc/templates/singleFluidCHT/templates/0/solid/p b/etc/templates/singleFluidCHT/templates/0/solid/p index 8d32216a66..f7698db520 100644 --- a/etc/templates/singleFluidCHT/templates/0/solid/p +++ b/etc/templates/singleFluidCHT/templates/0/solid/p @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "$FOAM_CASE/constant/initialConditions"; +#include "$FOAM_CASE/constant/initialConditions" dimensions [1 -1 -2 0 0 0 0]; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index e0a15431b5..dabc9779e8 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,34 +73,6 @@ void Foam::multiComponentMixture::correctMassFractions() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::multiComponentMixture::multiComponentMixture -( - const dictionary& thermoDict, - const wordList& specieNames, - const HashPtrTable& thermoData, - const fvMesh& mesh, - const word& phaseName -) -: - basicSpecieMixture(thermoDict, specieNames, mesh, phaseName), - speciesData_(species_.size()), - mixture_("mixture", *thermoData[specieNames[0]]), - mixtureVol_("volMixture", *thermoData[specieNames[0]]) -{ - forAll(species_, i) - { - speciesData_.set - ( - i, - new ThermoType(*thermoData[species_[i]]) - ); - } - - correctMassFractions(); -} - - template Foam::multiComponentMixture::multiComponentMixture ( diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index c300c99206..c7a3cb0401 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -86,17 +86,6 @@ public: // Constructors - //- Construct from dictionary, specie names, thermo database, - // mesh and phase name - multiComponentMixture - ( - const dictionary&, - const wordList& specieNames, - const HashPtrTable& thermoData, - const fvMesh&, - const word& - ); - //- Construct from dictionary, mesh and phase name multiComponentMixture(const dictionary&, const fvMesh&, const word&); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/foamChemistryReader/foamChemistryReader.C deleted file mode 100644 index 328dbb9a43..0000000000 --- a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/foamChemistryReader/foamChemistryReader.C +++ /dev/null @@ -1,185 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "foamChemistryReader.H" -#include "IFstream.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template -Foam::speciesTable& Foam::foamChemistryReader::setSpecies -( - const dictionary& dict, - speciesTable& species -) -{ - wordList s(dict.lookup("species")); - species.transfer(s); - return species; -} - - -template -void Foam::foamChemistryReader::readSpeciesComposition() -{ - if (!chemDict_.found("elements")) - { - Info<< " elements not defined in " << chemDict_.name() << endl; - return; - } - - wordList e(chemDict_.lookup("elements")); - label currentElementIndex(0); - - DynamicList elementNames_; - HashTable