Added a function to MixTransport and MultiTransport that returns

all of the raw transport data input from the original database.
I am using this in cttables for the print out to provide closure
to the user's expectations.
This commit is contained in:
Harry Moffat 2003-08-02 00:16:27 +00:00
parent e160e01754
commit 70c432b7f4
7 changed files with 103 additions and 11 deletions

View file

@ -22,6 +22,7 @@
#include "utilities.h"
#include "TransportParams.h"
#include "TransportFactory.h"
#include <iostream>
@ -58,7 +59,18 @@ namespace Cantera {
m_visccoeffs = tr.visccoeffs;
m_condcoeffs = tr.condcoeffs;
m_diffcoeffs = tr.diffcoeffs;
m_zrot = tr.zrot;
m_crot = tr.crot;
m_epsilon = tr.epsilon;
m_mode = tr.mode;
m_diam = tr.diam;
m_eps = tr.eps;
m_alpha = tr.alpha;
m_dipoleDiag.resize(m_nsp);
for (int i = 0; i < m_nsp; i++) {
m_dipoleDiag[i] = tr.dipole(i,i);
}
m_phi.resize(m_nsp, m_nsp, 0.0);
@ -442,4 +454,30 @@ namespace Cantera {
m_viscwt_ok = true;
}
/**
* This function returns a Transport data object for a given species.
*
*/
struct GasTransportData MixTransport::
getGasTransportData(int kSpecies)
{
struct GasTransportData td;
td.speciesName = m_thermo->speciesName(kSpecies);
td.geometry = 2;
if (m_crot[kSpecies] == 0.0) {
td.geometry = 0;
} else if (m_crot[kSpecies] == 1.0) {
td.geometry = 1;
}
td.wellDepth = m_eps[kSpecies] / Boltzmann;
td.dipoleMoment = m_dipoleDiag[kSpecies] * 1.0E25 / SqrtTen;
td.diameter = m_diam(kSpecies, kSpecies) * 1.0E10;
td.polarizability = m_alpha[kSpecies] * 1.0E30;
td.rotRelaxNumber = m_zrot[kSpecies];
return td;
}
}

View file

@ -78,6 +78,15 @@ namespace Cantera {
friend class TransportFactory;
/**
* Return a structure containing all of the pertinent parameters
* about a species that was used to construct the Transport
* properties in this object.
*
* @param k Species number to obtain the properties from.
*/
struct GasTransportData getGasTransportData(int);
protected:
/// default constructor
@ -124,6 +133,8 @@ namespace Cantera {
vector_fp m_crot;
vector_fp m_cinternal;
vector_fp m_eps;
vector_fp m_alpha;
vector_fp m_dipoleDiag;
doublereal m_temp, m_logt, m_kbt, m_t32;
doublereal m_sqrt_kbt, m_sqrt_t;

View file

@ -32,6 +32,8 @@
#include "TransportParams.h"
#include "IdealGasPhase.h"
#include "TransportFactory.h"
#include <iostream>
/**
@ -156,6 +158,11 @@ namespace Cantera {
m_mode = tr.mode;
m_diam = tr.diam;
m_eps = tr.eps;
m_alpha = tr.alpha;
m_dipoleDiag.resize(m_nsp);
for (int i = 0; i < m_nsp; i++) {
m_dipoleDiag[i] = tr.dipole(i,i);
}
// the L matrix
m_Lmatrix.resize(3*m_nsp, 3*m_nsp);
@ -806,4 +813,30 @@ namespace Cantera {
const array_fp& cp = ((IdealGasPhase*)m_thermo)->cp_R();
for (k = 0; k < m_nsp; k++) m_cinternal[k] = cp[k] - 2.5;
}
/**
* This function returns a Transport data object for a given species.
*
*/
struct GasTransportData MultiTransport::
getGasTransportData(int kSpecies)
{
struct GasTransportData td;
td.speciesName = m_thermo->speciesName(kSpecies);
td.geometry = 2;
if (m_crot[kSpecies] == 0.0) {
td.geometry = 0;
} else if (m_crot[kSpecies] == 1.0) {
td.geometry = 1;
}
td.wellDepth = m_eps[kSpecies] / Boltzmann;
td.dipoleMoment = m_dipoleDiag[kSpecies] * 1.0E25 / SqrtTen;
td.diameter = m_diam(kSpecies, kSpecies) * 1.0E10;
td.polarizability = m_alpha[kSpecies] * 1.0E30;
td.rotRelaxNumber = m_zrot[kSpecies];
return td;
}
}

View file

@ -159,6 +159,15 @@ namespace Cantera {
friend class TransportFactory;
/**
* Return a structure containing all of the pertinent parameters
* about a species that was used to construct the Transport
* properties in this object.
*
* @param k Species number to obtain the properties from.
*/
struct GasTransportData getGasTransportData(int);
protected:
/// default constructor
@ -209,6 +218,8 @@ namespace Cantera {
vector_fp m_crot;
vector_fp m_cinternal;
vector_fp m_eps;
vector_fp m_alpha;
vector_fp m_dipoleDiag;
doublereal m_temp, m_logt, m_kbt, m_t32;
doublereal m_sqrt_kbt, m_sqrt_t;

View file

@ -80,7 +80,6 @@ namespace Cantera {
* returns a reference to the object representing the phase
* itself.
*/
//phase_t& phase() { return *m_phase; }
thermo_t& thermo() { return *m_thermo; }

View file

@ -665,7 +665,7 @@ namespace Cantera {
{
string name;
int geom;
map<string, TransportData> datatable;
map<string, GasTransportData> datatable;
doublereal welldepth, diam, dipole, polar, rot;
//XML_Node* sparray = find_XML("", &root, "", "", "speciesData");
@ -705,7 +705,7 @@ namespace Cantera {
//polar = fv["polarizability"];
//rot = fv["rotRelax"];
TransportData data;
GasTransportData data;
data.speciesName = name;
data.geometry = geom;
if (welldepth >= 0.0) data.wellDepth = welldepth;
@ -737,7 +737,7 @@ namespace Cantera {
for (i = 0; i < tr.nsp; i++) {
TransportData& trdat = datatable[names[i]];
GasTransportData& trdat = datatable[names[i]];
// 'datatable' returns a default TransportData object if
// the species name is not one in the transport database.

View file

@ -40,13 +40,13 @@ namespace Cantera {
/**
* Struct to hold data read from a transport property database file.
*/
struct TransportData {
TransportData() : speciesName("-"),
geometry(-1), wellDepth(-1.0),
diameter(-1.0),
dipoleMoment(-1.0),
polarizability(-1.0),
rotRelaxNumber(-1.0) {}
struct GasTransportData {
GasTransportData() : speciesName("-"),
geometry(-1), wellDepth(-1.0),
diameter(-1.0),
dipoleMoment(-1.0),
polarizability(-1.0),
rotRelaxNumber(-1.0) {}
string speciesName;
int geometry;