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

doc changes #51

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ following environment variable that specifies the location of your Ansys License

Twin Runtimes dependencies
--------------------------
The ``pytwin`` package allows users to easily execute deployment workflows based on ``.twin`` files generated by `Ansys Twin Builder <https://www.ansys.com/products/digital-twin/ansys-twin-builder>`_, which are generally constituted based on several types of different models (system level models, ROMs, 3rd party FMUs,...). Each of these models may have specific runtime dependencies (e.g. Modelica models cross-compiled with Ansys Twin Deployer on Ubuntu 20.04 have a dependency on libgfortran5). When executing the Twin Runtimes through ``pytwin`` on a specific environment, it is therefore important that all the dependencies of the Twin Runtimes, including the ones of their constitutive models, are properly installed and made available in that environment.
The ``pytwin`` package allows users to easily execute deployment workflows based on ``.twin`` files generated by `Ansys Twin Builder <https://www.ansys.com/products/digital-twin/ansys-twin-builder>`_, which are generally made up of several types of models (system level models, ROMs, 3rd party FMUs,...). Each of these models may have specific runtime dependencies (e.g. Modelica models cross-compiled with Ansys Twin Deployer on Ubuntu 20.04 have a dependency on libgfortran5). When executing the Twin Runtimes through ``pytwin`` on a specific environment, it is therefore important that all the dependencies of the Twin Runtimes, including the ones of their constitutive models, are properly installed and made available in that environment.

Install the package
-------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ to programmatically interact with, and control the execution of Twin Runtimes.

Features
--------
Some of the many features in the PyTwin package,, ``pytwin``,
Some of the many features in the PyTwin package, ``pytwin``,
allow you to:

- Use the Twin Runtimes Core SDK to build your own consumption workflows based on atomic API calls, see :ref:`ref_index_api_sdk`
Expand Down
4 changes: 2 additions & 2 deletions examples/evaluate/00-coupledClutches.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def plot_result_comparison(step_by_step_results: pd.DataFrame, batch_results: pd
data_index += 1
results_step_pd = pd.DataFrame(sim_output_list_step, columns=["Time"] + list(twin_model.outputs), dtype=float)

# ##############################################################################
###############################################################################
# Batch simulation mode
# ~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Resetting/re-initializing the Twin and running it in batch mode (i.e. passing
# all the input data, simulating all the data points, and collecting all
# the outputs at once)
Expand Down
25 changes: 13 additions & 12 deletions examples/evaluate/01-electricRange.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@

twin_file = download_file("ElectricRange_23R1_other.twin", "twin_files")

###############################################################################
# User inputs
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Defining user inputs and simulation settings

time_step = 1.0
time_end = 24000.0 # simulating the model for 400 minutes
dp1 = {"ElectricRange_powerLoad": 2000.0, "ElectricRange_vehicleMass": 2000.0}
dp2 = {"ElectricRange_powerLoad": 3000.0, "ElectricRange_vehicleMass": 2000.0}
dp3 = {"ElectricRange_powerLoad": 2000.0, "ElectricRange_vehicleMass": 1500.0}
sweep = [dp1, dp2, dp3]

###############################################################################
# Auxiliary functions definition
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -108,6 +96,19 @@ def plot_result_comparison(results: list[pd.DataFrame], sweep: list[dict]):
print("Loading model: {}".format(twin_file))
twin_model = TwinModel(twin_file)

###############################################################################
# User inputs
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Defining user inputs and simulation settings

time_step = 1.0
time_end = 24000.0 # simulating the model for 400 minutes
print("Twin parameters : {}".format(twin_model.parameters))
dp1 = {"ElectricRange_powerLoad": 2000.0, "ElectricRange_vehicleMass": 2000.0}
dp2 = {"ElectricRange_powerLoad": 3000.0, "ElectricRange_vehicleMass": 2000.0}
dp3 = {"ElectricRange_powerLoad": 2000.0, "ElectricRange_vehicleMass": 1500.0}
sweep = [dp1, dp2, dp3]

###############################################################################
# Parametric sweep over the different design points
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions examples/evaluate/02-heatExchangerRS.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def plot_result_comparison(results: pd.DataFrame):
# Evaluating the Twin with different input values and collecting the corresponding outputs
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Since the Twin is based on a static model, 2 different options can be considered :
#
# - setting the initial input value to evaluate and run the initialization function (current approach)
# - create an input dataframe considering all the input values to evaluate and run the evaluate batch function
# (in that case, a time dimension needs to be defined arbitrarily to execute the transient simulation)
Expand Down
3 changes: 1 addition & 2 deletions examples/evaluate/03-scalarDROM.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def plot_result_comparison(step_by_step_results: pd.DataFrame, what_if: pd.DataF
for column in twin_model_input_df.columns[1::]:
inputs[column] = (
twin_model_input_df[column][data_index] * 0.9
) # the second Twin will be evaluated using same
# inputs reduced by 10%
) # the second Twin will be evaluated using same inputs reduced by 10%
twin_model_what_if.evaluate_step_by_step(step_size=step, inputs=inputs)
outputs = [twin_model_what_if.evaluation_time]
for item in twin_model_what_if.outputs:
Expand Down
4 changes: 2 additions & 2 deletions examples/evaluate/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ These examples show how to use the evaluation workflow given a twin file. This i
- parametric sweep of dynamic model,
- parametric response surface ROM evaluation,
- scalar dynamic ROM simulation with state saving and loading,
- field ROM evaluation and results visualization,
- field ROM evaluation and transfer of results as inputs for FEA calculation
- field ROM evaluation and results visualization from the runtime and post processed in Fluent,
- field ROM evaluation and transfer of results as inputs for Mechanical stress analysis