Species model#

Setting up and querying the model#

>>> import ansys.fluent.core as pyfluent
>>> solver_session = pyfluent.Solver.from_install()
>>> solver_session.settings.file.read_case(file_name=file_name)
>>> species = pyfluent.solver.Species(settings_source=solver_session)
>>> species.get_state()
{'model': {'option': 'off', 'number_vol_spec': False}}
>>> from pprint import pprint
>>> pprint(species.model.option.allowed_values(), width=1)
['off',
 'species-transport',
 'non-premixed-combustion',
 'premixed-combustion',
 'partially-premixed-combustion',
 'pdf-transport']
>>> species.model.option.set_state("species-transport")
>>> pprint(species.get_state(), width=1)
{'model': {'material': 'mixture-template',
           'number_vol_spec': 3,
           'option': 'species-transport'},
 'options': {'diffusion_energy_source': True,
             'inlet_diffusion': False,
             'multi_component_diffusion': False,
             'save_gradients': False,
             'species_transport_expert': False,
             'thermal_diffusion': False},
 'reactions': {'enable_volumetric_reactions': False},
 'species_transport_expert_options': {'blending': False,
                                      'linearize_convection_source': False,
                                      'linearize_diffusion_source': False}}
>>> species.model.material.get_state()
'mixture-template'
>>> species.model.material.allowed_values()
['mixture-template', 'air-2species-nitrogen', 'air-5species-park93', ...]  # plus 40+ more predefined mixtures