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

Research direct settings object instantiation #3119

Open
seanpearsonuk opened this issue Jul 22, 2024 · 0 comments · Fixed by #3127
Open

Research direct settings object instantiation #3119

seanpearsonuk opened this issue Jul 22, 2024 · 0 comments · Fixed by #3127
Assignees

Comments

@seanpearsonuk
Copy link
Collaborator

Research the possibility of code like this:

>>> import ansys.fluent.core as pf
>>> from ansys.fluent.core import viscous, boundary_condition, boundary_conditions, velocity_inlet
>>> solver = pf.launch_fluent()
>>> visc = viscous(solver=solver)
>>> viscous_model = visc.model
>>> viscous_model.get_state()
>>> cold_inlet = boundary_condition(solver=solver, name = "cold-inlet")
>>> cold_inlet.get_state()
>>> cold_inlet2 = velocity_inlet(solver=solver, name = "cold-inlet")
>>> bc_group = boundary_conditions(solver=solver)

We can discuss what is meant here in terms of implementation. The idea is that groups that allow access like boundary_conditions["<name>"] should generate a singular class so that they can be instantiated via the singular name, which is more natural. Note also that the broader name boundary_condition makes senses as the type to use because the zone_type can always be set. Ideally, you want to be able to call set_zone_type() without invalidating the Python object. The other problem is that set_zone_type() is agroupl-level method anyway, so that if you were to call cold_inlet.set_zone_type() you would still have to qualify the call with the name of self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Prioritised
Development

Successfully merging a pull request may close this issue.

2 participants