Questions tagged [fipy]

FiPy: A Finite Volume PDE Solver Using Python. FiPy is an object oriented, partial differential equation (PDE) solver, written in Python, based on a standard finite volume (FV) approach.

FiPy: A Finite Volume PDE Solver Using Python. FiPy is an object oriented, partial differential equation (PDE) solver, written in Python, based on a standard finite volume (FV) approach.

The framework has been developed in the Materials Science and Engineering Division (MSED) and Center for Theoretical and Computational Materials Science (CTCMS), in the Material Measurement Laboratory (MML) at the National Institute of Standards and Technology (NIST).

The solution of coupled sets of PDEs is ubiquitous to the numerical simulation of science problems. Numerous PDE solvers exist, using a variety of languages and numerical approaches. Many are proprietary, expensive and difficult to customize. As a result, scientists spend considerable resources repeatedly developing limited tools for specific problems.

Our approach, combining the FV method and Python, provides a tool that is extensible, powerful and freely available. A significant advantage to Python is the existing suite of tools for array calculations, sparse matrices and data rendering.

The FiPy framework includes terms for transient diffusion, convection and standard sources, enabling the solution of arbitrary combinations of coupled elliptic, hyperbolic and parabolic PDEs.

Currently implemented models include phase field [BoettingerReview:2002] [ChenReview:2002] [McFaddenReview:2002] treatments of polycrystalline, dendritic, and electrochemical phase transformations as well as a level set treatment of the electrodeposition process [NIST:damascene:2001].

Source:http://www.ctcms.nist.gov/fipy/index.html

216 questions
1
vote
1 answer

FiPy 2D Navier Stokes implementation: problem with derivatives in one direction

I am trying to implement the example from https://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/14_Step_11.ipynb, but I am facing some problems. I think that the main problem is that I am having some issues with the boundary…
Toni P
  • 47
  • 5
1
vote
1 answer

FiPy Hollow cylidrical O'Grid 3D growing sweep meshing [CylindricalGrid2D]

I would be grateful if anyone could help me to solve the following questions, How could change code 'mesh = CylindricalGrid2D(dr, dz, Lr, Lz)' for 'dr' gradual increase from the inside toward outside of the Hollow cylinder wall. What does ' +…
Ali_Sh
  • 2,667
  • 3
  • 43
  • 66
1
vote
0 answers

1-D semiconductor device simulation: the problem of facevalue

I am modelling a 1-D semiconductor device using time steps and sweeps. Basic equations are continuty equations and Possion’s equation: dn/dt = Dn(E) * d2n/dx2 + velocity_n (E)dn/dx+S(p,n,E,t) dp/dt = Dp(E) * d2p/dx2 + velocity_p…
Daixing
  • 11
  • 1
1
vote
1 answer

how to express the nonlinear anisotropic coeff of convection term

The term I want to express is a part of N-S equation. u,v are the component of flow velocity Is the following code correct? u = CellVariable(mesh=mesh,hasOld=1,value=0.0) v = CellVariable(mesh=mesh,hasOld=1,value=0.0) coeff_con =…
1
vote
1 answer

1D-Coupled Transient Diffusion in FiPY with Reactive Boundary Condition

I would like to solve the transient diffusion equation for two compounds A and B as shown in image. I think the image is a better way to show my problem. Diffusion equations and boundary conditions. As you can see, the reaction only occurs at the…
Ali
  • 11
  • 1
1
vote
1 answer

Python pde solution using fipy gives value error

I am trying to solve a pde using the fipy package in python. The code that I have written for the same has been attached. !pip install fipy from fipy import * mesh= Grid2D(nx=0.001,dx=100,ny=0.0005,dy=100) phil=CellVariable(name='Sol…
Anweshan
  • 29
  • 6
1
vote
1 answer

Default boundary condition implementation for 1D diffusion equation equation in FiPy

I am trying to solve a 1D heat transfer equation using FiPy. The documentation states that If no boundary conditions are specified on exterior faces, the default boundary condition is equivalent to a zero gradient If I want to apply a zero gradient…
1
vote
1 answer

Boundary conditions for stokes flow around a sphere using FiPy

I have tried to solve the Stokes flow around a sphere using FiPy. To do that, I chose a cylindrical 2-D mesh (since my problem is axisymmetric). The z-axis passes through the center of the sphere, and the size of the mesh is Lr x Lz. The boundary…
1
vote
1 answer

Point coordinates error in importing 3D mesh generated from gmsh into fipy

Help with gmsh file import to fipy, I have readed all the questions regarding gmsh and fipy on this forum, but unfortunately I didn't find a similar error. I am importing a 3D mesh generated by gmsh 3.0.6 (as recommanded) into FiPy (3.3). I am…
ethanyang
  • 11
  • 1
1
vote
1 answer

ValueError when running "examples.diffusion.mesh20x20"

I'm just getting started with FiPy and thus looked at the examples. However, when running the "examples.diffusion.mesh20x20" I get the following error: --------------------------------------------------------------------------- ValueError …
Julian
  • 13
  • 2
1
vote
1 answer

How to access gmsh code from python after importing mesh into Fipy?

I have generated a gmsh mesh that I imported into FiPy via Gmsh2D. I would like to adress the surface Faces to set boundary conditions but I did not know how to. In FiPy examples I found in the documentation it is suggested to name certain lines to…
mcghgb
  • 25
  • 1
  • 5
1
vote
1 answer

Is there a reference for the numerical schemes used to describe the convection terms?

I just found the numerical schemes for describing the convective terms, which are used in FiPy (https://www.ctcms.nist.gov/fipy/documentation/numerical/scheme.html). I am currently implementing similar schemes for solving convective problems. I…
NBauer
  • 11
  • 1
1
vote
1 answer

Specifying a custom Fipy boundary condition of an "L" shaped geometry

I want to solve a heat diffusion problem with an "L-shape" geometry, defined by the code below: from fipy import CellVariable, Gmsh2D, TransientTerm, DiffusionTerm from fipy import Matplotlib2DViewer, Viewer from fipy.tools import…
Cjdkwq
  • 13
  • 2
1
vote
1 answer

How to output a .pvd or xdmf file from FiPy

From the example documentation, there is the following section: FiPy doesn’t plot or output anything unless you tell it to: if __name__ == "__main__": viewer = Viewer(vars=(phi,), datamin=0., datamax=1.) I understand that the current…
Pavan Inguva
  • 65
  • 1
  • 7
1
vote
1 answer

Dirac delta Source Term in Fipy

I would like to know how to represent the Dirac delta function as source term in Fipy. I want to solve the following equation I have tried the following code from fipy import * nx = 50 ny = 1 dx = dy = 0.025 # grid spacing L = dx * nx mesh =…
Mafeni Alpha
  • 308
  • 2
  • 13