1D Finite-Volume Split Newton Solver
Project description
SplitFVM
1D Finite-Volume 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 splitfvm
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 cell count
d = Domain.from_size(nx=20, ng=2, ["u", "v"])
# Set IC and BC
ics = {"u": "gaussian", "v": "rarefaction"}
bcs = {
"u": {
"left": "periodic",
"right": "periodic"
},
"v": {
"left": {"dirichlet": 3},
"right": {"dirichlet": 4}
}
}
s = Simulation(d, m, ics, bcs)
# Advance in time or to steady state
s.evolve(dt=0.1)
iter = s.steady_state()
# Visualize
draw(d)
Whom to contact?
Please direct your queries to gpavanb1 for any questions.
Acknowledgements
Do visit its Finite-Difference cousin
Special thanks to Cantera and WENO-Scalar for serving as an inspiration for code architecture
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
File details
Details for the file SplitFVM-0.1.1.tar.gz
.
File metadata
- Download URL: SplitFVM-0.1.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5910ede76132143cb11a803986bb61105e395027a97c0e7e1bf23c7a77e85272 |
|
MD5 | f22f741ec377f72a5228aeb4fee54b96 |
|
BLAKE2b-256 | f181e9e6529ffb6a0b5e2a0947375f64e940f2c5516e3536e539b67c222ebe2c |
File details
Details for the file SplitFVM-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: SplitFVM-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e6ca149e9a9c3566a3255198d87f92adfb00346ebf073ad97a5cd9b2a8696a |
|
MD5 | bc969fc89d355f7dfef89541dbd78249 |
|
BLAKE2b-256 | b4b57ef6ef2ebe995f3a5cbf5a2cb8db99e371de96f43440184a4bf16ddd4097 |