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

What is the formula for computing residual in fipy?

I know that we can get the residual if use 'sweep' to solve the equation, but what is the formula for computing residual in fipy? Is it the difference between the two sides of the equation? And why the residual of my equation decrease very slowly?…
0
votes
1 answer

What difference method does the default ConvectionTerm take?

I want to know which difference method the default ConvectionTerm uses in fipy, upwind difference or central difference or else? Thank you for your help.
0
votes
1 answer

Is the updateOld pushes the time forwar?

Like the following code, I know time does not push forward in the 'while', and time pushes forward in the 'for'. In addtion, updateOld can set the values of the previous solution sweep to the current values. Does updateOld also inform the sweep to…
0
votes
1 answer

Using internal constraint feature in fipy

I am a newbie to fipy. I am trying to solve the following set of coupled pdes ( variables are p,n and psi) using fipy :- qDn∇2n − qun∇.(n∇ψ) = q(n-10**11)/10**(-6), in Domain 1 qDp∇2p + qup∇.(p∇ψ) = -q(p-10**21)/10**(-6), in Domain 1 e∇2ψ = −(p − n-…
Anweshan
  • 29
  • 6
0
votes
1 answer

Coupling pdes across various domains using fipy

I am completely new to fipy. I am trying to solve the following set of pdes across two different domains using fipy. The variables are p,n and ψ and q,Dn,Dp,un,up,e and N are all constants. N and e change values from domain 1 to domain 2. Domain 2…
Anweshan
  • 29
  • 6
0
votes
1 answer

Solving pde in python with implicit source terms

I want to solve the following set of 3 coupled pdes in python using fipy ∇2n − (∇2ψ)n − (∇ψ).∇n = n/10, ∇2p + (∇2ψ)p + (∇ψ).∇p = p/10, ∇2ψ = −(p − n) The variables are p,n and ψ. As can be seen from the first and second equation, the first term…
Anweshan
  • 29
  • 6
0
votes
1 answer

Surface integration over the surface of a unit sphere

I am trying to solve an equation over the surface of a sphere, which is very similar to the Cahn-Hilliard problem on the surface of a sphere. I have created the mesh as described in the Cahn-Hilliard problem. But how to calculate the total…
0
votes
1 answer

Tube Fipy 3D sweep meshing

I would like to sweep_like 3D meshing a hollow cylinder, is there any mesh modules in Fipy for this?? how to aim this goal by Fipy or other libraries in python?
Ali_Sh
  • 2,667
  • 3
  • 43
  • 66
0
votes
1 answer

FIPY: problem with Grid2D cellToFaceDistanceVectors gives error 'UniformGrid2D' object has no attribute '_cellToFaceDistanceVectors'

I create a mesh using Grid2D as follows L = 2. N = 50 dL = L/N mesh = Grid2D(nx=N, ny=N, dx=dL, dy=dL) but when I try to get the cell to face distance vector: mesh.cellToFaceDistanceVectors the following error appears: AttributeError …
0
votes
1 answer

Cylindrical 2D grids in FiPy

I have read here that gradient calculations do not work properly for cylindrical 2D grids, because of discretization erros. Does that mean that DiffusionTerm and/or other terms in FiPy are also broken for cylindrical 2D grids? Or is it just the…
0
votes
1 answer

surface area of any gmsh model imported to fipy

I would like to calculate the shell surface of any mesh imported into fipy via gmsh similar to cell Volumes: sum(mesh.cellVolumes) So far i have located the outside Faces with: f = FaceVariable(mesh=mesh,value=False, name='Aussen') …
mcghgb
  • 25
  • 1
  • 5
0
votes
1 answer

Which is the latest supported version of gmsh in fipy module?

It seems to me that FiPys support for Gmsh relies upon which version of FiPy is installed which sounds reasonable. Where can I find the information about which version of gmsh is still supported in which version of fipy so I won't have to figure out…
mcghgb
  • 25
  • 1
  • 5
0
votes
1 answer

+/- viewer initialisation in fipy with try, except over simply initializing it

In the example from the fipy documentation the following code is used to "create a Viewer to see the mesh": viewer = None if __name__ == '__main__': try: viewer = Viewer(vars=phi, datamin=-1, datamax=1.) viewer.plotMesh() …
mcghgb
  • 25
  • 1
  • 5
0
votes
1 answer

Boundary constrain leads to internal loop, what happens here and why?

My Script ceases to work for my easy conduction problem. Could somebody explain to me why the following line of code T.faceValue.constrain(alp/lam*(Tu-T.faceValue),where=mesh.exteriorFaces) # Boundary Condition for Solver results in fipy giving up…
mcghgb
  • 25
  • 1
  • 5
0
votes
1 answer

method for cells adjacent/connected to vertex in fipy?

Is there such a function or easy method? The only functions I have found so far are mesh.vertexCoords and mesh.faceVertexIDs but I couldn't figure quit out if they might help me.
mcghgb
  • 25
  • 1
  • 5