Skip to main content

Python API for using CENOS applications

Project description

CENOS Python package

This is a simple package that allows to interface with the cenos backend via a python API.

Quick-start

Install this package

pip install cenos-py

How it works

While you use CENOS normally using the GUI, most of your actions are written out to a logs/python_trace_script.py file inside of the case itself. It will look something like this:

from cenos_py import CenosCase, setCenosLocation

setCenosLocation(r"C:\source\cenos")

case = CenosCase("INDUCTION")
case.set_pre_processor('geomWizard', load_recent=True)
case.update_template_shape_type(1, 'workpieceTube')
case.update_template_property(1, 'diameter3', 32)
case.update_template_property(1, 'diameter4', 10)
case.update_tab_property('simulation', 'tend', 3)
case.update_tab_property('simulation', 'isAdaptive', True)
case.assign_group_material('workpiece', 'alloy_34Cr4')
case.update_physics_property('physicsThermal', 'boundary', 'workpiece_surface', 'hr', 0.9)
case.entered_meshing_window()
case.set_meshing_global_density('rough')
case.set_meshing_grading_surface(0.29)
case.set_meshing_domain_element_size('workpiece', 2)
case.set_meshing_domain_skin_layer('workpiece', True, 4.6, 10, 1.4)
case.generate_mesh()
case.calculate()

You can use this code in your script to create a CENOS case from scratch for every run.

(Recommended) Alternatively you can use a script that simply opens an existing case and modifies only the variables that you wish to control, for example:

from pathlib import Path

from cenos_py import CenosCase, setCenosLocation

setCenosLocation(r"C:\Users\user\AppData\Local\Programs\CENOS Induction Heating beta")

case = CenosCase("INDUCTION")

your_case_path = r"C:\Users\rp\CENOS\your_case"

for i in [20, 30, 40, 50]:
    case.open(your_case_path)

    # Create a copy first
    case.save_case_as(r"C:\Users\rp\CENOS\your_case_{i}")

    case.update_template_property(1, "workpiece_height", i)
    case.calculate()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cenos_py-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cenos_py-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file cenos_py-0.1.1.tar.gz.

File metadata

  • Download URL: cenos_py-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cenos_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 772c8180557e0c42db025c1342aa5a96b06813a8b6423e8d712c227fa695032f
MD5 3903eb69c682771675714601dfab3d7f
BLAKE2b-256 3c93bb4da9b17557e12a5dd63e3a50c346ad3bb915e20dc7c7f49e1ee7951867

See more details on using hashes here.

Provenance

The following attestation bundles were made for cenos_py-0.1.1.tar.gz:

Publisher: release.yaml on CENOS-Platform/cenos-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cenos_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cenos_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cenos_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 066a94e98cad178696fd3198d2fc38040dafb369388523f889018e3068bf6624
MD5 4b7a3752a69edbb36fad9c71a048b327
BLAKE2b-256 c69678fb69023a35b7483a29a18183174d65c57b8c9fe7f1d5fd3d432c1c82b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cenos_py-0.1.1-py3-none-any.whl:

Publisher: release.yaml on CENOS-Platform/cenos-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page