Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
553 changes: 551 additions & 2 deletions docs/input-files.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/gsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ add_sources(mutation++
SolidPropertiesSteadyState.cpp
SurfaceChemistry.cpp
SurfaceRadiation.cpp
SurfaceInelastic.cpp
SurfaceBalanceSolverMass.cpp
SurfaceBalanceSolverMassEnergy.cpp
SurfaceBalanceSolverMassEnergyTTv.cpp
SurfacePropertiesNull.cpp
SurfacePropertiesAblation.cpp
SurfaceState.cpp
Expand All @@ -59,3 +61,4 @@ install(FILES SurfaceChemistry.h DESTINATION include/mutation++)
install(FILES SurfaceProperties.h DESTINATION include/mutation++)
install(FILES SurfaceRadiation.h DESTINATION include/mutation++)
install(FILES SurfaceState.h DESTINATION include/mutation++)
#install(FILES Surfacinelastic.h DESTINATION include/mutation++)
101 changes: 101 additions & 0 deletions src/gsi/GSIRateLawGammaTTv.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/**
* @file GSIRateLawGammaT.cpp
*
* @brief Class which computes the reaction rate constant for a surface
* reaction constant according to a gamma type model with gamma
* as an exponential function of temperature.
*/

/*
* Copyright 2018 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 "Thermodynamics.h"
#include "Transport.h"

#include "AutoRegistration.h"
#include "Utilities.h"

#include "GSIRateLaw.h"

using namespace Mutation::Utilities::Config;

namespace Mutation {
namespace GasSurfaceInteraction {

class GSIRateLawGammaT : public GSIRateLaw
{
public:
GSIRateLawGammaTTv(ARGS args)
: GSIRateLaw(args),
mv_react(args.s_reactants),
pos_T_trans(0),
idx_react(0)
{
assert(args.s_node_rate_law.tag() == "gamma_TTv");

args.s_node_rate_law.getAttribute( "pre_exp", m_pre_exp,
"The pre-exponential coefficient for the reaction "
"should be provided with gamma as a function of temperature.");
args.s_node_rate_law.getAttribute( "T", m_activ_en,
"The activation energy for the reaction "
"should be provided with gamma as a function of temperature.");
}

//==============================================================================

~GSIRateLawGammaTTv( ){ }

//==============================================================================

double forwardReactionRateCoefficient(
const Eigen::VectorXd& v_rhoi, const Eigen::VectorXd& v_Twall) const
{
double Twall = v_Twall(pos_T_trans);

const int set_state_with_rhoi_T = 1;
m_thermo.setState(
v_rhoi.data(), v_Twall.data(), set_state_with_rhoi_T);
double m_sp_thermal_speed = m_transport.speciesThermalSpeed(
mv_react[idx_react]);

return m_sp_thermal_speed/4.
* m_pre_exp * std::exp(- m_activ_en/Twall)
/ m_thermo.speciesMw(
mv_react[idx_react])*v_rhoi(mv_react[idx_react]);
}

private:
const size_t pos_T_trans;
const size_t idx_react;

double m_pre_exp;
double m_activ_en;

const std::vector<int>& mv_react;
};

ObjectProvider<
GSIRateLawGammaTTv, GSIRateLaw>
gsi_rate_law_gamma_TTv("gamma_TTv");

} // namespace GasSurfaceInteraction
} // namespace Mutation
3 changes: 3 additions & 0 deletions src/gsi/GSIRateManagerGamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,8 @@ ObjectProvider<GSIRateManagerGamma, GSIRateManager>
ObjectProvider<GSIRateManagerGamma, GSIRateManager>
gsi_rate_manager_gamma_energy("gamma_energy");

ObjectProvider<GSIRateManagerGamma, GSIRateManager>
gsi_rate_manager_gamma_energyTTv("gamma_energy_TTv");

} // namespace GasSurfaceInteraction
} // namespace Mutation
21 changes: 20 additions & 1 deletion src/gsi/GasFourierHeatFluxCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,24 @@ double GasFourierHeatFluxCalculator::computeGasFourierHeatFlux(
return -mv_lambda.dot(mv_dTdx);
}

//==============================================================================

double GasFourierHeatFluxCalculator::computeGasFourierVibrationalHeatFlux(
const VectorXd& v_T) //imporve it
{
if (!m_is_cond_set) {
throw LogicError()
<< "Calling GasFourierHeatFluxCalculator::"
<< "HeatFluxCalculator() before "
<< "calling GasFourierHeatFluxCalculator::"
<< "setGasFourierHeatFluxModel().";
}

mv_dTdx = (v_T - mv_T_edge)/m_dx;
m_transport.frozenThermalConductivityVector(mv_lambda.data());
return -mv_lambda(1)*(mv_dTdx(1));
}

} // namespace GasSurfaceInteraction
} // namespace Mutation
} // namespace Mutation

13 changes: 13 additions & 0 deletions src/gsi/GasFourierHeatFluxCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ class GasFourierHeatFluxCalculator
double computeGasFourierHeatFlux(
const Eigen::VectorXd& v_T);

//==============================================================================
/*
* Function used to compute the total fourier heat flux in
* the gas with given the surface temperature(s) and the ones imposed at
* a given distance from the surface. The temperature gradients
* are computed based on a first order differentiation.
*
* @param Surface temperatures
*
*/
double computeGasFourierVibrationalHeatFlux(
const Eigen::VectorXd& v_T);

private:
Mutation::Transport::Transport& m_transport;

Expand Down
11 changes: 11 additions & 0 deletions src/gsi/GasSurfaceInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ GasSurfaceInteraction::GasSurfaceInteraction(
root_element.findTag("surface_chemistry");
XmlElement::const_iterator xml_pos_surf_rad =
root_element.findTag("surface_radiation");
XmlElement::const_iterator xml_pos_surf_inelastic =
root_element.findTag("surface_inelastc");


// Setting up solid properties
std::string solid_model;
Expand All @@ -108,6 +111,7 @@ GasSurfaceInteraction::GasSurfaceInteraction(
*xml_pos_surf_feats,
*xml_pos_surf_chem,
*xml_pos_surf_rad,
*xml_pos_surf_inelastic,
*mp_surf_state };
mp_surf = Factory<Surface>::create(
m_gsi_mechanism, data_surface);
Expand Down Expand Up @@ -216,6 +220,13 @@ void GasSurfaceInteraction::getMassBlowingRate(double& mdot){

//==============================================================================

/*void GasSurfaceInteraction::getInelasticTerm
(const Eigen::VectorXd& v_X, const Eigen::VectorXd& v_h, const Eigen::VectorXd& chem_souce, double& ine){ //@todo
ine = mp_surf->surfaceInelasticTerm(v_X, v_h, chem_souce);
}*/

//==============================================================================

inline void GasSurfaceInteraction::errorWrongTypeofGSIFile(
const std::string& gsi_root_tag)
{
Expand Down
7 changes: 7 additions & 0 deletions src/gsi/GasSurfaceInteraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ class GasSurfaceInteraction
*/
void getMassBlowingRate(double& mdot);

/**
* Function which return the inelastic energy term.
*
*/
//void getInelasticTerm(const Eigen::VectorXd& v_X, const Eigen::VectorXd& v_h, const Eigen::VectorXd& chem_souce, double& ine);


private:
/**
* Error function; wrong type of Gas Surface Interaction input file.
Expand Down
14 changes: 14 additions & 0 deletions src/gsi/Surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct DataSurface {
const Mutation::Utilities::IO::XmlElement& xml_feats;
const Mutation::Utilities::IO::XmlElement& xml_surf_chem;
const Mutation::Utilities::IO::XmlElement& xml_surf_rad;
const Mutation::Utilities::IO::XmlElement& xml_surf_inelastic;
SurfaceState& s_surf_state;
};

Expand Down Expand Up @@ -193,6 +194,19 @@ class Surface
*/
virtual double massBlowingRate() = 0;

//==============================================================================

/**
* Purely virtual function returning the total surface
* inelastic term.
*/
/*virtual double surfaceInelasticTerm(const Eigen::VectorXd& v_X, const Eigen::VectorXd& v_h, const Eigen::VectorXd& chem_souce)
{
throw LogicError()
<< "surfaceInelasticTerm can be called only when solving "
<< "the surface energy balance!";
}*/

//==============================================================================

};
Expand Down
Loading