You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The settings API calls to create new mixtures for the species transport model should be made consistent with that of the materials change/create API. Currently, it is not possible to create new mixtures without resorting to TUI commands.
💡 Steps for implementing the feature
These are the changes that would need to be implemented, as far as I can tell at this time:
Create a settings API method to copy a mixture from Fluent's database, similar to copy_by_name() for species. Currently, the only non-GUI way is to execute /define/materials/change-create in the TUI.
Allow new mixtures to be created from an empty dictionary by executing root.setup.materials.mixture['my-mixture'] = {} in the same way that you can for species (this currently throws an error: Creating new mixture with empty dictionary breaks mixture API #2274). mixture-template could be used as the default for any empty fields.
Allow new mixtures to be created by calling root.setup.materials.mixture.create() on them, to replicate the same behavior as seen for fluids and solids.
🔗 Useful links and references
No response
The text was updated successfully, but these errors were encountered:
Thanks @ansjsia. I did spend a tiny bit of time trying this myself. I loaded up a single phase case without the species model activated and found the following:
#
# Copy the materials in from the database to make a custom mixture (this works)
#
solver.setup.materials.database.copy_by_name(name="methane", type="fluid")
solver.setup.materials.database.copy_by_name(name="propane", type="fluid")
#
# Turn on species, it works but it also deletes the materials I just copied in from the database
#
solver.setup.models.species.model.option = "species-transport"
#
# Copy the materials again, this seems to work ok
#
solver.setup.materials.database.copy_by_name(name="methane", type="fluid")
solver.setup.materials.database.copy_by_name(name="propane", type="fluid")
#
# Make handles to the newly copied materials
#
methane = solver.setup.materials.fluid["methane"]
propane = solver.setup.materials.fluid["propane"]
#
# Now try and make a mixutre out of those two, this does not work.
#
# This gives that error message and leaves a mixture called 'comgas' in the group
# with three materials: water-vapor, oxygen and nitrogen
#
solver.setup.materials.mixture["comgas"] = { "meth" : methane, "prop" : propane }
RuntimeError: Key 'meth' is invalid
#
# I'm able to delete the incorrectly configured mixture
#
>>> solver.setup.materials.mixture.delete(name_list=["comgas"])
#
# Tried creating like this but it also does not work
#
>>> solver.setup.materials.mixture["comgas"].species.volumetric_species = { "meth" : methane, "prop" : propane }
KeyError: 'comgas is not an allowed Settings objects name.\n'
#
# Tried this to get a blank setup but it also does not work. You get the material with
# three components: water-vapor, nitrogen and oxygen
#
solver.setup.materials.mixture["comgas"] = {}
So, it's not really clear to me how this is supposed to be working. Related to this are #2016 and #2259.
📝 Description of the feature
The settings API calls to create new mixtures for the species transport model should be made consistent with that of the materials change/create API. Currently, it is not possible to create new mixtures without resorting to TUI commands.
💡 Steps for implementing the feature
These are the changes that would need to be implemented, as far as I can tell at this time:
volumetric_species.delete()
method (Error in deleting species from mixture template (species transport) #2259), so that existing species in a mixture can be deleted. Currently, it is only possible to add species.copy_by_name()
for species. Currently, the only non-GUI way is to execute/define/materials/change-create
in the TUI.root.setup.materials.mixture['my-mixture'] = {}
in the same way that you can for species (this currently throws an error: Creating new mixture with empty dictionary breaks mixture API #2274).mixture-template
could be used as the default for any empty fields.root.setup.materials.mixture.create()
on them, to replicate the same behavior as seen for fluids and solids.🔗 Useful links and references
No response
The text was updated successfully, but these errors were encountered: