Documentation 6b54b78464
Loading...
Searching...
No Matches
CCoolPropConductivity.hpp
Go to the documentation of this file.
1/*!
2 * \file CCoolPropConductivity.hpp
3 * \brief Defines laminar thermal conductivity model from CoolProp.
4 * \author P.YAn, G. Gori, A. Guardone
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
31#include "CCoolProp.hpp"
32
33#ifdef USE_COOLPROP
34#include "AbstractState.h"
35#include "CoolProp.h"
36#endif
37/*!
38 * \class CCoolPropConductivity
39 * \brief Defines conductivity model from CoolProp.
40 * \author P.Yan
41 */
43 private:
44#ifdef USE_COOLPROP
45 std::unique_ptr<CoolProp::AbstractState> fluid_entity; /*!< \brief fluid entity */
46#endif
47 /*!< \brief list of fluids whose conductivity model is available in CoolProp */
48 const vector<string> fluidNameList = {
49 "Air", "Ammonia", "Argon", "Benzene", "CarbonDioxide", "Cyclopentane", "EthylBenzene",
50 "Ethane", "Ethanol", "HeavyWater", "Helium", "Hydrogen", "IsoButane", "Isopentane",
51 "Methane", "Methanol", "Nitrogen", "Oxygen", "Propylene", "ParaHydrogen", "R11",
52 "R116", "R12", "R123", "R1234yf", "R1234ze(E)", "R124", "R125",
53 "R13", "R134a", "R14", "R141b", "R142b", "R143a", "R152A",
54 "R218", "R22", "R227EA", "R23", "R236EA", "R236FA", "R245fa",
55 "R32", "R404A", "R407C", "R410A", "R507A", "RC318", "SulfurHexafluoride",
56 "Toluene", "Water", "m-Xylene", "n-Butane", "n-Decane", "n-Dodecane", "n-Heptane",
57 "n-Hexane", "n-Nonane", "n-Octane", "n-Pentane", "n-Propane", "o-Xylene", "p-Xylene"};
58
59 public:
60 /*!
61 * \brief Constructor of the class.
62 */
63 CCoolPropConductivity(const string& fluidname) {
64#ifdef USE_COOLPROP
65 fluid_entity = std::unique_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("HEOS", fluidname));
66 if (std::find(fluidNameList.begin(), fluidNameList.end(), fluidname) == fluidNameList.end()) {
67 SU2_MPI::Error("Conductivity model not available for this fluid in CoolProp library.", CURRENT_FUNCTION);
68 }
69#else
71 "SU2 was not compiled with CoolProp (-Denable-coolprop=true). Note that CoolProp cannot be used with "
72 "directdiff or autodiff",
74#endif
75 }
76
77 /*!
78 * \brief Set thermal conductivity.
79 */
81#ifdef USE_COOLPROP
82 fluid_entity->update(CoolProp::DmassT_INPUTS, rho, t);
83 kt_ = fluid_entity->conductivity();
84#endif
85 }
86};
Defines an interface class for thermal conductivity models.
Defines the state-of-the-art fluid model from CoolProp library.
static void Error(const std::string &ErrorMsg, const std::string &FunctionName)
Definition mpi_structure.cpp:131
Interface class for defining the thermal conductivity model.
Definition CConductivityModel.hpp:39
su2double kt_
Thermal conductivity.
Definition CConductivityModel.hpp:68
Defines conductivity model from CoolProp.
Definition CCoolPropConductivity.hpp:42
void SetConductivity(su2double t, su2double rho, su2double, su2double, su2double, su2double, su2double) override
Set thermal conductivity.
Definition CCoolPropConductivity.hpp:80
CCoolPropConductivity(const string &fluidname)
Constructor of the class.
Definition CCoolPropConductivity.hpp:63
passivedouble su2double
Definition code_config.hpp:181
#define CURRENT_FUNCTION
Definition mpi_structure.hpp:59