Skip to content

Instantly share code, notes, and snippets.

@guyer
guyer / fipy_Binary_Electrolyte.ipynb
Last active June 17, 2019 19:40
electrolyte notebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
$ nix-shell --pure --argstr python_version 37
these derivations will be built:
/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv
/nix/store/wn2znfqwss14pnzqmcp5zl77i0a636c3-hook.drv
/nix/store/f765d9hw19g85bgxh14dfc6pzxjci1fj-python3.7-setuptools-40.8.0.drv
/nix/store/llccrlnyxj6z1xpqhpqi9f3mm7zsak5y-python3.7-bootstrapped-pip-19.0.3.drv
/nix/store/26k6qs8hpb45k1szhiyq8xj7wva73h18-python3.7-pip-19.0.3.drv
/nix/store/7j7pa5i9gdzf8kg7aka11235qylsqg8h-python3.7-setuptools_scm-3.2.0.drv
/nix/store/0269q5xiv84v27rgjj97kvqy21m407p1-python3.7-pluggy-0.8.1.drv
/nix/store/b1pi73bf3f8x9cpvgbl0id792wi1bilx-python3.7-attrs-18.2.0.drv
@guyer
guyer / zeroflux.py
Last active March 5, 2020 20:34
Heat flux in FiPy with zero flux
##CREATING DATAFRAMES FOR SURFACE TEMPERATURE AND LITHOLOGY PROPERTIES
#SURFACE TEMPERATURE
import numpy as np
import pandas as pd
m = 10 #multiplyer; used so that if we want to run the model over a longer time only one value has to be changed
time = 800 * m #in real time should be over 800.000 years
@guyer
guyer / Dirichlet.ipynb
Last active March 6, 2020 20:29
Derivation of FiPy Dirichlet condition in 1D
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guyer
guyer / MOSCAP.ipynb
Created June 11, 2020 22:16
Attempt to solve MOSCAP problem posed in https://github.com/usnistgov/fipy/issues/731
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guyer
guyer / fitter.ipynb
Created September 1, 2020 18:00
FiPy example of fitting a diffusion coefficient
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guyer
guyer / Constraints&BCs.ipynb
Last active January 11, 2021 16:40
Illustration of applying boundary conditions in FiPy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guyer
guyer / desiccantwheel.py
Last active September 9, 2021 13:11
Troubleshooting usnistgov/fipy#816
# Paramaters from the Table 3.1: Transport and thermophysical properties of the adsorbent wheel tested.
T_ci = 24.0 # °C Exhaust Value in the simulation
T_hi = 90.0 # °C Inlet Value in the simulation
omega_ci = 0.012 # kg_w kg_as^-1 Exhaust Value in the simulation
omega_hi = 0.021 # kg_w kg_as^-1 Inlet Value in the simulation
lambda_d = 0.24/1000 # kW m^-1 K^-1
N = 0.5 # rpm
rho_d = 630 # kg m^-3
delta = 0.3/1000 # m
qst = 2650 # kJ kg^-1
from fipy import Grid1D, CellVariable,TransientTerm, DiffusionTerm, Viewer
from fipy.tools import numerix
nx = 100
Lx = 1.
mesh = Grid1D(nx=nx, Lx=Lx)
u1 = CellVariable(name = "solution variable u1", hasOld=True, mesh = mesh, value = 0.)
u2 = CellVariable(name = "solution variable u2", hasOld=True, mesh = mesh, value = 0.)
@guyer
guyer / LICENSE.md
Last active March 12, 2023 10:07
Demonstration of using shapely to create FiPy mesh and check point containment in different domains

Terms of Use

This software was developed by employees of the [National Institute of Standards and Technology][NIST] [NIST][NIST], an agency of the Federal Government and is being made available as a public service. Pursuant to [title 17 United States Code Section 105][17USC105], works of [NIST][NIST] employees are not subject to copyright protection in the United States. This software may be subject to foreign copyright. Permission in the United States and in foreign countries, to the extent that [NIST][NIST] may hold copyright, to use, copy, modify, create derivative works, and distribute this software and its