Skip to content
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

Add look-up table class #1637

Merged
merged 120 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
4aab1e4
initial commit, adding files
bigfooted May 16, 2022
1202a60
added files to makefile and meson
bigfooted May 16, 2022
8d88fa9
run through clang-format
bigfooted May 17, 2022
15fb1aa
end files with newline
bigfooted May 17, 2022
d69b5a7
Update SU2_CFD/include/numerics/CFileReaderLUT.hpp
bigfooted May 17, 2022
c439501
namespace to header file
bigfooted May 17, 2022
9bb027f
Merge branch 'develop' into feature_lookuptable
bigfooted May 18, 2022
0b7fdb0
Merge branch 'develop' into feature_lookuptable
bigfooted May 20, 2022
7cb4919
Merge branch 'develop' into feature_lookuptable
bigfooted May 21, 2022
1b00541
Merge branch 'develop' into feature_lookuptable
bigfooted May 24, 2022
f4186f6
Merge branch 'develop' into feature_lookuptable
bigfooted May 27, 2022
9bc6b93
Update SU2_CFD/include/numerics/CFileReaderLUT.hpp
bigfooted May 28, 2022
906a5e6
Update SU2_CFD/include/numerics/CLookUpTable.hpp
bigfooted May 28, 2022
e6ac5d4
Update SU2_CFD/src/numerics/CLookUpTable.cpp
bigfooted May 28, 2022
b47cec2
Update SU2_CFD/include/numerics/CLookUpTable.hpp
bigfooted May 28, 2022
5ee571d
Update SU2_CFD/src/numerics/CTrapezoidalMap.cpp
bigfooted May 28, 2022
a05cb46
Update SU2_CFD/src/numerics/CTrapezoidalMap.cpp
bigfooted May 28, 2022
87eacd3
removed local implementation of gaussian inverse, added initial unit-…
bigfooted May 30, 2022
a6ad793
Update SU2_CFD/include/numerics/CLookUpTable.hpp
bigfooted May 31, 2022
b6ebb65
change .at in vectors, moved hpp to containers
bigfooted May 31, 2022
48672f2
corrected path to hpp files
bigfooted May 31, 2022
29889ca
move files to containers folder
bigfooted May 31, 2022
d479e0e
Merge branch 'develop' into feature_lookuptable
bigfooted May 31, 2022
d25356d
move files to containers, including lookup table
bigfooted Jun 2, 2022
97c73d4
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jun 2, 2022
e3efa4e
introduce su2matrix for table_data
bigfooted Jun 3, 2022
5d47c6d
remove unused variable Weights, introduce std::array for fixed size a…
bigfooted Jun 3, 2022
efec5c4
changed triangle into su2matrix
bigfooted Jun 3, 2022
8166d65
cleaned up some unused code
bigfooted Jun 3, 2022
13879e0
Merge branch 'develop' into feature_lookuptable
bigfooted Jun 7, 2022
e6b75b4
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jun 8, 2022
de732fd
Merge branch 'develop' into feature_lookuptable
bigfooted Jun 10, 2022
fae6586
get rid of vector<vector> for table_data
bigfooted Jun 13, 2022
0f428bb
merged with remote
bigfooted Jun 13, 2022
8f5b214
change edge_to_triangle to std::array
bigfooted Jun 13, 2022
f752a0a
remove std namespace from header files and using std::array and std::…
bigfooted Jun 13, 2022
92931c1
remove unnecessary includes
bigfooted Jun 13, 2022
9c79fd2
Update Common/src/containers/CTrapezoidalMap.cpp
bigfooted Jun 14, 2022
362968c
Merge branch 'develop' into feature_lookuptable
bigfooted Jun 15, 2022
b636cdd
Merge branch 'develop' into feature_lookuptable
bigfooted Jun 20, 2022
3fea3dc
update lookuptable unit tests
bigfooted Jun 25, 2022
f7b1a47
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jun 25, 2022
39887d6
switch off lookup table tests
bigfooted Jun 25, 2022
2b9cfb6
compile empty lookuptable test
bigfooted Jun 25, 2022
bbf5de1
compile lookuptable test
bigfooted Jun 25, 2022
d2e03d9
compile lookuptable test
bigfooted Jun 25, 2022
ded6290
compile empty lookuptable test
bigfooted Jun 25, 2022
a03e1dc
compile empty lookuptable test
bigfooted Jun 26, 2022
282eb51
compile empty lookuptable test
bigfooted Jun 26, 2022
e2091c5
compile empty lookuptable test
bigfooted Jun 26, 2022
568cbfc
compile empty lookuptable test
bigfooted Jun 27, 2022
fcdb238
compile empty lookuptable test
bigfooted Jun 27, 2022
428d2d3
compile entire lookuptable test
bigfooted Jun 27, 2022
0863c11
compile empty lookuptable test
bigfooted Jun 27, 2022
ac16207
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 7, 2022
8f2c15e
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 10, 2022
08e884c
switched off unit test
bigfooted Jul 11, 2022
320e593
switched off unit test
bigfooted Jul 11, 2022
72904a5
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 11, 2022
471c21d
unit test change
bigfooted Jul 15, 2022
b52eafe
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jul 15, 2022
3f91c32
unit test change
bigfooted Jul 15, 2022
0878e08
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 15, 2022
a36bb69
unit test change
bigfooted Jul 15, 2022
c1c23f8
unit test change
bigfooted Jul 15, 2022
6a0120b
unit test change
bigfooted Jul 15, 2022
577d075
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 15, 2022
8feb96a
unit test change
bigfooted Jul 15, 2022
74350c4
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jul 15, 2022
1172cdf
unit test change
bigfooted Jul 15, 2022
c030e73
unit test change
bigfooted Jul 16, 2022
68ac2df
unit test change
bigfooted Jul 16, 2022
6d3c0b6
unit test change
bigfooted Jul 16, 2022
dd9a6f0
unit test change
bigfooted Jul 16, 2022
e008afe
unit test change
bigfooted Jul 16, 2022
30c7f09
unit test change
bigfooted Jul 16, 2022
8c62d03
unit test change
bigfooted Jul 16, 2022
2df8425
unit test change
bigfooted Jul 16, 2022
eb5ead1
unit test change
bigfooted Jul 17, 2022
22e61f0
unit test change
bigfooted Jul 17, 2022
d6be81d
unit test change
bigfooted Jul 17, 2022
07b34a9
unit test change
bigfooted Jul 17, 2022
cdb3b28
unit test change
bigfooted Jul 17, 2022
04ce02d
unit test change
bigfooted Jul 17, 2022
5ecf615
unit test change
bigfooted Jul 18, 2022
f413aa6
unit test change
bigfooted Jul 18, 2022
5f22ddf
unit test change
bigfooted Jul 18, 2022
57bb5c1
unit test change
bigfooted Jul 18, 2022
404f2af
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 18, 2022
d0d9995
unit test change
bigfooted Jul 18, 2022
f3afd67
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jul 18, 2022
ceb0fe0
unit test change
bigfooted Jul 18, 2022
cd19560
removed large unit test, kept small unit test for lookup table
bigfooted Jul 18, 2022
cbadcfe
fix lookup table
bigfooted Jul 18, 2022
1536e25
fix lookup table
bigfooted Jul 18, 2022
cc8253c
fix unit regression values
bigfooted Jul 18, 2022
ad89252
modified some comments
bigfooted Jul 18, 2022
d046e0d
fixed unsigned int
bigfooted Jul 19, 2022
27f0721
fix unit regression values
bigfooted Jul 19, 2022
f4c1764
Merge branch 'develop' into feature_lookuptable
bigfooted Jul 22, 2022
b488130
Update Common/include/containers/CFileReaderLUT.hpp
bigfooted Jul 24, 2022
00f9228
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 24, 2022
c62c730
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 24, 2022
45667a8
Update Common/include/containers/CTrapezoidalMap.hpp
bigfooted Jul 24, 2022
9d153ba
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 24, 2022
a92573b
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 24, 2022
0b6147e
Update Common/include/containers/CTrapezoidalMap.hpp
bigfooted Jul 24, 2022
4246b8c
Update UnitTests/Common/containers/CLookupTable_tests.cpp
bigfooted Jul 24, 2022
4cbc4fa
Update Common/src/containers/CFileReaderLUT.cpp
bigfooted Jul 24, 2022
6b862f1
added descriptions of class functions, used mpi::wtime, make some cla…
bigfooted Jul 24, 2022
3c0d0fb
remove using namespace std
bigfooted Jul 24, 2022
1e49f4f
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 25, 2022
933fa7a
Update Common/include/containers/CLookUpTable.hpp
bigfooted Jul 25, 2022
3bd230d
added additional info, removed lookup table identifier
bigfooted Jul 25, 2022
67ab22c
Merge branch 'feature_lookuptable' of https://github.com/su2code/SU2 …
bigfooted Jul 25, 2022
570163c
fix const
bigfooted Jul 26, 2022
3bf6243
fix lookuptable_test roundoff value
bigfooted Jul 26, 2022
def34ab
fix lookuptable_test roundoff value
bigfooted Jul 27, 2022
e3d15ce
fix lookuptable_test roundoff value
bigfooted Jul 27, 2022
50fcedd
remove namespace std
bigfooted Jul 28, 2022
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
25 changes: 22 additions & 3 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
- name: Cleanup
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
with:
entrypoint: /bin/rm
Expand Down Expand Up @@ -192,12 +192,31 @@ jobs:
done
find $BIN_FOLDER -type f -exec chmod a+x '{}' \;
ls -lahR $BIN_FOLDER
echo "cloning branch"
branch="${{github.ref}}"
name="SU2"
SRC_FOLDER="$PWD/src"
mkdir -p $SRC_FOLDER
cd $SRC_FOLDER
git clone --recursive --depth=1 --shallow-submodules https://github.com/su2code/SU2 $name
cd $name
git config --add remote.origin.fetch '+refs/pull/*/merge:refs/remotes/origin/refs/pull/*/merge'
git config --add remote.origin.fetch '+refs/heads/*:refs/remotes/origin/refs/heads/*'
git fetch origin --depth=1 $branch:$branch
git checkout $branch
git submodule update
echo $PWD
ls -lahR
cd ..
echo "done cloning"
echo $PWD
ls -lahR
bigfooted marked this conversation as resolved.
Show resolved Hide resolved
- name: Run Unit Tests
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
with:
entrypoint: install/bin/${{matrix.testdriver}}
- name: Post Cleanup
- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:220614-1237
with:
entrypoint: /bin/rm
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
83 changes: 83 additions & 0 deletions Common/include/containers/CFileReaderLUT.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*!
* \file CFileReaderLUT.hpp
* \brief reading lookup table for tabulated fluid properties
* \author D. Mayer, T. Economon
* \version 7.3.1 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2022, 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 <fstream>
#include <string>
#include <vector>

#include "../../Common/include/parallelization/mpi_structure.hpp"
#include "../../../Common/include/linear_algebra/blas_structure.hpp"
#include "../../../Common/include/toolboxes/CSquareMatrixCM.hpp"

class CFileReaderLUT {
bigfooted marked this conversation as resolved.
Show resolved Hide resolved
protected:
int rank;

std::string version_lut;
std::string version_reader;
unsigned long n_points;
unsigned long n_triangles;
unsigned long n_hull_points;
unsigned long n_variables;

/*! \brief Holds the variable names stored in the table file.
* Order is in sync with tableFlamelet.
*/
std::vector<std::string> names_var;

/*! \brief Holds all data stored in the table.
* First index addresses the variable while second index addresses the point.
*/
su2activematrix table_data;

su2matrix<unsigned long> triangles;

std::vector<unsigned long> hull;

std::string SkipToFlag(std::ifstream* file_stream, const std::string& flag);

public:
CFileReaderLUT(){};

inline const std::string& GetVersionLUT() const { return version_lut; }
inline const std::string& GetVersionReader() const { return version_reader; }
inline unsigned long GetNPoints() const { return n_points; }
inline unsigned long GetNTriangles() const { return n_triangles; }
inline unsigned long GetNHullPoints() const { return n_hull_points; }
inline unsigned long GetNVariables() const { return n_variables; }

inline const std::vector<std::string>& GetNamesVar() const { return names_var; }

inline const su2activematrix& GetTableData() const { return table_data; }

inline const su2matrix<unsigned long>& GetTriangles() const { return triangles; };

inline const std::vector<unsigned long>& GetHull() const { return hull; };

void ReadRawDRG(const std::string& file_name);
};
267 changes: 267 additions & 0 deletions Common/include/containers/CLookUpTable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
/*!
* \file CLookupTable.hpp
* \brief tabulation of fluid properties
* \author D. Mayer, T. Economon
* \version 7.3.1 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2022, 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 <iomanip>
#include <string>
#include <vector>

#include "../../Common/include/option_structure.hpp"
#include "CFileReaderLUT.hpp"
#include "CTrapezoidalMap.hpp"

class CLookUpTable {
protected:
int rank; /*!< \brief MPI Rank. */

std::string file_name_lut;
std::string version_lut;
std::string version_reader;
unsigned long n_points;
unsigned long n_triangles;
unsigned long n_variables;
unsigned long n_hull_points;

/*!
* \brief the lower and upper limits of the enthalpy and progress variable.
*/
su2double limits_table_enth[2];
su2double limits_table_prog[2];

/*! \brief Holds the variable names stored in the table file.
* Order is in sync with data
*/
std::vector<std::string> names_var;

/*! \brief
* Holds all data stored in the table. First index addresses the variable
* while second index addresses the point.
*/
su2activematrix table_data;

su2matrix<unsigned long> triangles;

/* we do not know this size in advance until we go through the entire lookup table */
std::vector<std::vector<unsigned long> > edges;
std::vector<std::vector<unsigned long> > edge_to_triangle;

/*! \brief
* The hull contains the boundary of the lookup table.
*/
std::vector<unsigned long> hull;

CTrapezoidalMap trap_map_prog_enth;

/*! \brief
* vector of all the weight factors for the interpolation.
*/
std::vector<su2activematrix> interp_mat_inv_prog_enth;

/*! \brief
* returns the index to the variable in the lookup table.
*/
inline unsigned int GetIndexOfVar(const std::string& nameVar) const {
int index = find(names_var.begin(), names_var.end(), nameVar) - names_var.begin();
if (index == int(names_var.size())) {
index = -1;
std::string error_msg = "Variable '";
error_msg.append(nameVar);
error_msg.append("' is not in the lookup table.");
SU2_MPI::Error(error_msg, CURRENT_FUNCTION);
}
return index;
}

/*!
* \brief Get the pointer to the column data of the table (density, temperature, source terms, ...).
* \returns pointer to the column data.
*/
inline const su2double* GetDataP(const std::string& name_var) const {
return table_data[GetIndexOfVar(name_var)];
}

/*!
* \brief find the table limits, i.e. the minimum and maximum values of the 2 independent.
* controlling variables (progress variable and enthalpy). We put the values in the variables.
* limits_table_prog[2] and limit_table_enth[2].
* \param[in] name_prog - the string name for the first controlling variable.
* \param[in] name_enth - the string name of the second controlling variable.
*/
void FindTableLimits(const std::string& name_prog, const std::string& name_enth);

/*!
* \brief construct a list of all the edges and a list of the pair of elements left and right of the edge.
*/
void IdentifyUniqueEdges();

/*!
* \brief read the lookup table from file and store the data.
* \param[in] file_name_lut - the filename of the lookup table.
*/
void LoadTableRaw(const std::string& file_name_lut);

/*!
* \brief compute vector of all (inverse) interpolation coefficients "interp_mat_inv_prog_enth" of all triangles.
* \param[in] name_prog - the string name of the first controlling variable (progress variable).
* \param[in] name_enth - the string name of the second controlling variable (enthalpy).
*/
void ComputeInterpCoeffs(const std::string& name_prog, const std::string& name_enth);

/*!
* \brief compute the inverse matrix for interpolation.
* \param[in] vec_x - pointer to first coordinate (progress variable).
* \param[in] vec_y - pointer to second coordinate (enthalpy).
* \param[in] point_ids - single triangle data.
* \param[out] interp_mat_inv - inverse matrix for interpolation.
*/
void GetInterpMatInv(const su2double* vec_x, const su2double* vec_y, std::array<unsigned long,3>& point_ids,
su2activematrix& interp_mat_inv);

/*!
* \brief compute the interpolation coefficients for the triangular interpolation.
* \param[in] val_x - value of first coordinate (progress variable).
* \param[in] val_y - value of second coordinate (enthalpy).
* \param[in] interp_mat_inv - inverse matrix for interpolation.
* \param[out] interp_coeffs - interpolation coefficients.
*/
void GetInterpCoeffs(su2double val_x, su2double val_y, su2activematrix& interp_mat_inv,
std::array<su2double,3>& interp_coeffs);

/*!
* \brief compute interpolated value of a point P in the triangle.
* \param[in] val_samples - pointer to the variable data.
* \param[in] val_triangle - ID to the triangle.
* \param[in] val_interp_coeffs - interpolation coefficients using the point data in P.
* \returns resulting value of the interpolation.
*/
su2double Interpolate(const su2double* val_samples, std::array<unsigned long,3>& val_triangle,
std::array<su2double,3>& val_interp_coeffs);

/*!
* \brief find the point on the hull (boundary of the table) that is closest to the point P(val_prog,val_enth).
* \param[in] val_x - first coordinate of point P(val_x,val_y) to check.
* \param[in] val_y - second coordinate of point P(val_x,val_y) to check.
* \param[in] name_prog - string name of the first controlling variable.
* \param[in] name_enth - string name of the second controlling variable.
* \returns point id of the nearest neighbor on the hull.
*/
unsigned long FindNearestNeighborOnHull(su2double val_prog, su2double val_enth, const std::string& name_prog, const std::string& name_enth);

/*!
* \brief determine if a point P(val_x,val_y) is inside the triangle val_id_triangle.
* \param[in] val_x - first coordinate of point P(val_x,val_y) to check.
* \param[in] val_y - second coordinate of point P(val_x,val_y) to check.
* \param[in] val_id_triangle - ID of the triangle to check.
* \param[in] name_prog - string name of the first controlling variable.
* \param[in] name_enth - string name of the second controlling variable.
* \returns true if the point is in the triangle, false if it is outside.
*/
bool IsInTriangle(su2double val_x, su2double val_y, unsigned long val_id_triangle, const std::string& name_prog,
const std::string& name_enth);

/*!
* \brief compute the area of a triangle given the 3 points of the triangle.
* \param[in] x1 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \param[in] y1 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \param[in] x2 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \param[in] y2 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \param[in] x3 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \param[in] y3 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3).
* \returns the absolute value of the area of the triangle.
*/
inline su2double TriArea(su2double x1, su2double y1, su2double x2, su2double y2, su2double x3, su2double y3) {
return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) * 0.5);
}

public:
CLookUpTable(const std::string& file_name_lut, const std::string& name_prog, const std::string& name_enth);


/*!
* \brief print information to screen.
*/
void PrintTableInfo();

/*!
* \brief lookup 1 value of the single variable "val_name_var" using controlling variable values(val_prog,val_enth)
* whose controlling variable names are "name_prog" and "name_enth".
* \param[in] val_name_var - string name of the variable to look up.
* \param[out] val_var - the stored value of the variable to look up.
* \param[in] val_prog - value of controlling variable 1 (progress variable).
* \param[in] val_enth - value of controlling variable 2 (enthalpy).
* \param[in] name_prog - string name of controlling variable 1 (progress variable).
* \param[in] name_enth - string name of controlling variable 2 (enthalpy).
* \returns 1 if the lookup and subsequent interpolation was a success, 0 if not.
*/
unsigned long LookUp_ProgEnth(const std::string& val_name_var, su2double* val_var, su2double val_prog, su2double val_enth,
const std::string& name_prog, const std::string& name_enth);

/*!
* \brief lookup 1 value for each of the variables in "val_name_var" using controlling variable values(val_prog,val_enth)
* whose controlling variable names are "name_prog" and "name_enth".
* \param[in] val_names_var - vector of string names of the variables to look up.
* \param[out] val_vars - pointer to the vector of stored values of the variables to look up.
* \param[in] val_prog - value of controlling variable 1 (progress variable).
* \param[in] val_enth - value of controlling variable 2 (enthalpy).
* \param[in] name_prog - string name of controlling variable 1 (progress variable).
* \param[in] name_enth - string name of controlling variable 2 (enthalpy).
* \returns 1 if the lookup and subsequent interpolation was a success, 0 if not.
*/
unsigned long LookUp_ProgEnth(const std::vector<std::string>& val_names_var, std::vector<su2double*>& val_vars, su2double val_prog,
su2double val_enth, const std::string& name_prog, const std::string& name_enth);

/*!
* \brief lookup the value of the variable "val_name_var" using controlling variable values(val_prog,val_enth)
* whose controlling variable names are "name_prog" and "name_enth".
* \param[in] val_name_var - string name of the variable to look up.
* \param[out] val_var - the stored value of the variable to look up.
* \param[in] val_prog - value of controlling variable 1 (progress variable).
* \param[in] val_enth - value of controlling variable 2 (enthalpy).
* \param[in] name_prog - string name of controlling variable 1 (progress variable).
* \param[in] name_enth - string name of controlling variable 2 (enthalpy).
* \returns 1 if the lookup and subsequent interpolation was a success, 0 if not.
*/
unsigned long LookUp_ProgEnth(const std::vector<std::string>& val_names_var, std::vector<su2double>& val_vars, su2double val_prog,
su2double val_enth, const std::string& name_prog, const std::string& name_enth);

/*!
* \brief determine the minimum and maximum value of the enthalpy (controlling variable 2).
* \returns pair of minimum and maximum value of controlling variable 2.
*/
inline std::pair<su2double, su2double> GetTableLimitsEnth() const {
return std::make_pair(limits_table_enth[0], limits_table_enth[1]);
}

/*!
* \brief determine the minimum and maximum value of the progress variable (controlling variable 1).
* \returns pair of minimum and maximum value of controlling variable 1.
*/
inline std::pair<su2double, su2double> GetTableLimitsProg() const {
return std::make_pair(limits_table_prog[0], limits_table_prog[1]);
}
};
Loading