SplitFDM
1D Finite-Difference with adaptive mesh refinement and steady-state solver using Newton and Split-Newton approach
What does 'split' mean?
The system is divided into two and for ease of communication, let's refer to first set of variables as "outer" and the second as "inner".
-
Holding the outer variables fixed, Newton iteration is performed till convergence using the sub-Jacobian
-
One Newton step is performed for the outer variables with inner held fixed (using its sub-Jacobian)
-
This process is repeated till convergence criterion is met for the full system (same as in Newton)
How to install and execute?
Just run
pip install splitfdm
There is an examples folder that contains a test model - Advection-Diffusion
You can define your own equations by simply creating a derived class from Model and adding to the _equations using existing or custom equations!
A basic driver program is as follows
# Define the problem
m = AdvectionDiffusion(c=0.2, nu=0.001)
# Define the domain and variables
# ng stands for ghost point count
d = Domain.from_size(20, 2, ["u", "v", "w"]) # nx, ng, variables
# Set IC and BC
ics = {"u": "gaussian", "v": "rarefaction"}
bcs = {
"u": {
"left": "periodic",
"right": "periodic"
},
"v": {
"left": {"dirichlet": 3},
"right": {"dirichlet": 4}
},
"w": {
"left": {"dirichlet": 2},
"right": "periodic"
}
}
s = Simulation(d, m, ics, bcs)
# Advance in time or to steady state
s.evolve(dt=0.1)
bounds = [[-1., -2., 0.], [5., 4., 3.]]
iter = s.steady_state(split=True, split_loc=1, bounds=bounds)
# Visualize
draw(d, "label")
Whom to contact?
Please direct your queries to gpavanb1 for any questions.
Acknowledgements
Do visit its Finite-Volume cousin
Special thanks to Cantera and WENO-Scalar for serving as an inspiration for code architecture.
Metadata
Release files for SplitFDM 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SplitFDM-0.2.tar.gz | 14.0 kB | Without provenance | Details for SplitFDM-0.2.tar.gz |
Release files / SplitFDM-0.2.tar.gz
| Download URL | SplitFDM-0.2.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
974c1207520106945df3874467bc8a9b701ebbecf6c7785994a59d7629dd6bc2
|
|
BLAKE2b-256 checksum How to use checksums |
157ecdbc84a2f0414c7a8b6c3701755f4171c566fe346fa19a140baa1591fb17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.1
|
Security for SplitFDM 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.