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
2
votes
1 answer

Two contour plots in single viewer- Python FiPy

I am trying to solve two independent variables varying geometrically over a given domain. I want to plot their variance in a single viewer display. How can I get two different contour plots one each for the independent variable in single viewer box?…
bvspavan89
  • 21
  • 1
1
vote
2 answers

defining a multivariate gaussian initial condition in FiPy

I'm trying to use a multivariate gaussian initial condition for a Fipy integration. I'm currently using the following code: from fipy import CellVariable, Grid2D, Viewer from scipy.stats import multivariate_normal import numpy as np import…
alxg
  • 368
  • 1
  • 4
  • 15
1
vote
0 answers

Is it possible to add source terms on outer boundaries only in FiPy?

Is it possible to solve a problem on the form where the source term is zero everywhere on the mesh except for at the boundaries, and how can this be represented in FiPy? I have an equation that I have so far solved in 1D with the source term set to…
jso
  • 23
  • 5
1
vote
1 answer

PDE system with variables of different dimensions - Porous electrode theory with FiPy

I'm trying to solve a system of four PDEs describing steady-state charge conservation in a porous electrode. The equations are ∇ ⋅1 + ∇ ⋅ 2 = 0, 1 = − ∇1, 2 = − ∇2, ∇ ⋅ 1 = rxn, or alternatively ∇ ⋅ 2 = -rxn. I want to use FiPy to solve these…
jso
  • 23
  • 5
1
vote
1 answer

Gmsh structured mesh (Hexahedron mesh) gets imported in unstructured way (tetrahedron) into Itasca PFC software using Fipy

I'm trying to import a 3D cylindrical CFD mesh into Itasca PFC7-3D software from Gmsh using Fipy. The mesh created in Gmsh environment is fully structured(hexahedron cells). However when I tried to import the mesh into Itasca I realized it is…
1
vote
0 answers

FiPy system of coupled non-linear PDEs - Error in convection coefficients

Edit: Problem is being discussed on Github(https://github.com/usnistgov/fipy/issues/883) I am currently learning how to model in FiPy. I am trying to reproduce a model from a paper on oxygen evolution in porous electrodes. I keep getting the error…
Bobber
  • 11
  • 2
1
vote
1 answer

How to make a diffusion from the center of the circle to the edge on gmsh? [python]

I am trying to simulate the diffusion of a nutrient in a tumor as a function of space and time on python using the gmsh tool. So I need the initial concentration to be in the center, then diffusivity to spread it outward. Here is the complete code,…
1
vote
1 answer

Can we find out which mesh a point belongs to in FiPy by searching with the coordinate?

I have two meshes defined in FiPY as follows: gmsh_mesh = fp.Gmsh2D("ProcessSim_CMOS_Step1.msh") from fipy.meshes.mesh2D import Mesh2D def extract_mesh(mesh, mask): cellFaceIDs = mesh.cellFaceIDs[..., mask] faceIDs =…
1
vote
2 answers

Can you create separate meshes in FiPy by reading "physical names" from Gmsh?

I have the following code representing a .geo file for Gmsh that I want to load in FiPy for process simulation. It contains: (i) Oxide, (ii) Silicon and (iii) Gas as physical entities that needs to identified as separate…
1
vote
1 answer

cellvariable*Diffusion in fipy

I am trying to solve the following coupled pde's in fipy. I tried the following eq1 = (DiffusionTerm(coeff=1, var=f)-f*DiffusionTerm(coeff=1, var=phi) +f-f**3 == 0) eq2 = (2*DiffusionTerm(coeff=f, var=phi)+f*DiffusionTerm(coeff=1, var=phi) …
1
vote
1 answer

Problem when importing a mesh with Gmsh3D in Fipy

I am trying to import to Fipy a 3D mesh previously generated with Gmsh using the Gmsh3D function, like this: mesh = Gmsh3D(join(output,'case_1.msh'),communicator=serialComm) I get the same error as other similar posts, but the proposed solutions do…
1
vote
1 answer

Fipy calcNormals function

I have a question regarding the calculation of the faceNormals in Fipy: It seems like the normal vector of each face point to the same direction except when the faces are at one of the extremities along the x-, y-, and z-axis of the grid (in which…
rbtlm640
  • 79
  • 5
1
vote
1 answer

Solving an elliptic PDE using FiPy

I'm trying to solve for an elliptic pde using FiPy and I'm running into some convergence problems. The equation I'm trying to solve is: \[ \frac{\partial^2 \alpha}{\partial x^2} = (\alpha -1)/L^2 \] where, L = f(x) and I'm using a tuple of dx…
Raqato
  • 13
  • 3
1
vote
1 answer

Fipy for 1D branched network

I wish to use Fipy for a network made of 1D branches. Does Fipy allow that kind of mesh? I have not been able to find a similar example. Thank you for your help.
rbtlm640
  • 79
  • 5
1
vote
1 answer

How to label axes in fipy.Viewer?

What would be the easiest way to label the x and y axes of a FiPy viewer? I specifically use the fipy.viewers.matplotlibViewer.matplotlib2DGridContourViewer.Matplotlib2DGridContourViewer. I tried giving the the parameter xlabel="some string" but…
1 2
3
14 15