SplitFVM


NameSplitFVM JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/gpavanb1/SplitFVM
Summary1D Finite-Volume Split Newton Solver
upload_time2024-04-28 06:38:25
maintainerNone
docs_urlNone
authorgpavanb1
requires_pythonNone
licenseMIT
keywords amr newton python finite-volume armijo optimization pseudotransient splitting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SplitFVM

[![Downloads](https://pepy.tech/badge/splitfvm)](https://pepy.tech/project/splitfvm)

![img](https://github.com/gpavanb1/SplitFVM/blob/main/assets/logo.jpg)

1D [Finite-Volume](https://en.wikipedia.org/wiki/Finite_volume_method) with [adaptive mesh refinement](https://en.wikipedia.org/wiki/Adaptive_mesh_refinement) and steady-state solver using Newton and [Split-Newton](https://github.com/gpavanb1/SplitNewton) 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](https://github.com/gpavanb1/SplitFVM/examples) folder that contains a test model - [Advection-Diffusion](https://en.wikipedia.org/wiki/Convection%E2%80%93diffusion_equation)

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](http://github.com/gpavanb1)
for any questions.

## Acknowledgements

Do visit its [Finite-Difference](https://github.com/gpavanb1/SplitFDM) cousin

Special thanks to [Cantera](https://github.com/Cantera/cantera) and [WENO-Scalar](https://github.com/comp-physics/WENO-scalar) for serving as an inspiration for code architecture


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gpavanb1/SplitFVM",
    "name": "SplitFVM",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "amr newton python finite-volume armijo optimization pseudotransient splitting",
    "author": "gpavanb1",
    "author_email": "gpavanb@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f1/81/e9e6529ffb6a0b5e2a0947375f64e940f2c5516e3536e539b67c222ebe2c/SplitFVM-0.1.1.tar.gz",
    "platform": null,
    "description": "# SplitFVM\n\n[![Downloads](https://pepy.tech/badge/splitfvm)](https://pepy.tech/project/splitfvm)\n\n![img](https://github.com/gpavanb1/SplitFVM/blob/main/assets/logo.jpg)\n\n1D [Finite-Volume](https://en.wikipedia.org/wiki/Finite_volume_method) with [adaptive mesh refinement](https://en.wikipedia.org/wiki/Adaptive_mesh_refinement) and steady-state solver using Newton and [Split-Newton](https://github.com/gpavanb1/SplitNewton) approach\n\n## What does 'split' mean?\n\nThe 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\".\n\n* Holding the outer variables fixed, Newton iteration is performed till convergence using the sub-Jacobian\n\n* One Newton step is performed for the outer variables with inner held fixed (using its sub-Jacobian)\n\n* This process is repeated till convergence criterion is met for the full system (same as in Newton)\n\n## How to install and execute?\n\nJust run \n```\npip install splitfvm\n```\n\nThere is an [examples](https://github.com/gpavanb1/SplitFVM/examples) folder that contains a test model - [Advection-Diffusion](https://en.wikipedia.org/wiki/Convection%E2%80%93diffusion_equation)\n\nYou can define your own equations by simply creating a derived class from `Model` and adding to the `_equations` using existing or custom equations!\n\nA basic driver program is as follows\n```\n# Define the problem\nm = AdvectionDiffusion(c=0.2, nu=0.001)\n\n# Define the domain and variables\n# ng stands for ghost cell count\nd = Domain.from_size(nx=20, ng=2, [\"u\", \"v\"])\n\n# Set IC and BC\nics = {\"u\": \"gaussian\", \"v\": \"rarefaction\"}\nbcs = {\n    \"u\": {\n        \"left\": \"periodic\",\n        \"right\": \"periodic\"\n    },\n    \"v\": {\n        \"left\": {\"dirichlet\": 3},\n        \"right\": {\"dirichlet\": 4}\n    }\n}\ns = Simulation(d, m, ics, bcs)\n\n# Advance in time or to steady state\ns.evolve(dt=0.1)\niter = s.steady_state()\n\n# Visualize\ndraw(d)\n```\n\n## Whom to contact?\n\nPlease direct your queries to [gpavanb1](http://github.com/gpavanb1)\nfor any questions.\n\n## Acknowledgements\n\nDo visit its [Finite-Difference](https://github.com/gpavanb1/SplitFDM) cousin\n\nSpecial thanks to [Cantera](https://github.com/Cantera/cantera) and [WENO-Scalar](https://github.com/comp-physics/WENO-scalar) for serving as an inspiration for code architecture\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "1D Finite-Volume Split Newton Solver",
    "version": "0.1.1",
    "project_urls": {
        "Bug Reports": "https://github.com/gpavanb1/SplitFVM/issues",
        "Homepage": "https://github.com/gpavanb1/SplitFVM",
        "Source": "https://github.com/gpavanb1/SplitFVM/"
    },
    "split_keywords": [
        "amr",
        "newton",
        "python",
        "finite-volume",
        "armijo",
        "optimization",
        "pseudotransient",
        "splitting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4b57ef6ef2ebe995f3a5cbf5a2cb8db99e371de96f43440184a4bf16ddd4097",
                "md5": "bc969fc89d355f7dfef89541dbd78249",
                "sha256": "56e6ca149e9a9c3566a3255198d87f92adfb00346ebf073ad97a5cd9b2a8696a"
            },
            "downloads": -1,
            "filename": "SplitFVM-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bc969fc89d355f7dfef89541dbd78249",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 17331,
            "upload_time": "2024-04-28T06:38:24",
            "upload_time_iso_8601": "2024-04-28T06:38:24.341750Z",
            "url": "https://files.pythonhosted.org/packages/b4/b5/7ef6ef2ebe995f3a5cbf5a2cb8db99e371de96f43440184a4bf16ddd4097/SplitFVM-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f181e9e6529ffb6a0b5e2a0947375f64e940f2c5516e3536e539b67c222ebe2c",
                "md5": "f22f741ec377f72a5228aeb4fee54b96",
                "sha256": "5910ede76132143cb11a803986bb61105e395027a97c0e7e1bf23c7a77e85272"
            },
            "downloads": -1,
            "filename": "SplitFVM-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f22f741ec377f72a5228aeb4fee54b96",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12869,
            "upload_time": "2024-04-28T06:38:25",
            "upload_time_iso_8601": "2024-04-28T06:38:25.568010Z",
            "url": "https://files.pythonhosted.org/packages/f1/81/e9e6529ffb6a0b5e2a0947375f64e940f2c5516e3536e539b67c222ebe2c/SplitFVM-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 06:38:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gpavanb1",
    "github_project": "SplitFVM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "splitfvm"
}
        
Elapsed time: 0.26263s