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

How to declare two dimensional boundaries using Fipy

I am trying to reproduce Matlab example https://se.mathworks.com/help/matlab/math/solve-system-of-pdes.html using FiPy. However, I am unable to reproduce the Matlab results (I am newbie when using Fipy). I think the problem is probably in function…
0
votes
1 answer

Define a non-cartesian mesh in fipy

I am trying to simulate the elementary unit of a 2D system that have a P6mm symmetry in fipy and I would like to define a non-cartesian mesh that describes the system described below. Yet, mesh = fipy.Grid2D(nx = 10, ny = 10, dx = 1., dy = 1.) only…
HcN
  • 177
  • 1
  • 7
0
votes
1 answer

How to add latent heat term in FiPy?

I have been trying to simulate Two Temperature Model using fipy the math of the model: C_e(∂T_e)/∂t=∇[k_e∇T_e ]-G(T_e-T_ph )+ A(r,t) C_ph(∂T_ph)/∂t=∇[k_ph∇T_ph] + G(T_e-T_ph) the source supposed to heat the electrons T_e, then the heat transferred…
Salah
  • 3
  • 3
0
votes
2 answers

Runtime error: Factor is exactly singular

I am trying to implement 2 temperature models, the following equations: C_e(∂T_e)/∂t=∇[k_e∇T_e ]-G(T_e-T_ph )+ A(r,t) C_ph(∂T_ph)/∂t=∇[k_ph∇T_ph] + G(T_e-T_ph) Code from fipy.tools import numerix import scipy import fipy import numpy as np from…
Salah
  • 3
  • 3
0
votes
2 answers

FiPy: How to find node (vertex) at interface between two mesh

I've defined two meshes in FiPy via Gmsh and would like to find the nodes at the interface between the two mesh. Is there a way to do this in FiPy? siliconGeometry = ''' SetFactory("OpenCASCADE"); //set node spacing ns = 1e-1; ns2 = 1e-2; x1 = 0; y1…
0
votes
2 answers

FIPY Solving a PDE coupled with an ODE

I have a coupled set of equations where the main PDE (function of time and position z) is given as: The second equation is of the type: where k_m = f(q) and q^* = f(c). As you can see the second equation is an ODE (no dependence of q on space…
0
votes
1 answer

Variable dependent flux boundary condition in fipy

I have a case where reaction flux is present at a boundary and flux is proportional to the concentration variable c. Will the following correctly apply the boundary condition: c.faceGrad.constrain(k*c.faceValue, mesh.physicalFaces["ReactingFace"]);
DKS
  • 188
  • 10
0
votes
1 answer

How to avoid Stack-overflow error in Fipy PDE solver?

I am trying to solve a 1D PDE coupled with an ODE (solved as explicit Euler). I am getting a stack-overflow error if I use small dt. I tried looking at the length of the stack but cannot figure out anything useful from there. I am not very…
Deb S. B.
  • 78
  • 8
0
votes
1 answer

Adapting FiPy's Flow.stokesCavity example to a 1D scenario

I have, as suggested, attacked my 1d compressible flow using Stokes Cavity example in FiPy (I really want to use FiPy for that model). But it still doesn't work. During sweeping, I get the error "The coefficient must be rank 0 for a rank 0 solution…
petesing
  • 13
  • 3
0
votes
1 answer

incorrect mass balance with 2D mesh network fipy

I wish to represent a diffusion in a 2D network (diffusion coefficient dependent on the value of phi) and a set phi input rate in a specific cell (so not a BC on a face). This seems like a very simple scenario, however, I must be doing something…
rbtlm640
  • 79
  • 5
0
votes
0 answers

FiPy set of equations diverging. Suggestions?

I have tried to simplify my set of PDEs: In this new set, p and m are my variables, where all the other values are constant. The m and p values in fc²m|m|/2DA²p are treated ass mean values on each cell. Furthermore I want to fix the inlet mass flow…
petesing
  • 13
  • 3
0
votes
1 answer

Variable constrain in FiPy

I have an equation, solved using FiPy, where my results are stored in a matrix result --> result[t][-1] indicates the outlet value (1D mesh) in time t I would like to use this outlet value as an inlet value (constrain) in another equation. Note that…
petesing
  • 13
  • 3
0
votes
1 answer

How to implement this PDE system in FiPy?

I'm solving a system of PDEs using FiPy which involves integration terms. However, the integration term is not allowed in FiPy. Can someone help me with this system?System of PDE
0
votes
1 answer

Writing couple of PDE equations and solving them in FiPy

I am a beginner in FiPy and I am currently trying to solve the equations of the image. It represents a compressible isothermal 1D flow. As boundary conditions, let's say that density rho is constant in the outlet (right), while u is constant in the…
petesing
  • 13
  • 3
0
votes
2 answers

OpenFOAM blockMesh cylindrical mesh and its paraFoam plotting face normals

OpenFOAM section: I have meshed a hollow cylinder shape in OpenFOAM. In this model, flow will be flow from outer cylinder wall to the inner cylinder wall; Right-Hand law is used for meshing points as below: I have tried to plot face normals by…
Ali_Sh
  • 2,667
  • 3
  • 43
  • 66