Skip to content

Commit aa149ff

Browse files
committed
python interface updates for radiation models
1 parent 79ba386 commit aa149ff

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

interfaces/cython/cantera/_onedim.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ cdef extern from "cantera/oneD/Boundary1D.h":
8080
cdef extern from "cantera/oneD/Flow1D.h":
8181
cdef cppclass CxxFlow1D "Cantera::Flow1D" (CxxDomain1D):
8282
void setTransportModel(const string&) except +translate_exception
83+
void setRadiationModels(const string&, const string&) except +translate_exception
8384
string type()
8485
string transportModel()
8586
void setPressure(double)

interfaces/cython/cantera/_onedim.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,20 @@ cdef class FlowBase(Domain1D):
790790
y.push_back(t)
791791
self.flow.setFixedTempProfile(x, y)
792792

793+
def set_radiation_models(self, property_model, solver_model="OpticallyThin"):
794+
"""
795+
Set radiation property and solver models for this flow domain.
796+
797+
Parameters
798+
----------
799+
property_model : str
800+
Name of the property calculator model. Examples include
801+
"TabularPlanckMean", "RadLib.PlanckMean", "RadLib.WSGG", "RadLib.RCSLW".
802+
solver_model : str, optional
803+
Name of the radiation solver model. Defaults to "OpticallyThin".
804+
"""
805+
self.flow.setRadiationModels(stringify(property_model), stringify(solver_model))
806+
793807
def get_settings3(self):
794808
"""
795809
Temporary method returning new behavior of settings getter.

interfaces/cython/cantera/onedim.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ def boundary_emissivities(self, epsilon):
258258
raise ValueError("Boundary emissivities must both be set at the same time.")
259259
self.flame.boundary_emissivities = epsilon[0], epsilon[1]
260260

261+
def set_radiation_models(self, property_model, solver_model="OpticallyThin"):
262+
"""
263+
Set the radiation property and solver models.
264+
265+
Examples
266+
--------
267+
>>> f.set_radiation_models("TabularPlanckMean", "OpticallyThin")
268+
>>> f.set_radiation_models("RadLib.WSGG") # solver defaults to OpticallyThin
269+
"""
270+
self.flame.set_radiation_models(property_model, solver_model)
271+
261272
@property
262273
def grid(self):
263274
""" Array of grid point positions along the flame. """

0 commit comments

Comments
 (0)