Skip to content

Commit

Permalink
Redesign of Millikan-White model classes and OmegaVT
Browse files Browse the repository at this point in the history
  • Loading branch information
jbscoggi committed Aug 4, 2021
1 parent 8c1c129 commit bc9ce81
Show file tree
Hide file tree
Showing 17 changed files with 913 additions and 416 deletions.
29 changes: 29 additions & 0 deletions docs/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ @article{Devoto1973
pages = {616}
}

@techreport{Gnoffo1989,
type = {Technical Paper},
title = {Conservation Equations and Physical Models for Hypersonic Air Flows in Thermal and Chemical Nonequilibrium},
timestamp = {2014-11-13T20:28:41Z},
number = {2867},
institution = {NASA},
author = {Gnoffo, Peter A. and Gupta, Roop N. and Shinn, Judy L.},
month = feb,
year = {1989},
pages = {65},
file = {19890006744.pdf:/ZoteroDB/storage/8Q62P7FU/19890006744.pdf:application/pdf}
}

@article{Laricchiuta2007,
author = {A. Laricchiuta and G. Colonna and D. Bruno and R. Celiberto and C. Gorse and F. Pirani and M. Capitelli},
title = {Classical transport collision integrals for a Lennard-Jones like phenomenological model potential},
Expand Down Expand Up @@ -62,6 +75,22 @@ @techreport{McBride1996
url= {http://www.grc.nasa.gov/WWW/CEAWeb/RP-1311-P2.pdf}
}

@article{Millikan1963,
title = {Systematics of {{Vibrational Relaxation}}},
volume = {39},
issn = {00219606},
doi = {10.1063/1.1734182},
language = {en},
timestamp = {2014-11-13T08:05:38Z},
number = {12},
urldate = {2014-11-11},
journal = {The Journal of Chemical Physics},
author = {Millikan, Roger C. and White, Donald R.},
year = {1963},
pages = {3209},
file = {Millikan1963.pdf:/ZoteroDB/storage/4BEG6H5E/Millikan1963.pdf:application/pdf}
}

@article{Murphy1995,
author = {A. B. Murphy},
title = {Transport Coefficients of Air, Argon-Air, Nitrogen-Air, and Oxygen-Air Plasmas},
Expand Down
2 changes: 2 additions & 0 deletions src/thermo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ add_sources(mutation++
ChemNonEqTTvStateModel.cpp
Composition.cpp
EquilStateModel.cpp
HarmonicOscillator.cpp
MultiPhaseEquilSolver.cpp
Nasa7Polynomial.cpp
Nasa9Polynomial.cpp
Expand All @@ -41,6 +42,7 @@ add_sources(mutation++

add_headers(mutation++
Composition.h
HarmonicOscillator.h
MultiPhaseEquilSolver.h
ParticleRRHO.h
Species.h
Expand Down
91 changes: 91 additions & 0 deletions src/thermo/HarmonicOscillator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright 2014-2021 von Karman Institute for Fluid Dynamics (VKI)
*
* This file is part of MUlticomponent Thermodynamic And Transport
* properties for IONized gases in C++ (Mutation++) software package.
*
* Mutation++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Mutation++ 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Mutation++. If not, see
* <http://www.gnu.org/licenses/>.
*/

#include "HarmonicOscillator.h"
#include "Utilities.h"

#include <cassert>
#include <cmath>
#include <iterator>
#include <sstream>

namespace Mutation {
namespace Thermodynamics {

double HarmonicOscillator::energy(double T) const
{
assert(T > 0.0);

double energy = 0.0;
for (auto theta: m_characteristic_temps)
energy += theta / (std::exp(theta/T) - 1.0);
return energy;
}


struct HarmonicOscillatorDB::Data
{
Utilities::IO::XmlDocument document;

Data(std::string file_path) : document(file_path) { }
};

HarmonicOscillatorDB::HarmonicOscillatorDB() :
HarmonicOscillatorDB(Utilities::databaseFileName("species.xml", "thermo"))
{ }

HarmonicOscillatorDB::HarmonicOscillatorDB(std::string file_path) :
m_data(std::make_shared<Data>(file_path))
{ }

HarmonicOscillator HarmonicOscillatorDB::create(
std::string species_name) const
{
auto& root = m_data->document.root();
auto iter = root.findTagWithAttribute("species", "name", species_name);

if (iter == root.end())
return {};

// Find thermodynamic data
auto thermo_iter = iter->findTagWithAttribute("thermodynamics", "type", "RRHO");
if (thermo_iter == iter->end())
return {};

// Find vibrational temperature data
iter = thermo_iter->findTag("vibrational_temperatures");
if (iter == thermo_iter->end())
return {};

// Split into individual temperatures
std::istringstream ss(iter->text());
std::vector<double> temps;

std::copy(
std::istream_iterator<double>(ss), std::istream_iterator<double>(),
std::back_inserter(temps)
);

return { temps };
}

} // namespace Thermodynamics
} // namespace Mutation
84 changes: 84 additions & 0 deletions src/thermo/HarmonicOscillator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright 2014-2021 von Karman Institute for Fluid Dynamics (VKI)
*
* This file is part of MUlticomponent Thermodynamic And Transport
* properties for IONized gases in C++ (Mutation++) software package.
*
* Mutation++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Mutation++ 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Mutation++. If not, see
* <http://www.gnu.org/licenses/>.
*/

#ifndef THERMO_HARMONIC_OSCILLATOR_H
#define THERMO_HARMONIC_OSCILLATOR_H

#include <memory>
#include <string>
#include <vector>

namespace Mutation {
namespace Thermodynamics {

/**
* Computes vibrator energy based on harmonic-oscillator model.
*/
class HarmonicOscillator
{
public:
/// Default oscillator with zero energy.
HarmonicOscillator() { }

/// Construct with list of characteristic temperatures in K.
template <typename Container>
HarmonicOscillator(const Container&);

/// Returns energy of vibrator in K at given temperature in K.
double energy(double T) const;

/// Convience function to access characteristic temperatures in K.
const std::vector<double>& characteristicTemperatures() const {
return m_characteristic_temps;
}

private:
std::vector<double> m_characteristic_temps;
};

template <typename Container>
HarmonicOscillator::HarmonicOscillator(const Container& temps) :
m_characteristic_temps(std::begin(temps), std::end(temps))
{ }


class HarmonicOscillatorDB
{
public:
/// Constructs the database using default file path.
HarmonicOscillatorDB();

/// Constructs the database using given file path.
HarmonicOscillatorDB(std::string file_path);

/// Creates a new harmonic oscillator associated with given species name.
HarmonicOscillator create(std::string species_name) const;

private:
struct Data;
std::shared_ptr<Data> m_data;
};

} // namespace Thermodynamics
} // namespace Mutation


#endif // THERMO_HARMONIC_OSCILLATOR_H
Loading

0 comments on commit bc9ce81

Please sign in to comment.