RAStudy#
- class ansys.rocky.app.ra_study.RAStudy(id: str, model_id: str | None = None)#
Bases:
ansys.rocky.app.api_element_item.ApiElementItemRocky PrePost Scripting wrapper for a project’s Study.
This wrapper is the main access point for all other entities typically present in a Rocky project. Access the
RAStudyvia theRAProjectonce a project has been created or opened (more):project = app.GetProject() study = project.GetStudy()
The
RAStudyclass acts as a main hub of functionality, providing methods to perform various common actions related to simulations:Helper creation methods for simulation entities such as
CreateParticle(),CreateFeedConveyor(),ImportWall(), etc.Accessor methods for specialized PrePost Scripting wrapper objects such as
GetMaterialCollection(),GetPhysics(),GetSimulatorRun(), etc.Methods related to the simulation and its results, such as
StartSimulation(),StopSimulation(),DeleteResults(), etc.
Overview#
Check the current Study status |
Get the study customer name. |
|
Change the study customer’s name |
|
Get the study description. |
|
Change the study description |
|
Get a RAExportToolkit object related to this RAStudy. The returned object can be used |
|
Get the study’s Physics object. |
|
Get the study’s Motion Frame Source. |
|
Get the study’s Domain Settings. |
|
Get the study’s Geometry Collection. |
|
Get the geometry with the given name |
|
Create a particle in the study with default values. |
|
Create a particle inlet with the given entry_point and particle. |
|
Create an outlet with the given exit point. |
|
Creates a volumetric inlet with the given properties. |
|
Creates a new feed conveyor and add it to the project. |
|
Creates a new receiving conveyor and add it to the project. |
|
Import a geometry file and create one or more corresponding geometries in the study. |
|
Import a geometry file and create one or more corresponding geometries in the study. |
|
Import a custom surface file and create one or more corresponding geometries in the study. |
|
Given a filename finds all imported geometries created from it. |
|
Given a filename finds all imported geometries created from it. |
|
Replace the existing triangles of a geometry with new triangles. |
|
Remove walls associated with the given filename. |
|
Remove custom surfaces associated with the given filename. |
|
Get the study’s Material Collection. |
|
Get the study’s Particle Collection. |
|
Get the study’s Point Cloud Collection. |
|
Deprecated: Use |
|
Get the study’s Inlets and Outlets Collection. |
|
Get the project’s Calculations. |
|
Get the particle input with the given name. |
|
|
|
Get the study’s input reader. |
|
|
|
Get the current CFD coupling object. |
|
Get the RAAirFlow object (if applicable). |
|
Get the RAContactData object. |
|
Get the RAParticleJointsData object. |
|
|
|
Request an update in the the time steps available in the study. |
|
Get the process that generated the particle mesh. |
|
Get the process that contains the simulated particles. |
|
Set the restart subject |
|
|
|
Get the PrePost Scripting wrapper for simulation-related parameters. |
|
Synonym for |
|
Get the curve matching a given element name and curve name. |
|
Re-set the process part ids to None |
|
In addition to clearing the part ids, removes the possibility of “resuming” the simulation |
|
Re-set the particle and geometry processes to the default configuration when the source |
|
Creates, configure and set the restart subject to the current study. |
|
Whether we’re currently simulating something. |
|
Get the current simulation progress [0.00, 100.00] or None if no simulation is running. |
|
Whether we have results from a previous simulation. |
|
Whether the simulation can be resumed. |
|
Called to delete any results we currently have from a simulation. |
|
Called to refresh the results we currently have from a simulation. |
|
Start the simulation. If possible, will resume a previously interrupted simulation. |
|
Stops a currently running simulation. If there’s no simulation running, does nothing. |
|
Extend the simulation: either its duration, the duration of an inlet in the study or the |
|
Get the study’s timeset. |
|
Sets the values the given parametric variable |
|
Set the workbench data subject |
|
|
|
Get the name and the FEM Forces property for all available Boundary Collision Statistics |
|
Enable the Boundary Collision Statistics modules and enable/disable |
|
Checks wheter the Collision Statistics modules are colecting FEM Forces for analysis |
|
Checks whether HTC is being calculated. |
|
Get the study’s Module Collection. |
|
Enable/disable the Intra Particle Collision Statistics Module. |
|
Enable/disable the SPH HTC Calculator module. |
|
Get whether the Intra Particle Collision Statistics Module is enabled. |
|
Get the Meshed Particles Upscaling value. |
Import detail#
from ansys.rocky.app.ra_study import RAStudy
Attribute detail#
- RAStudy.customer_name: _typeshed.Incomplete#
- RAStudy.description: _typeshed.Incomplete#
Method detail#
- RAStudy.SetCustomerName(customer_name: str) None#
Change the study customer’s name
- Parameters:
customer_name – The customer name to be set
- RAStudy.SetDescription(description: str) None#
Change the study description
- Parameters:
description – The customer name to be set
- RAStudy.GetElement(element_name: str | None = None, type_name: str | None = None, raise_if_no_found: bool = True) ansys.rocky.app.api_element_item.ApiElementItem#
- RAStudy.GetSubjectElement(subject: coilib50.subject.Subject | str) ansys.rocky.app.api_element_item.ApiElementItem#
- RAStudy.GetExportToolkit() ansys.rocky.app.ra_export_toolkit.RAExportToolkit#
Get a RAExportToolkit object related to this RAStudy. The returned object can be used for export operations.
- RAStudy.GetPhysics() ansys.rocky.app.ra_physics.RAPhysics#
Get the study’s Physics object.
- RAStudy.GetMotionFrameSource() ansys.rocky.app.motion.ra_motion_frame_source.RAMotionFrameSource | None#
Get the study’s Motion Frame Source.
- Returns:
The motion frame source, used to deal with motion.
- RAStudy.GetDomainSettings() ansys.rocky.app.ra_domain_settings.RADomainSettings#
Get the study’s Domain Settings.
- RAStudy.GetSphSettings() ansys.rocky.app.ra_sph_settings.RASPHSettings#
- RAStudy.GetSphEulerianSolution() ansys.rocky.app.ra_sph_eulerian_solution.RASPHEulerianSolution#
- RAStudy.GetGeometryCollection() ansys.rocky.app.ra_geometry_collection.RAGeometryCollection#
Get the study’s Geometry Collection.
- RAStudy.GetGeometry(geometry_name: str) ansys.rocky.app.ra_wall.RAWall | None#
Get the geometry with the given name
- Returns:
The geometry with the given name
- RAStudy.CreateParticle() ansys.rocky.app.ra_particle.RAParticle#
Create a particle in the study with default values.
- RAStudy.CreateParticleInlet(entry_point: ansys.rocky.app.conveyors.ra_feed_conveyor.RAFeedConveyor | ansys.rocky.app.ra_inlet.RAInletGeometry | ansys.rocky.app.ra_surface.RASurface, particle: ansys.rocky.app.ra_particle.RAParticle) ansys.rocky.app.ra_particle_inlet.RAParticleInlet#
Create a particle inlet with the given entry_point and particle.
- Parameters:
entry_point – The input’s entry point - either a FeedConveyor or an Inlet.
particle – The particle that will enter through this input.
- RAStudy.CreateOutlet(exit_point: ansys.rocky.app.ra_base_geometry.RABaseGeometry) ansys.rocky.app.ra_outlet.RAOutlet#
Create an outlet with the given exit point.
- Parameters:
exit_point – The outlet’s exit point surface.
- RAStudy.CreateVolumetricInlet(particle: ansys.rocky.app.ra_particle.RAParticle | None = None, name: str | None = None, mass: float = 100.0, seed_coordinates: rocky30.base_types.Tuple3F | None = None, geometries: list[str | ansys.rocky.app.ra_wall.RAWall] | None = None, use_geometries_to_compute: bool = False, box_center: rocky30.base_types.Tuple3F | None = None, box_dimensions: rocky30.base_types.Tuple3F | None = None, use_box_center_as_seed_point: bool = False) ansys.rocky.app.ra_volumetric_inlet.RAVolumetricInlet#
Creates a volumetric inlet with the given properties.
- Parameters:
name – The name which will be used for the volume fill.
seed_coordinates – A point (x, y, z) in meters that will be the reference to start the filling process.
geometries – A list of names or RAWall selected in RAVolumetricInlet. The names or RAWall list must match the existent geometries.
use_geometries_to_compute – If true: the limits of the filling process will be the selected boundaries. If false: a cube must be defined to be the limits of the filling process.
box_center – A point (x, y, z) that will be the center of the limit cube.
dimensions – The dimensions (length, width, height) of the limit cube.
box_dimensions – The dimensions (lenght, width, height) of the limit cube.
use_box_center_as_seed_point – If true, the seed point will be set to the box center.
- RAStudy.CreateRectangularSurface() ansys.rocky.app.ra_rectangular_surface.RARectangularSurface#
- RAStudy.CreateCircularSurface() ansys.rocky.app.ra_circular_surface.RACircularSurface#
- RAStudy.CreateFeedConveyor() ansys.rocky.app.conveyors.ra_feed_conveyor.RAFeedConveyor#
Creates a new feed conveyor and add it to the project.
- RAStudy.CreateReceivingConveyor() ansys.rocky.app.conveyors.ra_receiving_conveyor.RAReceivingConveyor#
Creates a new receiving conveyor and add it to the project.
- RAStudy.ImportWall(custom_filename: str, import_scale: float = 1.0, convert_yz: bool = False, custom_name_prefix: str | None = None) list[ansys.rocky.app.ra_wall.RAWall]#
Import a geometry file and create one or more corresponding geometries in the study.
- Parameters:
custom_filename – The filename of the STL, DXF or XGL file to import.
import_scale – The import scale to be applied to the imported geometry.
convert_yz – Whether the y and z axes of the imported geometry should be converted.
- RAStudy.ImportSystemCouplingWall(custom_filename: str, import_scale: float = 1.0, convert_yz: bool = False, custom_name_prefix: str | None = None) list[ansys.rocky.app.ra_system_coupling_wall.RASystemCouplingWall]#
Import a geometry file and create one or more corresponding geometries in the study.
- Parameters:
custom_filename – The filename of the STL, DXF or XGL file to import.
import_scale – The import scale to be applied to the imported geometry.
convert_yz – Whether the y and z axes of the imported geometry should be converted.
- RAStudy.ImportSurface(custom_filename: str, import_scale: float = 1.0, convert_yz: bool = False, custom_name_prefix: str | None = None) list[ansys.rocky.app.ra_surface.RASurface]#
Import a custom surface file and create one or more corresponding geometries in the study.
- Parameters:
custom_filename – The filename of the STL, DXF or XGL file to import.
import_scale – The import scale to be applied to the imported geometry.
convert_yz – Whether the y and z axes of the imported geometry should be converted.
- RAStudy.ConvertToWall(geometries: list[ansys.rocky.app.ra_surface.RASurface | ansys.rocky.app.ra_system_coupling_wall.RASystemCouplingWall]) list[ansys.rocky.app.ra_wall.RAWall]#
- RAStudy.ConvertToSystemCouplingWall(geometries: list[ansys.rocky.app.ra_wall.RAWall]) list[ansys.rocky.app.ra_system_coupling_wall.RASystemCouplingWall]#
- RAStudy.ConvertToSurface(geometries: list[ansys.rocky.app.ra_wall.RAWall]) list[ansys.rocky.app.ra_surface.RASurface]#
- RAStudy.GetWallFromFilename(filename: str) list[ansys.rocky.app.api_element_item.ApiElementItem]#
Given a filename finds all imported geometries created from it.
- Parameters:
filename – The name of the file that originally created a set of geometries
- RAStudy.GetSurfaceFromFilename(filename: str) list[ansys.rocky.app.api_element_item.ApiElementItem]#
Given a filename finds all imported geometries created from it.
- Parameters:
filename – The name of the file that originally created a set of geometries
- RAStudy.ReplaceWallTriangles(new_filename: str, import_scale: float = 1.0, convert_yz: bool = False) None#
Replace the existing triangles of a geometry with new triangles.
It is assumed that there is a geometry corresponding to new_filename, previously imported. This method is used to update the triangles of the geometry, without creating new model entities.
This method only supports geometry files that contain a single object. This is true for all STL files, but XGL and DXF files generally support multiple objects per file - this method will raise a RuntimeError in this case.
- Parameters:
new_filename – The filename of the STL, DXF or XGL file with new triangle data.
import_scale – The import scale to be applied to the imported geometry.
convert_yz – Whether the y and z axes of the imported geometry should be converted.
- RAStudy.RemoveWall(filename: str) None#
Remove walls associated with the given filename.
- Parameters:
filename – The name of the filename associated with the current project walls
- RAStudy.RemoveSurface(filename: str) None#
Remove custom surfaces associated with the given filename.
- Parameters:
filename – The name of the filename associated with the current project custom surfaces
- RAStudy.GetRegionsOfInterestCollection() ansys.rocky.app.ra_regions_of_interest_collection.RARegionsOfInterestCollection#
- RAStudy.GetMaterialCollection() ansys.rocky.app.ra_materials_collection.RAMaterialCollection#
Get the study’s Material Collection.
- RAStudy.GetParticleCollection() ansys.rocky.app.ra_particle_collection.RAParticleCollection#
Get the study’s Particle Collection.
- RAStudy.GetPointCloudCollection() ansys.rocky.app.ra_point_cloud_collection.RAPointCloudCollection#
Get the study’s Point Cloud Collection.
- RAStudy.GetMaterialsInteractionCollection() ansys.rocky.app.ra_materials_interaction_collection.RAMaterialsInteractionCollection#
Deprecated: Use
RAMaterialCollection.GetMaterialsInteractionCollection()instead.
- RAStudy.GetInletsOutletsCollection() ansys.rocky.app.ra_inlets_outlets_collection.RAInletsOutletsCollection#
Get the study’s Inlets and Outlets Collection.
- RAStudy.GetCalculations() ansys.rocky.app.ra_calculations.RACalculations#
Get the project’s Calculations.
- RAStudy.GetParticleInput(input_name: str) ansys.rocky.app.ra_particle_inlet.RAParticleInlet#
Get the particle input with the given name.
- RAStudy.GetSourceForMeshProcesses() coilib50.process.IProcess#
- Returns:
Get the process in the associated study that should be used as source for mesh processes
- RAStudy.GetInputReader() petroapp10.plugins.entities.input_reader.input_reader_model.InputReader#
Get the study’s input reader. :return:
The input reader associated with the study.
- RAStudy.GetCFDCoupling() ansys.rocky.app.ra_cfd_coupling.RACFDCoupling#
Get the current CFD coupling object.
- Returns:
The CFDCoupling object
- RAStudy.GetAirFlow() ansys.rocky.app.ra_airflow.RAAirFlow | None#
Get the RAAirFlow object (if applicable).
- Returns:
The AirFlow object is configured as the CFD coupling mode None otherwise
- RAStudy.GetContactData() ansys.rocky.app.ra_contact_data.RAContactData#
Get the RAContactData object.
- Returns:
The contact data object.
- RAStudy.GetJointsData() ansys.rocky.app.ra_particle_joints_data.RAParticleJointsData#
Get the RAParticleJointsData object.
- Returns:
The joint statisctics data object.
- RAStudy.GetParticleMeshProcess() rocky30.process.particle.particle_mesh_process.ParticleMeshProcess#
Get the process that generated the particle mesh.
- Returns:
The particle mesh process associated with the current this study
:raise AssertionError if no process was found associated with this study.
- RAStudy.GetParticles() ansys.rocky.app.ra_particles_process.RAParticles#
Get the process that contains the simulated particles.
- Returns:
The particles process
- RAStudy.SetRestartSubject(restart_subject: rocky30.models.restart.simulation_restart_subject.SimulationRestartSubject) None#
Set the restart subject
- Parameters:
restart_subject – The subject with study restart information
- RAStudy.GetRestartSubject() rocky30.models.restart.simulation_restart_subject.SimulationRestartSubject#
- Returns:
The subject with study restart information
- RAStudy.GetSimulatorRun() ansys.rocky.app.ra_simulator_run.RASimulatorRun#
Get the PrePost Scripting wrapper for simulation-related parameters.
- RAStudy.GetSolver() ansys.rocky.app.ra_simulator_run.RASimulatorRun#
Synonym for
GetSimulatorRun().
- RAStudy.CreateSolidMaterialAndRelatedInteractions(material_name: str | None = None) ansys.rocky.app.ra_solid_material.RASolidMaterial#
- RAStudy.CreateFluidMaterial(material_name: str | None = None) ansys.rocky.app.ra_fluid_material.RAFluidMaterial#
- RAStudy.RemoveFluidMaterial(material_or_name: str | ansys.rocky.app.ra_fluid_material.RAFluidMaterial) None#
- RAStudy.GetElementCurve(element_name: str, curve_name: str, simulation_name: str | None = None, realization: str | None = None) sci20.plugins.api.api_curve.SciApiCurve#
Get the curve matching a given element name and curve name.
- Parameters:
element_name – unicode The name of the element
curve_name – unicode The name of the curve
simulation_name – unicode An optional parameter for defining the simulation to get the curve from.
realization – unicode An additional keyword to identify the curve realization
- Return type:
Curve
- Returns:
The curves for the given element and name.
- RAStudy.ResetSimulationStatus() None#
In addition to clearing the part ids, removes the possibility of “resuming” the simulation next.
- RAStudy.SetupRestartPartIds() None#
Re-set the particle and geometry processes to the default configuration when the source of the processes is a restart data.
In a restart there is only particle information, so the process is set to the default id and all the other are set to None.
- RAStudy.CreateRestartSubject(timestep_index: int, restart_filename: str) rocky20.simulator.RestartData#
Creates, configure and set the restart subject to the current study. The given time-step index defines the time to which the restart information will be create from.
- Parameters:
timestep_index – The time-step index to create the restart information
restart_filename – the filename to be set so the restart subject could write and read the data from
- Raises:
RestartValidationFailedException – If it cannot create a restart subject.
- RAStudy.GetProgress() float | None#
Get the current simulation progress [0.00, 100.00] or None if no simulation is running.
- RAStudy.DeleteResults()#
Called to delete any results we currently have from a simulation.
- RAStudy.RefreshResults()#
Called to refresh the results we currently have from a simulation.
- RAStudy.StartSimulation(skip_summary: bool | None = False, delete_results: bool | None = False, non_blocking: bool = False) bool#
Start the simulation. If possible, will resume a previously interrupted simulation. If you wish to start a simulation from scratch, delete previous results via DeleteResults() first.
- Parameters:
skip_summary (bool) – If starting from scratch, whether the simulation summary will be skipped (False) or presented to the user (True).
delete_results (bool) – True if the simulation results should be deleted, False otherwise. If there are no simulation results, this flag is ignored
non_blocking (bool) – If True, start the simulation asynchronously. Only works in headless mode (raises an error if otherwise).
- :return bool
Returns True if the simulation has started successfully, False otherwise.
- RAStudy.StopSimulation() None#
Stops a currently running simulation. If there’s no simulation running, does nothing.
- RAStudy.ExtendSimulation(extension_amount: float | barril.units.Scalar = 0, time: int | coilib50.time.time_step.TimeStep | None = None, inlet_extensions: ParticleInletExtensions | None = None, periodic_motion_extensions: PeriodicMotionExtensions | None = None) None#
Extend the simulation: either its duration, the duration of an inlet in the study or the duration of a periodic motion frame.
- Parameters:
extension_amount – The number of seconds to extend the simulation by.
time – The optional time at which to extend the simulation.
inlet_extensions – The list of input extensions. The first parameter of each pair must be the name of the continuous injection to extend, and the second is the number of seconds to extend the input by.
periodic_motion_extensions – the list of periodic motions extensions. The first parameter of each pair must be the name of the periodic motion to extend, and the second is the number of seconds to extend the periodic motion by.
- RAStudy.GetTimeSet() coilib50.time.time_set.TimeSet#
Get the study’s timeset.
Before simulation, the timeset will contain the timesteps used in motion preview.
After simulation, the timeset will contain the actual simulation timesteps.
- RAStudy.SetVariable(name: str, value: float) None#
Sets the values the given parametric variable
- Parameters:
name – The name of the variable
value – The value to be set
- classmethod RAStudy.GetStatus(include_opengl_messages: bool = False) Status#
Check the current Study status
- Parameters:
include_opengl_messages – Whether messages related to OpenGL should be included in the status.
- Returns:
Returns a list of subject names and the existing status as a list of tuples with the message type and description
- RAStudy.SetWorkbenchData(workbench_data: rocky30.models.workbench.workbench_data_subject.WorkbenchData) None#
Set the workbench data subject
- Parameters:
workbench_data – The subject with study workbench information
- RAStudy.GetWorkbenchData() rocky30.models.workbench.workbench_data_subject.WorkbenchData#
- Returns:
The subject with study workbench information
- RAStudy.GetFEMForcesAnalysisModules(module_collection: ansys.rocky.app.ra_addins.RAModuleCollection) dict[str, str]#
Get the name and the FEM Forces property for all available Boundary Collision Statistics modules
- Parameters:
module_collection (RAModuleCollection) – The study’s Module Collection
- Return Dict[str, str]:
A Dict with the Module Name and the FEM Forces property name
- RAStudy.SetCollectForcesForFemAnalysis(value: bool) None#
Enable the Boundary Collision Statistics modules and enable/disable the FEM Forces analysis
- Parameters:
value (bool) – Wheter to enable or disable the modules
- RAStudy.GetCollectForcesForFemAnalysis() bool#
Checks wheter the Collision Statistics modules are colecting FEM Forces for analysis
- Return bool:
True if the Collect FEM Forces property of any Collision Statistics module is enabled
- RAStudy.HasCalculatedHTC() bool#
Checks whether HTC is being calculated.
- Return bool:
True if HTC is being calculated.
- RAStudy.GetModuleCollection() ansys.rocky.app.ra_addins.RAModuleCollection#
Get the study’s Module Collection.
- RAStudy.SetIntraParticleCollisionStatistics(value: bool) None#
Enable/disable the Intra Particle Collision Statistics Module.
Note: This shortcut method enables/disables _all_ properties related to that Module.
- Parameters:
value