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

Role of eqn3 in Fipy examples.cahnHilliard.mesh2DCoupled

I am currently working through the examples in the fipy documentation and am trying to adapt the examples.cahnHilliard.mesh2DCoupled to perform some simulations. The link is :…
Pavan Inguva
  • 65
  • 1
  • 7
0
votes
1 answer

How to add zero-flux boundary conditions to a mesh generated in gmsh Fipy?

I am trying to solve the Meinhart model in a mesh created by gmsh in Fipy. However, I am not sure how to add zero flux-boundary conditions. Below, you can find my code. I would like to know if the lines: #u.constrain(0,…
Irbin B.
  • 382
  • 3
  • 18
0
votes
1 answer

Q: 'UnboundLocalError': local variable 'exitErr' referenced before assignment

I want to use the PDE Solver Fipy in the Spyder IDE and tried installing it according to the official installation guide: Now it is suggested to run fipy.test() before using the package and here the following error appeared. File…
mcghgb
  • 25
  • 1
  • 5
0
votes
1 answer

FiPy convection with a given velocity field

I'm using FiPy to model convection/diffusion of a chemical in a given velocity field, and I'm having problems setting this field as ConvectionTerm coefficient. My velocity field is expressed by two bidimensional arrays, let's say Ugrid for…
fede_
  • 65
  • 4
0
votes
0 answers

How to judge the value on the specified boundary and then assign a new value to the specified boundary?

I am a newbie for Fipy. I'm dying to know how to judge the value on the specified boundary and then assign a new value to the specified boundary conditions?" I creat a CellVariable"psi", and a specified boudary "BSCfaces". I'd like to apply a new…
Liu
  • 3
  • 2
0
votes
1 answer

datamin and datamax in Viewer() did not work

I used the above code in the fipy, but the range of color bar is always not changed( always showed [-1,1]). My version is Python 3.6.7 and matlablib 3.1.1. #create a viewer to see the results if __name__ == '__main__': viewer =…
Liu
  • 3
  • 2
0
votes
1 answer

Memory leak using fipy with trilinos

I am currently trying to simulate a suspension flowing around a cylindrical obstacle using fipy. Because I'm using fine mesh and my equations are quite complicated, the simulations take quite a long time to converge. Which is why I want to run them…
0
votes
1 answer

Parallel and sequential runs give different results in FiPy when using periodic mesh

I have run the following code to simulate a flow around a cylinder in a 2D mesh: from fipy import CellVariable, FaceVariable, Grid2D, DiffusionTerm, ImplicitSourceTerm, PeriodicGrid2DTopBottom, DistanceVariable, Viewer from fipy.tools import…
0
votes
1 answer

stokesCavity example for FiPy returns False

I have tried to run the stokesCavity example, which uses lid-driven boundary conditions for the flow. At the end of the code, the values in the top-right cell are compared with some reference values. >>>…
0
votes
1 answer

mesh1D.py example in FiPy fails if run in parallel

I downloaded FiPy months ago and this week I decided to test its parallel feature. So I tried to run the mesh1D.py example I got from github using $ mpirun -np 2 python examples/diffusion/mesh1D.py Two viewers pop up, each solving half of the…
0
votes
1 answer

How to represent source terms depending on position and time in Fipy python

I have the following partial differential equation I would like to know how I can represent the source term in Fipy python. I have tried the following from fipy import * nx = 50 ny = 1 dx = dy = 0.025 # grid spacing L = dx *…
Mafeni Alpha
  • 308
  • 2
  • 13
0
votes
1 answer

How to represent third order derivative in Fipy

I would like to know how I can represent the third derivate term: In Fipy python. I know that the diffusion term is represented as DiffusionTerm(coeff=D) and higher order diffusion terms as DiffusionTerm(coeff=(Gamma1, Gamma2)) But can not…
Mafeni Alpha
  • 308
  • 2
  • 13
0
votes
1 answer

Force variable to be non-negative in Fipy

I am currently using a sweep loop to solve a differential equation (eq0) with respect to my cell variable phi using FiPy in python. Because my equation is non-linear, I am using a sweep loop as shown in an extract of my code below. while res0 >…
0
votes
1 answer

Diffusion Reaction pde with nonlinear source term / Potential Term

my first attempt to write a couple diffusion reaction equations with FiPy. My equations are for three different concentrations c_i, just with the diffusion part and source (LateX input): \partial_t c_1 = \nabla \cdot (D_1 \nabla c_1) + A_1 c_{1} +…
KristaQ
  • 13
  • 4
0
votes
2 answers

Problems with Version Gmsh (version >=2) and Fipy

I am new in FiPy and I have problems with the example: examples.diffusion.circle: https://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.circle.html I get the error: EnviromentError: Gmsh version must be >=2.0 I tried…
KristaQ
  • 13
  • 4