The modelling library for the simulation modelling language Solverz
Project description
SolMuseum
This library encapsulates the common simulation models for Solverz-based simulation modelling. It is just required that one inputs the model parameters and then the simulation model instances are initialized without having to derive them symbolically and jit-compile the case-specified numerical codes, which saves the computation overhead.
All the models that have been implemented can be found in the docs with mathematical derivations.
Installation
SolMuseum requires python>=3.10, and can be installed locally with
pip install SolMuseum
Usage Example
For example, we want to perform the finite difference of the heat pipe with the Yao's scheme. The illustrative code
We can just import the heat_pipe class from SolMuseum.pde, input the parameters and set the method to be 'yao'.
The finite difference equations are automatically derived and added to the Model instance.
snippet is
import numpy as np
from Solverz import Var, Param, Model
from SolMuseum.pde import heat_pipe
# modelling
L = 9250
dx = 370
M = int(L / dx)
Tinitial = np.zeros(M + 1)
lam = 1 / 0.35
Cp = 4182
Ta = -10
D = 1.4
S = np.pi * (D / 2) ** 2
rho = 960
Tamb = -10
for i in range(0, len(Tinitial)):
fai = np.exp(-lam * i * dx / (Cp * np.abs(2543.5)))
Tinitial[i] = 90.1724637976347 * fai + Ta * (1 - fai)
m = Model()
m.T = Var('T', Tinitial)
m.m = Param('m', 10)
m.lam = Param('lam', lam)
m.rho = Param('rho', rho)
m.S = Param('S', S)
m.Tamb = Param('Tamb', Tamb)
m.Cp = Param('Cp', Cp)
m.dt = Param('dt', 180)
m.__dict__.update(heat_pipe(m.T,
m.m,
m.lam,
m.rho,
m.Cp,
m.S,
m.Tamb,
dx,
m.dt,
M,
'1',
method='yao'))
For reproducible codes of each model, please refer to the test folders, which can serve as the detailed tutorials.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solmuseum-0.1.2.tar.gz.
File metadata
- Download URL: solmuseum-0.1.2.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6ea08c39c5859902088c7658f34695dbbb964c2947f27f7ed30c589d487359b
|
|
| MD5 |
4209e46263c5dcf0561de66dcd70ed3c
|
|
| BLAKE2b-256 |
9f307ea38d77c6a9bfc1e2d4c959668738145c4dfc431cf99af5186ed067541d
|
Provenance
The following attestation bundles were made for solmuseum-0.1.2.tar.gz:
Publisher:
publish-to-pypi.yml on smallbunnies/SolMuseum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solmuseum-0.1.2.tar.gz -
Subject digest:
e6ea08c39c5859902088c7658f34695dbbb964c2947f27f7ed30c589d487359b - Sigstore transparency entry: 155159503
- Sigstore integration time:
-
Permalink:
smallbunnies/SolMuseum@f7be1cb55aff5148e8d111ad464ca036be9966ec -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/smallbunnies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f7be1cb55aff5148e8d111ad464ca036be9966ec -
Trigger Event:
push
-
Statement type:
File details
Details for the file SolMuseum-0.1.2-py3-none-any.whl.
File metadata
- Download URL: SolMuseum-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50eec29064dbc8b260dc7abd1e471c809312da1bf7fde046d5cecad5f6604155
|
|
| MD5 |
e4635ca019c214a91a9e19c56836540f
|
|
| BLAKE2b-256 |
d6863bb76d10c6b09a58ff2ba807ba585c90ab66b517aabdf1e9f7b3b54529e9
|
Provenance
The following attestation bundles were made for SolMuseum-0.1.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on smallbunnies/SolMuseum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solmuseum-0.1.2-py3-none-any.whl -
Subject digest:
50eec29064dbc8b260dc7abd1e471c809312da1bf7fde046d5cecad5f6604155 - Sigstore transparency entry: 155159504
- Sigstore integration time:
-
Permalink:
smallbunnies/SolMuseum@f7be1cb55aff5148e8d111ad464ca036be9966ec -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/smallbunnies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f7be1cb55aff5148e8d111ad464ca036be9966ec -
Trigger Event:
push
-
Statement type: