-
Notifications
You must be signed in to change notification settings - Fork 918
[WIP] Composition dependent fluid properties for multicomponent flow #1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
38c76a7
dd1b15d
6ee1122
66df854
d8c7d61
1d7594d
76577fd
cac551b
b84513d
3d76d05
fa07ad8
da3083b
4c04417
18d5390
b62dc18
5227878
e58c006
4721547
f4e0867
4a389f1
a0de596
cb58fdb
a1a88d1
ccca6fd
1d3127c
501c0b8
28b5ed1
c01bffa
cf50879
b1f779b
7b0b8d2
710061f
a49b385
ab1930e
f0c0b5f
de380fc
27d89dc
66167c1
07ca176
d5af431
f1e7b3b
f291d1f
493f2bc
439fea6
74a0480
8edb730
a63cb3b
def916d
6fac4d2
9d439ce
6c3a6fd
1b4a5a1
d94f5ae
6dd9abf
217bd70
e490792
0561b77
722d762
7505426
46b1495
47b53ef
33f9591
8208c9e
54642a1
4af10ed
8284550
cbf436f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #pragma once | ||
|
|
||
| #include <vector> | ||
| #include <memory> | ||
|
|
||
| #include "CFluidModel.hpp" | ||
|
|
||
| class CFluidScalar final : public CFluidModel { | ||
| private: | ||
| unsigned short n_scalars = 0; /*!< \brief Number of transported scalars. */ | ||
| unsigned short n_species_mixture = 0; /*!< \brief Number of species in mixture. */ | ||
| su2double Gas_Constant = 0.0; /*!< \brief Specific gas constant. */ | ||
| su2double Gamma = 0.0; /*!< \brief Ratio of specific heats of the gas. */ | ||
| su2double Pressure_Thermodynamic = 0.0; /*!< \brief Constant pressure thermodynamic. */ | ||
|
|
||
| bool wilke; | ||
| bool davidson; | ||
|
|
||
| std::vector<su2double> massFractions; /*!< \brief Mass fractions of all species. */ | ||
| std::vector<su2double> moleFractions; /*!< \brief Mole fractions of all species. */ | ||
| std::vector<su2double> molarMasses; /*!< \brief Molar masses of all species. */ | ||
| std::vector<su2double> laminarViscosity; /*!< \brief Laminar viscosity of all species. */ | ||
| std::vector<su2double> specificHeat; /*!< \brief Specific heat of all species. */ | ||
| std::vector<su2double> laminarthermalConductivity; /*!< \brief Laminar thermal conductivity of all species. */ | ||
|
|
||
| static const int ARRAYSIZE = 100; | ||
| std::unique_ptr<CViscosityModel> LaminarViscosityPointers[ARRAYSIZE]; | ||
| std::unique_ptr<CConductivityModel> ThermalConductivityPointers[ARRAYSIZE]; | ||
|
|
||
| /*! | ||
| * \brief Convert mass fractions to mole fractions. | ||
| * \param[in] val_scalars - Scalar mass fraction. | ||
| */ | ||
| std::vector<su2double>& massToMoleFractions(const su2double * const val_scalars); | ||
|
|
||
| /*! | ||
| * \brief Wilke mixing law for mixture viscosity. | ||
| * \param[in] val_scalars - Scalar mass fraction. | ||
| */ | ||
| su2double wilkeViscosity(const su2double * const val_scalars); | ||
|
|
||
| /*! | ||
| * \brief Davidson mixing law for mixture viscosity. | ||
| * \param[in] val_scalars - Scalar mass fraction. | ||
| */ | ||
| su2double davidsonViscosity(const su2double * const val_scalars); | ||
|
|
||
| /*! | ||
| * \brief Wilke mixing law for mixture thermal conductivity. | ||
| * \param[in] val_scalars - Scalar mass fraction. | ||
| */ | ||
| su2double wilkeConductivity(const su2double * const val_scalars); | ||
|
|
||
| public: | ||
| /*! | ||
| * \brief Constructor of the class. | ||
| */ | ||
| CFluidScalar(CConfig *config, const su2double value_pressure_operating); | ||
|
|
||
| /*! | ||
| * \brief Set viscosity model. | ||
| */ | ||
| void SetLaminarViscosityModel(const CConfig* config) override; | ||
|
|
||
| /*! | ||
| * \brief Set thermal conductivity model. | ||
| */ | ||
| void SetThermalConductivityModel(const CConfig* config) override; | ||
|
|
||
| /*! | ||
| * \brief Set the Dimensionless State using Temperature. | ||
| * \param[in] val_temperature - Temperature value at the point. | ||
| * \param[in] val_scalars - Scalar mass fraction. | ||
| */ | ||
| unsigned long SetTDState_T(const su2double val_temperature, su2double * const val_scalars) override; | ||
|
|
||
| /*! | ||
| * \brief Get fluid dynamic viscosity. | ||
| */ | ||
| inline su2double GetLaminarViscosity() override {return Mu; } | ||
|
|
||
| /*! | ||
| * \brief Get fluid thermal conductivity. | ||
| */ | ||
| inline su2double GetThermalConductivity() override { return Kt; } | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /*! | ||
| * \file CUnityLewisDiffusivity.hpp | ||
| * \brief Defines unity Lewis mass diffusivity. | ||
| * \author M.Heimgartner | ||
| * \version 7.0.6 "Blackbird" | ||
| * | ||
| * SU2 Project Website: https://su2code.github.io | ||
| * | ||
| * The SU2 Project is maintained by the SU2 Foundation | ||
| * (http://su2foundation.org) | ||
| * | ||
| * Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md) | ||
| * | ||
| * SU2 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 2.1 of the License, or (at your option) any later version. | ||
| * | ||
| * SU2 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 SU2. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "CDiffusivityModel.hpp" | ||
|
|
||
| /*! | ||
| * \class CUnityLewisDiffusivity | ||
| * \brief Defines a unity Lewis mass diffusivity model for species equations. | ||
| * \author M.Heimgartner | ||
| */ | ||
| class CUnityLewisDiffusivity final : public CDiffusivityModel { | ||
| public: | ||
| /*! | ||
| * \brief Constructor of the class. | ||
| */ | ||
| CUnityLewisDiffusivity() {} | ||
|
|
||
| su2double GetDiffusivity() const override {return diff_;} | ||
|
|
||
| /*! | ||
| * \brief Set diffusivity. | ||
| */ | ||
| void SetDiffusivity(su2double T, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp, su2double kt) override { | ||
| diff_ = kt / (Lewis * rho * cp); | ||
| } | ||
|
|
||
| private: | ||
| su2double diff_{0.0}; | ||
| su2double kt_{0.0}; | ||
| su2double Lewis{1}; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const or constexpr passivedouble if you know it is 1. But props for not hard-coding 1 everywhere :) |
||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,7 @@ class CSourcePieceWise_transportedScalar_general final : public CNumerics { | |
| if (flame) | ||
| Residual[iVar] += yinv*Volume*(Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; | ||
| else | ||
| Residual[iVar] += yinv*Volume*Density_i*(Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; | ||
| Residual[iVar] += yinv*Volume*(Density_i*Diffusion_Coeff_i[iVar]+Mass_Diffusivity_Tur)*ScalarVar_Grad_i[iVar][1]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This little bugfix in the axissymmetric source term let the corresponding reg test fail (which was to be expected). reg test-vals need to be adapted |
||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.