Skip to content

Commit 4421142

Browse files
Method documentation
1 parent 119ff4f commit 4421142

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

Manifold_Generation/LUT/LUTGenerators.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ class SU2TableGenerator_NICFD:
110110
"Energy"] # FGM controlling variables
111111
_fluid_data_scaler:MinMaxScaler= MinMaxScaler() # Scaler for flamelet data controlling variables.
112112

113-
def __init__(self, Config:Config_NICFD, load_file:str=None):
113+
def __init__(self, Config:Config_NICFD):
114114
"""
115-
Initiate table generator class.
115+
Initiate table generator class. Settings regarding the fluid data generation and table resolution are automatically retrieved from the configuration object.
116116
117117
:param Config: Config_FGM object.
118118
:type Config: Config_FGM
@@ -183,6 +183,11 @@ def SetRefinement_Radius(self, refinement_radius:float=1e-2):
183183
return
184184

185185
def SetTableDiscretization(self, method:str=DefaultSettings_NICFD.tabulation_method):
186+
"""Overwrite the thermodynamic state space discretization method from the configuration.
187+
188+
:param method: discratization method, defaults to 'cartesian'
189+
:type method: str, optional
190+
"""
186191
self._Config.SetTableDiscretization(method)
187192
return
188193

@@ -201,6 +206,12 @@ def __LoadFluidData(self):
201206
return fluid_data_norm
202207

203208
def SetTableVars(self, table_vars_in:list[str]):
209+
"""Specify the thermophysical variables to be included in the table file. All quantities are included by default. The list shoud at least contain "Density" and "Energy".
210+
211+
:param table_vars_in: list with thermophysical variables to be included in the table.
212+
:type table_vars_in: list[str]
213+
:raises Exception: if any of the specified variables are not supported by SU2 DataMiner.
214+
"""
204215
self._table_vars = []
205216
if EntropicVars.Density.name not in table_vars_in:
206217
print("Density should always be included in table variables")
@@ -220,7 +231,7 @@ def SetTableVars(self, table_vars_in:list[str]):
220231
if EntropicVars.ViscosityDyn.name in table_vars_in:
221232
print("Table generator not configured for transport properties, ignoring viscosity data")
222233

223-
234+
valid_vars = True
224235
for v in table_vars_in:
225236
found_var = False
226237
for q in EntropicVars:
@@ -229,6 +240,9 @@ def SetTableVars(self, table_vars_in:list[str]):
229240
self._table_vars.append(q.name)
230241
if not found_var:
231242
print("Error, \"%s\" is not supported by SU2 DataMiner" % v)
243+
valid_vars = False
244+
if not valid_vars:
245+
raise Exception("Some specified thermophysical variables are not supported.")
232246
return
233247

234248
def __Compute2DMesh(self, points:np.ndarray[float], ref_pts:np.ndarray[float]=[],show:bool=False,sat_curve_pts:np.ndarray[float]=[]):
@@ -493,7 +507,7 @@ def __CalcMeshData(self, fluid_data_mesh:np.ndarray[float]):
493507
fluid_data_out = fluid_data_out[self.valid_mask,:]
494508
return fluid_data_out
495509

496-
# TODO: include derivative and transport validation methods
510+
# TODO: include derivative and transport validation methods
497511
def __CartesianTableData(self):
498512
print("Generating table on Cartesian grid")
499513
Np_rho = self._Config.GetNpDensity()
@@ -684,13 +698,7 @@ def WriteOutParaview(self,file_name_out:str="vtk_table"):
684698
"""
685699
write a file containing all the LuT data that can be opened with Paraview
686700
687-
:param connectivity: contains the node index of the created LuT
688-
:param data_nodes_2d: contains the LuT nodes
689-
:param MainFolder: string indicating the folder where all the outputs are saved
690-
:param outpath: string indicating the name and extension of the saved file
691-
:param x_vars: name of the variable that varies along the mesh x direction
692-
:param y_vars: name of the variable that varies along the mesh y direction
693-
:param variables: list of the saved variables, if None all the available variables are saved
701+
:param file_name_out: string indicating the name and extension of the saved file
694702
"""
695703

696704
#x, y = self._table_nodes[:, EntropicVars.Density.value], self._table_nodes[:, EntropicVars.Energy.value]

0 commit comments

Comments
 (0)