Start of a new Tortuosity treatment -> taking it into Cantera

in a formal way.
This commit is contained in:
Harry Moffat 2011-12-14 16:03:27 +00:00
parent f59c07606a
commit 81d315e562
11 changed files with 937 additions and 34 deletions

View file

@ -37,12 +37,14 @@ CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG) $(DEBUG_FLAG)
TRAN_OBJ = TransportFactory.o MultiTransport.o MixTransport.o MMCollisionInt.o \
SolidTransport.o DustyGasTransport.o TransportBase.o WaterTransport.o \
SimpleTransport.o LiquidTransportData.o LiquidTransportParams.o LiquidTranInteraction.o \
TransportParams.o
TransportParams.o \
TortuosityBase.o TortuosityBruggeman.o TortuosityPercolation.o TortuosityMaxwell.o
TRAN_H = TransportFactory.h MultiTransport.h MixTransport.h \
MMCollisionInt.h SolidTransport.h DustyGasTransport.h \
TransportBase.h L_matrix.h TransportParams.h WaterTransport.h \
SimpleTransport.h LiquidTranInteraction.h Tortuosity.h
SimpleTransport.h LiquidTranInteraction.h Tortuosity.h \
TortuosityBase.h TortuosityBruggeman.h TortuosityPercolation.h TortuosityMaxwell.h
ifeq ($(do_electro),1)
do_issp = 1

View file

@ -771,10 +771,12 @@ namespace Cantera {
const array_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 (n = 0; n < m_nDim; n++) {
@ -795,11 +797,47 @@ namespace Cantera {
}
}
// Add correction flux to enforce sum to zero
for (n = 0; n < m_nDim; n++) {
for (k = 0; k < m_nsp; k++) {
fluxes[n*ldf + k] -= y[k] * rhoVc[n];
if (m_velocityBasis == VB_MASSAVG) {
for (n = 0; n < m_nDim; n++) {
rhoVc[n] = 0.0;
for (k = 0; k < m_nsp; k++) {
rhoVc[n] += fluxes[n*ldf + k];
}
}
for (n = 0; n < m_nDim; n++) {
for (k = 0; k < m_nsp; k++) {
fluxes[n*ldf + k] -= y[k] * rhoVc[n];
}
}
} else if (m_velocityBasis == VB_MOLEAVG) {
for (n = 0; n < m_nDim; n++) {
rhoVc[n] = 0.0;
for (k = 0; k < m_nsp; k++) {
rhoVc[n] += fluxes[n*ldf + k] / mw[k];
}
}
for (n = 0; n < m_nDim; n++) {
for (k = 0; k < m_nsp; k++) {
fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
}
}
} else if (m_velocityBasis >= 0) {
for (n = 0; n < m_nDim; n++) {
rhoVc[n] = - fluxes[n*ldf + m_velocityBasis] / mw[m_velocityBasis];
for (k = 0; k < m_nsp; k++) {
rhoVc[n] += fluxes[n*ldf + k] / mw[k];
}
}
for (n = 0; n < m_nDim; n++) {
for (k = 0; k < m_nsp; k++) {
fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
}
fluxes[n*ldf + m_velocityBasis] = 0.0;
}
} else {
throw CanteraError("SimpleTransport::getSpeciesFluxesExt()",
"unknown velocity basis");
}
}
//================================================================================================

View file

@ -1,38 +1,54 @@
/**
* @file Tortuosity.h
* Class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
* @file TortuosityBruggeman.h
* Class to compute the increase in diffusive path length in porous media
* assuming the Bruggeman exponent relation
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#ifndef CT_TORTUOSITYBRUGGEMAN_H
#define CT_TORTUOSITYBRUGGEMAN_H
namespace Cantera {
/**
* Class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
* This base class implementation relates tortuosity to volume fraction
* through a power-law relationship that goes back to Bruggemann. The
* exponent is referred to as the Bruggemann exponent.
*
* Note that the total diffusional flux is generally written as
*
* \f[
* \frac{ \phi C_T D_i \nabla X_i }{ \tau^2 }
* \f]
*
* where \f$ \phi \f$ is the volume fraction of the transported phase,
* \f$ \tau \f$ is referred to as the tortuosity. (Other variables are
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion
* coefficient, and \f$ X_i \f$, the mole fraction with Fickian
* transport assumed.)
*
* The tortuosity comes into play in conjunction the the
*/
class Tortuosity {
//! Specific Class to handle tortuosity corrections for diffusive transport
//! in porous media using the Bruggeman exponent
/*!
* Class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
* This base class implementation relates tortuosity to volume fraction
* through a power-law relationship that goes back to Bruggemann. The
* exponent is referred to as the Bruggemann exponent.
*
* Note that the total diffusional flux is generally written as
*
* \f[
* \frac{ \phi C_T D_i \nabla X_i }{ \tau^2 }
* \f]
*
* where \f$ \phi \f$ is the volume fraction of the transported phase,
* \f$ \tau \f$ is referred to as the tortuosity. (Other variables are
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion
* coefficient, and \f$ X_i \f$, the mole fraction with Fickian
* transport assumed.)
*
* The tortuosity comes into play in conjunction the the
*/
class TortuosityBruggeman {
public:
//! Default constructor uses Bruggemann exponent of 1.5
Tortuosity( double setPower = 1.5 ) : expBrug_(setPower) {
TortuosityBruggeman(double setPower = 1.5 ) : expBrug_(setPower) {
}
//! The tortuosity factor models the effective increase in the

View file

@ -0,0 +1,96 @@
/**
* @file TortuosityBase.cpp
* Base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#include "TortuosityBase.h"
#include "ctexceptions.h"
#include <string>
namespace Cantera {
//====================================================================================================================
static void err(const std::string r) {
throw Cantera::CanteraError("TortuosityBase", "Error calling base class " + r);
}
//====================================================================================================================
// Default constructor
TortuosityBase::TortuosityBase()
{
}
//====================================================================================================================
// Copy Constructor
/*
* @param right Object to be copied
*/
TortuosityBase::TortuosityBase(const TortuosityBase &right)
{
*this = right;
}
//====================================================================================================================
// Default destructor for TortuosityBase
TortuosityBase::~TortuosityBase() {
}
//====================================================================================================================
// Assignment operator
/*
* @param right Object to be copied
*/
TortuosityBase & TortuosityBase::operator=(const TortuosityBase &right) {
if (&right == this) {
return *this;
}
return *this;
}
//====================================================================================================================
// Duplication operator
/*
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
TortuosityBase * TortuosityBase::duplMyselfAsTortuosityBase() const {
TortuosityBase * tb = new TortuosityBase(*this);
return tb;
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.
/*
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
doublereal TortuosityBase::tortuosityFactor(doublereal porosity) {
err("tortuosityFactor");
return 0.0;
}
//====================================================================================================================
// The McMillan number is the ratio of the flux-like variable to the value it would have without porous flow.
/*
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
doublereal TortuosityBase::McMillanFactor(doublereal porosity) {
err("McMillanFactor");
return 0.0;
}
//====================================================================================================================
}

View file

@ -0,0 +1,108 @@
/**
* @file TortuosityBase.h
* Virtual base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#ifndef CT_TORTUOSITYBASE_H
#define CT_TORTUOSITYBASE_H
#include "ct_defs.h"
namespace Cantera {
//! Base case to handle tortuosity corrections for diffusive transport
//! in porous media
/*!
* Class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
* This base class implementation relates tortuosity to volume fraction
* through a power-law relationship that goes back to Bruggemann. The
* exponent is referred to as the Bruggemann exponent.
*
* Note that the total diffusional flux is generally written as
*
* \f[
* \frac{ \phi C_T D_i \nabla X_i }{ \tau^2 }
* \f]
*
* where \f$ \phi \f$ is the volume fraction of the transported phase,
* \f$ \tau \f$ is referred to as the tortuosity. (Other variables are
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion
* coefficient, and \f$ X_i \f$, the mole fraction with Fickian
* transport assumed.)
*
* The tortuosity comes into play in conjunction the the
*/
class TortuosityBase {
public:
//! Default constructor uses Bruggemann exponent of 1.5
TortuosityBase();
//! Copy Constructor
/*!
* @param right Object to be copied
*/
TortuosityBase(const TortuosityBase &right);
//! Default destructor for TortuosityBase
virtual ~TortuosityBase();
//! Assignment operator
/*!
* @param right Object to be copied
*/
TortuosityBase & operator=(const TortuosityBase &right);
//! Duplication operator
/*!
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
virtual TortuosityBase * duplMyselfAsTortuosityBase() const;
//! The tortuosity factor models the effective increase in the
//! diffusive transport length.
/*!
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
virtual doublereal tortuosityFactor(doublereal porosity);
//! The McMillan number is the ratio of the flux-like
//! variable to the value it would have without porous flow.
/**
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
virtual doublereal McMillanFactor(doublereal porosity);
protected:
};
}
#endif

View file

@ -0,0 +1,99 @@
/**
* @file TortuosityBase.cpp
* Base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#include "TortuosityBruggeman.h"
#include "ctexceptions.h"
#include <string>
namespace Cantera {
//====================================================================================================================
// Default constructor
TortuosityBruggeman::TortuosityBruggeman(doublereal setPower) :
TortuosityBase(),
expBrug_(setPower)
{
}
//====================================================================================================================
// Copy Constructor
/*
* @param right Object to be copied
*/
TortuosityBruggeman::TortuosityBruggeman(const TortuosityBruggeman &right) :
TortuosityBase(),
expBrug_(right.expBrug_)
{
*this = right;
}
//====================================================================================================================
// Default destructor for TortuosityBruggeman
TortuosityBruggeman::~TortuosityBruggeman() {
}
//====================================================================================================================
// Assignment operator
/*
* @param right Object to be copied
*/
TortuosityBruggeman & TortuosityBruggeman::operator=(const TortuosityBruggeman &right) {
if (&right == this) {
return *this;
}
TortuosityBase::operator=(right);
expBrug_ = right.expBrug_;
return *this;
}
//====================================================================================================================
// Duplication operator
/*
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
TortuosityBase * TortuosityBruggeman::duplMyselfAsTortuosityBase() const {
TortuosityBruggeman * tb = new TortuosityBruggeman(*this);
return dynamic_cast<TortuosityBase *>(tb);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.
/*
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
doublereal TortuosityBruggeman::tortuosityFactor(doublereal porosity) {
return pow(porosity, expBrug_ - 1.0);
}
//====================================================================================================================
// The McMillan number is the ratio of the flux-like variable to the value it would have without porous flow.
/*
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
doublereal TortuosityBruggeman::McMillanFactor(doublereal porosity) {
return pow(porosity, expBrug_);
}
//====================================================================================================================
}

View file

@ -0,0 +1,114 @@
/**
* @file TortuosityBase.h
* Virtual base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#ifndef CT_TORTUOSITYBRUGGEMAN_H
#define CT_TORTUOSITYBRUGGEMAN_H
#include "TortuosityBase.h"
namespace Cantera {
//! Base case to handle tortuosity corrections for diffusive transport
//! in porous media using the Bruggeman exponential approximation
/*!
* Class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
* This base class implementation relates tortuosity to volume fraction
* through a power-law relationship that goes back to Bruggemann. The
* exponent is referred to as the Bruggemann exponent.
*
* Note that the total diffusional flux is generally written as
*
* \f[
* \frac{ \phi C_T D_i \nabla X_i }{ \tau^2 }
* \f]
*
* where \f$ \phi \f$ is the volume fraction of the transported phase,
* \f$ \tau \f$ is referred to as the tortuosity. (Other variables are
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion
* coefficient, and \f$ X_i \f$, the mole fraction with Fickian
* transport assumed.)
*
* The tortuosity comes into play in conjunction the the
*/
class TortuosityBruggeman : public TortuosityBase {
public:
//! Default constructor uses Bruggemann exponent of 1.5
/*!
* @param setPower Exponent in the Bruggeman factor. The default is 1.5
*/
TortuosityBruggeman(doublereal setPower = 1.5);
//! Copy Constructor
/*!
* @param right Object to be copied
*/
TortuosityBruggeman(const TortuosityBruggeman &right);
//! Default destructor for TortuosityBruggeman
virtual ~TortuosityBruggeman();
//! Assignment operator
/*!
* @param right Object to be copied
*/
TortuosityBruggeman & operator=(const TortuosityBruggeman &right);
//! Duplication operator
/*!
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
virtual TortuosityBase * duplMyselfAsTortuosityBase() const;
//! The tortuosity factor models the effective increase in the
//! diffusive transport length.
/*!
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
virtual doublereal tortuosityFactor(doublereal porosity);
//! The McMillan number is the ratio of the flux-like
//! variable to the value it would have without porous flow.
/**
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
virtual doublereal McMillanFactor(doublereal porosity);
protected:
//! Bruggemann exponent: power to which the tortuosity depends on the volume fraction
doublereal expBrug_;
};
}
#endif

View file

@ -0,0 +1,99 @@
/**
* @file TortuosityBase.cpp
* Base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#include "TortuosityMaxwell.h"
#include "ctexceptions.h"
#include <string>
namespace Cantera {
//====================================================================================================================
// Default constructor
TortuosityMaxwell::TortuosityMaxwell(doublereal relativeConductivities) :
TortuosityBase(),
relativeConductivities_(relativeConductivities)
{
}
//====================================================================================================================
// Copy Constructor
/*
* @param right Object to be copied
*/
TortuosityMaxwell::TortuosityMaxwell(const TortuosityMaxwell &right) :
TortuosityBase(),
relativeConductivities_(right.relativeConductivities_)
{
*this = right;
}
//====================================================================================================================
// Default destructor for TortuosityMaxwell
TortuosityMaxwell::~TortuosityMaxwell() {
}
//====================================================================================================================
// Assignment operator
/*
* @param right Object to be copied
*/
TortuosityMaxwell & TortuosityMaxwell::operator=(const TortuosityMaxwell &right) {
if (&right == this) {
return *this;
}
TortuosityBase::operator=(right);
relativeConductivities_ = right.relativeConductivities_;
return *this;
}
//====================================================================================================================
// Duplication operator
/*
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
TortuosityBase * TortuosityMaxwell::duplMyselfAsTortuosityBase() const {
TortuosityMaxwell * tb = new TortuosityMaxwell(*this);
return dynamic_cast<TortuosityBase *>(tb);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.
/*
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*/
doublereal TortuosityMaxwell::tortuosityFactor(doublereal porosity) {
return McMillanFactor(porosity) / porosity;
}
//====================================================================================================================
// The McMillan number is the ratio of the flux-like variable to the value it would have without porous flow.
/*
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
doublereal TortuosityMaxwell::McMillanFactor(doublereal porosity) {
doublereal tmp = 1 + 3 * ( 1.0 - porosity ) * ( relativeConductivities_ - 1.0 ) / ( relativeConductivities_ + 2 );
return tmp;
}
//====================================================================================================================
}

View file

@ -0,0 +1,118 @@
/**
* @file TortuosityBase.h
* Virtual base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#ifndef CT_TORTUOSITYBRUGGEMAN_H
#define CT_TORTUOSITYBRUGGEMAN_H
#include "TortuosityBase.h"
namespace Cantera {
//! Maxwell model for tortuosity
/*!
*
* This class implements transport coefficient corrections
* appropriate for porous media with a dispersed phase.
* This model goes back to Maxwell. The formula for the
* conductivity is expressed in terms of the volume fraction
* of the continuous phase, \f$ \phi \f$, and the relative
* conductivities of the dispersed and continuous phases,
* \f$ r = \kappa_d / \kappa_0 \f$. For dilute particle
* suspensions the effective conductivity is
*
* \f[
* \kappa / \kappa_0 = 1 + 3 ( 1 - \phi ) ( r - 1 ) / ( r + 2 )
* + O(\phi^2)
* \f]
*
* The class is derived from the TortuosityBase class.
*
*/
class TortuosityMaxwell : public TortuosityBase {
public:
//! Default constructor uses Maxwelln exponent of 1.5
/*!
* @param setPower Exponent in the Maxwell factor. The default is 1.5
*/
TortuosityMaxwell(double relativeConductivites = 0.0);
//! Copy Constructor
/*!
* @param right Object to be copied
*/
TortuosityMaxwell(const TortuosityMaxwell &right);
//! Default destructor for TortuosityMaxwell
virtual ~TortuosityMaxwell();
//! Assignment operator
/*!
* @param right Object to be copied
*/
TortuosityMaxwell & operator=(const TortuosityMaxwell &right);
//! Duplication operator
/*!
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
virtual TortuosityBase * duplMyselfAsTortuosityBase() const;
//! The tortuosity factor models the effective increase in the
//! diffusive transport length.
/*!
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
virtual doublereal tortuosityFactor(doublereal porosity);
//! The McMillan number is the ratio of the flux-like
//! variable to the value it would have without porous flow.
/**
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
virtual doublereal McMillanFactor(doublereal porosity);
protected:
//! Relative conductivities of the dispersed and continuous phases,
/*!
*
* \f[
* \code{relativeConductivites_} = \kappa_d / \kappa_0
* \f]
*/
doublereal relativeConductivities_;
};
}
#endif

View file

@ -0,0 +1,105 @@
/**
* @file TortuosityPercolation.cpp
* Base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#include "TortuosityPercolation.h"
#include "ctexceptions.h"
#include <string>
namespace Cantera {
//====================================================================================================================
// Default constructor
TortuosityPercolation::TortuosityPercolation(double percolationThreshold, double conductivityExponent) :
TortuosityBase(),
percolationThreshold_(percolationThreshold),
conductivityExponent_(conductivityExponent)
{
}
//====================================================================================================================
// Copy Constructor
/*
* @param right Object to be copied
*/
TortuosityPercolation::TortuosityPercolation(const TortuosityPercolation &right) :
TortuosityBase(),
percolationThreshold_(right.percolationThreshold_),
conductivityExponent_(right.conductivityExponent_)
{
*this = right;
}
//====================================================================================================================
// Default destructor for TortuosityPercolation
TortuosityPercolation::~TortuosityPercolation() {
}
//====================================================================================================================
// Assignment operator
/*
* @param right Object to be copied
*/
TortuosityPercolation & TortuosityPercolation::operator=(const TortuosityPercolation &right) {
if (&right == this) {
return *this;
}
TortuosityBase::operator=(right);
percolationThreshold_ = right.percolationThreshold_;
conductivityExponent_ = right.conductivityExponent_;
return *this;
}
//====================================================================================================================
// Duplication operator
/*
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
TortuosityBase * TortuosityPercolation::duplMyselfAsTortuosityBase() const {
TortuosityPercolation * tb = new TortuosityPercolation(*this);
return dynamic_cast<TortuosityBase *>(tb);
}
//====================================================================================================================
// The tortuosity factor models the effective increase in the diffusive transport length.
/*
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*/
doublereal TortuosityPercolation::tortuosityFactor(doublereal porosity) {
return McMillanFactor(porosity) / porosity;
}
//====================================================================================================================
// The McMillan number is the ratio of the flux-like variable to the value it would have without porous flow.
/*
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
doublereal TortuosityPercolation::McMillanFactor(doublereal porosity) {
doublereal tmp = pow(((porosity - percolationThreshold_)
/ ( 1.0 - percolationThreshold_ )) ,
conductivityExponent_);
return tmp;
}
//====================================================================================================================
}

View file

@ -0,0 +1,108 @@
/**
* @file TortuosityBase.h
* Virtual base class to compute the increase in diffusive path length associated with
* tortuous path diffusion through, for example, porous media.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Revision: 572 $
* $Date: 2010-08-13 20:21:57 -0600 (Fri, 13 Aug 2010) $
*/
#ifndef CT_TORTUOSITYPERCOLATION_H
#define CT_TORTUOSITYPERCOLATION_H
#include "TortuosityBase.h"
namespace Cantera {
//! This class implements transport coefficient corrections
//! appropriate for porous media where percollation theory applies.
/*!
*
*
*/
class TortuosityPercolation : public TortuosityBase {
public:
//! Default constructor uses Percolationn exponent of 1.5
/*!
* @param setPower Exponent in the Percolation factor. The default is 1.5
*/
TortuosityPercolation(double percolationThreshold = 0.4, double conductivityExponent = 2.0);
//! Copy Constructor
/*!
* @param right Object to be copied
*/
TortuosityPercolation(const TortuosityPercolation &right);
//! Default destructor for TortuosityPercolation
virtual ~TortuosityPercolation();
//! Assignment operator
/*!
* @param right Object to be copied
*/
TortuosityPercolation & operator=(const TortuosityPercolation &right);
//! Duplication operator
/*!
* @return Returns a pointer to a duplicate of the current object given a
* base class pointer
*/
virtual TortuosityBase * duplMyselfAsTortuosityBase() const;
//! The tortuosity factor models the effective increase in the
//! diffusive transport length.
/*!
* This method returns \f$ 1/\tau^2 \f$ in the description of the flux
*
* \f$ C_T D_i \nabla X_i / \tau^2 \f$.
*
*
*/
virtual doublereal tortuosityFactor(doublereal porosity);
//! The McMillan number is the ratio of the flux-like
//! variable to the value it would have without porous flow.
/*!
* The McMillan number combines the effect of toruosity
* and volume fraction of the transported phase. The net flux
* observed is then the product of the McMillan number and the
* non-porous transport rate. For a conductivity in a non-porous
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
*/
virtual doublereal McMillanFactor(doublereal porosity);
protected:
//! Critical volume fraction / site density for percolation
double percolationThreshold_;
//! Conductivity exponent
/*!
* The McMillan number (ratio of effective conductivity to non-porous conductivity) is
* \f[ \kappa/\kappa_0 = ( \phi - \phi_c )^\mu \f]
* where \f$ \mu \f$ is the conductivity exponent (typical values range from 1.6 to 2.0) and \f$ \phi_c \f$
* is the percolation threshold.
*/
double conductivityExponent_;
};
}
#endif