Re: Fluid Dynamic Basics
Thanks Daniel. I have to admit, I'm a bit surprised that these types of problems are a challenge in FiPy, but I appreciate the information. On Thu, Aug 29, 2019 at 3:06 PM Daniel Wheeler wrote: > Hi Daniel, > > Solving the flow equations isn't easy and we certainly don't provide > much guidance on how to solve them with FiPy. We do have the Stokes > cavity example [1] and reactive wetting example [2], which might be a > good place for you to start. The Stokes cavity example demonstrates > the simple algorithm [3] which basically turns the continuity equation > into an equation that solves for pressure. However, this becomes more > complicated if the convection terms are included in the momentum > equation. > > I have solved compressible flow problems with FiPy for my research. > FWIW, I have code for this, see [4, 5]. However, I don't think that > the code is much use to you other than as a reference for what is > possible with FiPy given enough persistence. > > You might also want to try Dolfyn [6]. It might have an example that > you can use right out of the box. > > Cheers, > > Daniel > > [1]: > https://www.ctcms.nist.gov/fipy/examples/flow/generated/examples.flow.stokesCavity.html > [2]: > https://www.ctcms.nist.gov/fipy/examples/reactiveWetting/generated/examples.reactiveWetting.liquidVapor1D.html#module-examples.reactiveWetting.liquidVapor1D > [3]: https://en.wikipedia.org/wiki/SIMPLE_algorithm > [4]: https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec2d > [5]: https://journals.aps.org/pre/abstract/10.1103/PhysRevE.82.051601 > [6]: https://www.dolfyn.net/index_en.html > > On Thu, Aug 29, 2019 at 10:33 AM Daniel DeSantis > wrote: > > > > Hello to the FiPy Team: > > > > I was recently reviewing some old work and thinking of converting it > over to FiPy and realized that, while I had done some successful work in > FiPy (with your assistance several times), there are a few gaps in my > knowledge of how to apply FiPy to some CFD type problems. I apologize for > asking questions you may feel are clear in your guide, but I am trying to > learn how to use your awesome program a bit better so I don't have to keep > asking questions. > > > > I'm essentially looking at coupling the continuity equation for a fluid > with the equations for motion or the equations of change. So, we start with > this: > > > > \nabla(\rho*v) = -\frac{\partial \rho}{\partial t} > > > > But frequently I have a steady state situation in which: > > \nabla(\rho*v) = 0 > > > > In either case, I'm not sure how the continuity equation up in FiPy. Do > you have any suggestions? Should I set up multiple convection terms like > this: > > > > PowerLawConvectionTerm(coeff=rho, var = v_x) + > PowerLawConvectionTerm(coeff=rho, var = v_y) + > PowerLawConvectionTerm(coeff=rho, var = v_z) = 0 > > > > Similarly, we have momentum equations as: > > > > \nabla(\rho v_x) = -\frac{\partial{P}}{\partial x} +\rho g_x + \mu > \nabla^2v_x > > > > \nabla(\rho v_y) = -\frac{\partial{P}}{\partial y} +\rho g_y + \mu > \nabla^2v_y > > > > \nabla(\rho v_z) = -\frac{\partial{P}}{\partial z} +\rho g_z + \mu > \nabla^2v_z > > > > I frequently am able to ignore the \rho g_i term but if I didn't, I > believe I could treat this as a source term in Fipy, and simply add it to > my equation. I understand how to do the diffusion and convection terms, > from your guides. > > > > However, I don't know what to do with the pressure term. I don't usually > have a consistent pressure in all dimensions so I would think that the > pressure term should be a cell variable, but I don't know how to add it. I > tried treating it as P.faceGrad, but I get errors. I've tried it as a > PowerLawConvectionTerm, and I don't seem to get a result. Perhaps the > problem is with the continuity equation? > > > > As a sort of classic example, I've uploaded a code that describes two > plates with a fluid in between. In it, fluid is flowing between two plates. > The bottom plate is stationary, the top one is moving. There's a pressure > difference over the length of the plates. It's at steady state, but I'll > probably end up playing with it as a non-steady state system eventually. > I've tried it before, and perhaps I'm graphing it incorrectly, but it seems > like it just presents a steady state solution. > > > > If I've got this completely wrong, could you suggest how to set up a > continuity equation coupled with a momentum equation and, perhaps how to > handle a first order differential term like the pressure gra
Fluid Dynamic Basics
Hello to the FiPy Team: I was recently reviewing some old work and thinking of converting it over to FiPy and realized that, while I had done some successful work in FiPy (with your assistance several times), there are a few gaps in my knowledge of how to apply FiPy to some CFD type problems. I apologize for asking questions you may feel are clear in your guide, but I am trying to learn how to use your awesome program a bit better so I don't have to keep asking questions. I'm essentially looking at coupling the continuity equation for a fluid with the equations for motion or the equations of change. So, we start with this: \nabla(\rho*v) = -\frac{\partial \rho}{\partial t} But frequently I have a steady state situation in which: \nabla(\rho*v) = 0 In either case, I'm not sure how the continuity equation up in FiPy. Do you have any suggestions? Should I set up multiple convection terms like this: PowerLawConvectionTerm(coeff=rho, var = v_x) + PowerLawConvectionTerm(coeff=rho, var = v_y) + PowerLawConvectionTerm(coeff=rho, var = v_z) = 0 Similarly, we have momentum equations as: \nabla(\rho v_x) = -\frac{\partial{P}}{\partial x} +\rho g_x + \mu \nabla^2v_x \nabla(\rho v_y) = -\frac{\partial{P}}{\partial y} +\rho g_y + \mu \nabla^2v_y \nabla(\rho v_z) = -\frac{\partial{P}}{\partial z} +\rho g_z + \mu \nabla^2v_z I frequently am able to ignore the \rho g_i term but if I didn't, I believe I could treat this as a source term in Fipy, and simply add it to my equation. I understand how to do the diffusion and convection terms, from your guides. However, I don't know what to do with the pressure term. I don't usually have a consistent pressure in all dimensions so I would think that the pressure term should be a cell variable, but I don't know how to add it. I tried treating it as P.faceGrad, but I get errors. I've tried it as a PowerLawConvectionTerm, and I don't seem to get a result. Perhaps the problem is with the continuity equation? As a sort of classic example, I've uploaded a code that describes two plates with a fluid in between. In it, fluid is flowing between two plates. The bottom plate is stationary, the top one is moving. There's a pressure difference over the length of the plates. It's at steady state, but I'll probably end up playing with it as a non-steady state system eventually. I've tried it before, and perhaps I'm graphing it incorrectly, but it seems like it just presents a steady state solution. If I've got this completely wrong, could you suggest how to set up a continuity equation coupled with a momentum equation and, perhaps how to handle a first order differential term like the pressure gradient? Thank you, -- Daniel DeSantis Two-plate flow example.py Description: Binary data ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Question regarding Boundary Condition Implementation
Jon, Thank you again for your advice. I'm guessing you discovered the mesh problem by visualizing the grid. I will have to remember that for future projects. I will also strongly consider a new boundary condition for the center line of the cylinder. Thank you, Dan On Mon, Apr 22, 2019 at 11:57 AM Guyer, Jonathan E. Dr. (Fed) via fipy < fipy@nist.gov> wrote: > Daniel - > > Two things going on here: > > - Your constraint is being applied at the tip of the wedge of the > cylindrical coordinates. Since this "face" has no area, that Dirichlet > condition doesn't generate any flux in or out of the domain. Offsetting the > cylinder slightly from the origin resolves this: > > mesh = CylindricalGrid1D(Lr = L,nr=nx) + [[L/nx]] > > I recommend giving some thought as to whether it even makes sense to apply > a Dirichlet condition along the centerline of a cylinder. > > - Because you've introduced coefficients which change with temperature, > your equation is now nonlinear and so sweeping is required (2 is apparently > enough). At each time step, execute: > > for sweep in range(2): > res = eq.sweep(dt=dt) > > rho.setValue(rho_l,where = PCM & (T>350) ) > k.setValue(k_l,where = PCM & (T>350)) > Cp.setValue(Cp_l,where = PCM & (T>350)) > > With these changes, the evolution seems generally similar to your Grid1D > case. > > - Jon > > > On Apr 15, 2019, at 1:28 PM, Daniel DeSantis wrote: > > > > Jonathan, > > > > I have just a few follow up questions. Namely, regarding to working > within cylindrical coordinates. If I switch the mesh to cylindrical, it > seems the temperature profile never changes, unless I go to extremely small > time steps. That strikes me as odd. What do you think? > > > > Also, the shifting profile seems to reverse, with the left boundary > condition dropping to ~300K over time while in Cartesian coordinates, the > temperature rises to 600K over time (a result I would expect). I've > included a copy of the work with the changes you've suggested previously. > If you look at lines 23/24, you can toggle the cylindrical grid on and off, > and in lines 30-34, I've included options for the time steps that work for > each respective coordinate system. Do you have any suggestions? > > > > Finally, in reference to the velocity I would like to incorporate, I > understand the difference between Cell Variables and Face Variables, but > why is the rank of the velocity -1? What does the Face Variable rank > indicate? > > > > Thank you, > > Dan > > > > On Thu, Apr 11, 2019 at 8:14 AM Guyer, Jonathan E. Dr. (Fed) via fipy < > fipy@nist.gov> wrote: > > > > > > > On Apr 10, 2019, at 4:42 PM, Daniel DeSantis > wrote: > > > > > > 1) Set a different Cp, rho, and k in just the PCM domain when the > temperature in that domain crosses over a certain melt temperature (350K). > I tried an if statement inside the solving loop and I think that has > worked, based on some print testing I did in the loop. I just wanted to get > your opinion and see if that was the right way to go. > > > > Seems reasonable, as long as you're calling `.setValue()` and not > redefining Cp, rho, and k. > > > > In fact, I wouldn't use an `if`: > > > > >>> for step in range(steps): > > ... T.updateOld() > > ... eq.solve(dt=dt) > > ... rho.setValue(rho_melt, where=PCM & (T > 350)) > > > > > > > 2) I'd like to move this to cylindrical coordinates with the lengths > being radii. I'm not sure if the cylindrical grid is working though. And if > it isn't, is there a way to convert the diffusion equation into something > that would solve the problem in Cartesian? More specifically, how would you > write an appropriate equation for the heat transfer of a radial system in > Cartesian coordinates? In short, how would you write this: > > > > > > in FiPy? > > > > The CylindricalGrids work fine, except for taking the gradient of the > field, which is an unusual need. > > > > > > > > 3) Ideally, I would move this to a 2D system which is the most > confusing to me. In a 2D system, heat would be transmitted radially while > air would be flowing axially. The air would cool as it passes through the > tube. The diffusion term in the axial direction would be significantly > lower than the convection term. Can I use the same heat transfer equation > you've suggested slightly modified? I would guess the equation to be > something like this: > > > > > >
Re: Question regarding Boundary Condition Implementation
Jonathan, I have just a few follow up questions. Namely, regarding to working within cylindrical coordinates. If I switch the mesh to cylindrical, it seems the temperature profile never changes, unless I go to extremely small time steps. That strikes me as odd. What do you think? Also, the shifting profile seems to reverse, with the left boundary condition dropping to ~300K over time while in Cartesian coordinates, the temperature rises to 600K over time (a result I would expect). I've included a copy of the work with the changes you've suggested previously. If you look at lines 23/24, you can toggle the cylindrical grid on and off, and in lines 30-34, I've included options for the time steps that work for each respective coordinate system. Do you have any suggestions? Finally, in reference to the velocity I would like to incorporate, I understand the difference between Cell Variables and Face Variables, but why is the rank of the velocity -1? What does the Face Variable rank indicate? Thank you, Dan On Thu, Apr 11, 2019 at 8:14 AM Guyer, Jonathan E. Dr. (Fed) via fipy < fipy@nist.gov> wrote: > > > > On Apr 10, 2019, at 4:42 PM, Daniel DeSantis wrote: > > > > 1) Set a different Cp, rho, and k in just the PCM domain when the > temperature in that domain crosses over a certain melt temperature (350K). > I tried an if statement inside the solving loop and I think that has > worked, based on some print testing I did in the loop. I just wanted to get > your opinion and see if that was the right way to go. > > Seems reasonable, as long as you're calling `.setValue()` and not > redefining Cp, rho, and k. > > In fact, I wouldn't use an `if`: > > >>> for step in range(steps): > ... T.updateOld() > ... eq.solve(dt=dt) > ... rho.setValue(rho_melt, where=PCM & (T > 350)) > > > > 2) I'd like to move this to cylindrical coordinates with the lengths > being radii. I'm not sure if the cylindrical grid is working though. And if > it isn't, is there a way to convert the diffusion equation into something > that would solve the problem in Cartesian? More specifically, how would you > write an appropriate equation for the heat transfer of a radial system in > Cartesian coordinates? In short, how would you write this: > > > > in FiPy? > > The CylindricalGrids work fine, except for taking the gradient of the > field, which is an unusual need. > > > > > 3) Ideally, I would move this to a 2D system which is the most confusing > to me. In a 2D system, heat would be transmitted radially while air would > be flowing axially. The air would cool as it passes through the tube. The > diffusion term in the axial direction would be significantly lower than the > convection term. Can I use the same heat transfer equation you've suggested > slightly modified? I would guess the equation to be something like this: > > > > eq = TransientTerm(coeff = rho*Cp,var = T) + > PowerLawConvectionTerm(coeff=rho*Cp*v,var = T) == DiffusionTerm(coeff=k,var > = T) > > > > s.t. v = velocity of the air. > > Looks OK > > > I would also think that I would have to set the value of v to 0 at the > wall and beyond, which means v would be a CellVariable like rho and k. > > Actually, v should be a rank-1 FaceVariable. > > Anisotropic diffusion is supported in FiPy (see > https://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.anisotropy.html), > but are you really sure you have lower axial diffusivity? It seems to me > more likely that transport is simply dominated by axial flow. > > > I also guess this equation would be subject to any changes that would be > made in question 2, regarding writing a cylindrical equation in a cartesian > system. What do you think? > > Use a CylindricalGrid and don't change the equation at all. > > > Again, thank you so much for your help and I hope I haven't taken up too > much of your time. > > Happy to help. > > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis # -*- coding: utf-8 -*- """ Created on Tue Apr 2 15:14:40 2019 @author: ddesantis """ from fipy import * import numpy as np import matplotlib.pyplot as plt #%% - Mesh nx = 100 L = 0.061 #m Ly = 1 #m L1 = 0.035 # m, Length of air channel t_w = 1./1000. # m, wall thickness L2 = L1+t_w # m, interface between PCM and wall L3 = L # m, Total Length mesh = Grid1D(Lx=L,nx=nx) #mesh = CylindricalGrid1D(Lr = L,nr=nx) x = mesh.cellCenters
Re: Question regarding Boundary Condition Implementation
Jonathan, Thank you very much for you help. It wouldn't be the first time I've over complicated a system. I understand how you set up the system a little bit better now. I had set things up the way I had before because I had expected to expand the system a bit. I was hoping to do the following: 1) Set a different Cp, rho, and k in just the PCM domain when the temperature in that domain crosses over a certain melt temperature (350K). I tried an if statement inside the solving loop and I think that has worked, based on some print testing I did in the loop. I just wanted to get your opinion and see if that was the right way to go. 2) I'd like to move this to cylindrical coordinates with the lengths being radii. I'm not sure if the cylindrical grid is working though. And if it isn't, is there a way to convert the diffusion equation into something that would solve the problem in Cartesian? More specifically, how would you write an appropriate equation for the heat transfer of a radial system in Cartesian coordinates? In short, how would you write this: [image: image.png] in FiPy? 3) Ideally, I would move this to a 2D system which is the most confusing to me. In a 2D system, heat would be transmitted radially while air would be flowing axially. The air would cool as it passes through the tube. The diffusion term in the axial direction would be significantly lower than the convection term. Can I use the same heat transfer equation you've suggested slightly modified? I would guess the equation to be something like this: eq = TransientTerm(coeff = rho*Cp,var = T) + PowerLawConvectionTerm(coeff=rho*Cp*v,var = T) == DiffusionTerm(coeff=k,var = T) s.t. v = velocity of the air. I would also think that I would have to set the value of v to 0 at the wall and beyond, which means v would be a CellVariable like rho and k. I also guess this equation would be subject to any changes that would be made in question 2, regarding writing a cylindrical equation in a cartesian system. What do you think? Again, thank you so much for your help and I hope I haven't taken up too much of your time. Thank you, Dan On Mon, Apr 8, 2019 at 5:37 PM Guyer, Jonathan E. Dr. (Fed) via fipy < fipy@nist.gov> wrote: > You're over-complicating things trying to have three different > temperatures. There's one temperature in three different domains, with > different material properties in each domain. FiPy (and physics) takes care > of matching fluxes for you at the internal boundaries. > > > The changes I made are at > https://gist.github.com/guyer/d86ee6f085e9832df781286099a73800/revisions > > The primary changes I made: > > - I defined three domains, `air`, `wall`, and `PCM`, and then defined `T`, > `rho`, `Cp`, and `k` to have different values in those different domains. > > - sweeps are for getting better convergence of non-linear equations. > Your equations are linear and from your usage you want time steps, not > sweeps. > See: > https://www.ctcms.nist.gov/fipy/documentation/FAQ.html#iterations-timesteps-and-sweeps-oh-my > > - Internal boundary conditions need to be defined very differently (see: > https://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-internal-boundary-conditions > ) > Importantly, you don't need internal boundary conditions. > > - All field variables and coefficients should be floats, not integers. > > > Note: Your wall thickness `tw = 0.001` is smaller than your grid spacing > `dx = 0.061 / 50 = 0.00122`, your your numerics will be terrible. Increase > your wall thickness or decrease your grid size. > > > On Apr 8, 2019, at 2:44 PM, Daniel DeSantis wrote: > > > > Hello, > > > > I am trying to model heat diffusion through a wall using FiPy. > Essentially, hot air on one side of the wall would heat the wall, and the > wall would subsequently heat a phase change material on the other side (See > picture below). The eventual goal would be to have the phase change > material properties change as the heat increases. I am having a few issues > with setting boundary conditions however. > > > > The goal of the model would be to have the heat flux at the wall be > equal to the heat flux of the fluid on each respective side. Further, the > heat flux of one of the fluids (a phase change material) would be 0 at the > side not in contact with the wall. (I've included a copy of my FiPy code as > is, and a series of equations and boundary conditions below). > > > > Right now, the temperature for the air and wall are staying constant, > while the phase change material temperature drops. I think how I've defined > the boundary conditions are to blame, but I'm not sure what I'm doing > wrong. Any help here would be greatly appreciated. > > > &
Question regarding Boundary Condition Implementation
Hello, I am trying to model heat diffusion through a wall using FiPy. Essentially, hot air on one side of the wall would heat the wall, and the wall would subsequently heat a phase change material on the other side (See picture below). The eventual goal would be to have the phase change material properties change as the heat increases. I am having a few issues with setting boundary conditions however. The goal of the model would be to have the heat flux at the wall be equal to the heat flux of the fluid on each respective side. Further, the heat flux of one of the fluids (a phase change material) would be 0 at the side not in contact with the wall. (I've included a copy of my FiPy code as is, and a series of equations and boundary conditions below). Right now, the temperature for the air and wall are staying constant, while the phase change material temperature drops. I think how I've defined the boundary conditions are to blame, but I'm not sure what I'm doing wrong. Any help here would be greatly appreciated. Thank you, -- Daniel DeSantis [image: image.png] [image: image.png] [image: image.png] [image: image.png] PCM_thermal_v0-SendOut.py Description: Binary data ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: FiPy Heat Transfer Solution
Thanks Daniel. I think I understand now. What would I do to multiply through by r in writing a FiPy equation? Should I some how create a spatial variable for r? Such as r= Variable? Do I have to somehow give it a range of possible values? (I didn't see an example for this online) Then I could use a standard mesh, correct? mesh = Grid1D(nx=nx,dx=dx) and then the equation becomes? eqT = TransientTerm(r * rho_b * Cp_b*1000/MW_b, var=T) == DiffusionTerm(coeff = L_eff, var=T) + r*S Sorry to have so many questions. On Thu, Aug 30, 2018 at 10:20 AM Daniel Wheeler wrote: > There are two ways to solve on a cylindrical domain in FiPy. You can > either use the standard diffusion equation in Cartesian coordinates (2nd > equation below) and with a mesh that is actually cylindrical in shape or > you can use the diffusion equation formulated on a cylindrical coordinate > system (1st equation below) and use a standard 2D / 1D grid mesh. I think > you're confused about "multiplying through by R". The problem with the > first equation in FiPy (cylindrical) is that FiPy can't have a coefficient > outside the first derivative, which occurs in the diffusion term of the > first equation. Of course that isn't an issue for constant coefficient like > density etc., but r, however, is not constant. We can get around that > problem by multiplying the first equation by r (small r) because the r can > come inside the time derivative in the transient term and just be a > multiplier on the source term, which is fine. Your equation then looks like > this. > > > Hope that helps. > > Cheers, > > Daniel > > On Wed, Aug 29, 2018 at 9:13 AM Daniel DeSantis > wrote: > >> Daniel, >> >> Thanks again for getting back to me. Sorry to keep coming back to the >> same problem. It does seem like there's a problem with the >> CylindricalGrid1D mesh. I noticed that running the most basic 1D diffusion >> example with a cylindrical grid doesn't seem to work correctly. With that >> said, I hope I can impose on you one more time and ask how I should convert >> a cylindrical coordinate PDE into a rectangular coordinate PDE for FiPy, >> essentially turning this >> [image: image.png] >> into this: >> [image: image.png]. >> Previously you said to multiply through by r. Assuming R is the maximum >> of the variable r, am I looking at this equation >> [image: image.png] or should I be using this? >> [image: image.png]If r should still be in the variable format, how would >> I make that work in FiPy? >> >> Thanks, >> Dan DeSantis >> > > > -- > Daniel Wheeler > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: FiPy Heat Transfer Solution
Daniel, Thanks again for getting back to me. Sorry to keep coming back to the same problem. It does seem like there's a problem with the CylindricalGrid1D mesh. I noticed that running the most basic 1D diffusion example with a cylindrical grid doesn't seem to work correctly. With that said, I hope I can impose on you one more time and ask how I should convert a cylindrical coordinate PDE into a rectangular coordinate PDE for FiPy, essentially turning this [image: image.png] into this: [image: image.png]. Previously you said to multiply through by r. Assuming R is the maximum of the variable r, am I looking at this equation [image: image.png] or should I be using this? [image: image.png]If r should still be in the variable format, how would I make that work in FiPy? Thanks, Dan DeSantis On Thu, Aug 16, 2018 at 6:04 PM Daniel Wheeler wrote: > Apologies for the slow reply. I hadn't noticed your response until > now. See below. > > On Wed, Aug 8, 2018 at 1:09 PM Daniel DeSantis wrote: > > > > Daniel, > > > > Thank you very much for your help.The code does run much better. > > > > I was curious about these lines of code. I'm hoping to understand what > this means so that I can use it if needed, next time. > > > > Thank you again, > > Dan DeSantis > > > > constraint_value = FaceVariable(mesh=mesh) > > T.faceGrad.constrain(constraint_value,mesh.facesLeft) > > > > for sweep in range(sweeps): > > constraint_value[:] = h * ((60. + 273.15) - T.faceValue) > > I only used the above code as it happened to work. It should work > without having to do the update in the loop, but something isn't right > with the way FiPy is updating constraints in the case when the > constraint is not a bare FaceVariable. In other words, we make a face > variable and then say that the constraint depends on that face > variable. We have to explicitly update the face variable in the loop. > > The expression "h * ((60. + 273.15) - T.faceValue" should also be a > face variable and so we should be able to use "T.faceGrad.constrain(h > * ((60. + 273.15) - T.faceValue, mesh.facesLeft)" and not update in > the loop. That doesn't work, however. > > -- > Daniel Wheeler > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: FiPy Heat Transfer Solution
Daniel, Thank you very much for your help.The code does run much better. I was curious about these lines of code. I'm hoping to understand what this means so that I can use it if needed, next time. Thank you again, Dan DeSantis constraint_value = FaceVariable(mesh=mesh) T.faceGrad.constrain(constraint_value,mesh.facesLeft) for sweep in range(sweeps): constraint_value[:] = h * ((60. + 273.15) - T.faceValue) On Wed, Aug 8, 2018 at 12:05 PM Daniel Wheeler wrote: > Hi Daniel, > > I updated your code a bit and it seems to do better. See > https://pastebin.com/51xfqWH3 for the full version. > > I changed the "eqX" equation to > > param = k_c * (P - Peq) > maxX = 0.9 > largeValue = 1e9 > constraint = largeValue * (X > maxX) > big_value = 1e9 > eqX = TransientTerm(var = X) == param - ImplicitSourceTerm(param, > var=X) + maxX * constraint - ImplicitSourceTerm(constraint, var=X) > > to have a constraint on the maximum value of X. I'm not sure whether > this is physical, but it does constrain the max value of X. > > I changed the "eqY" equation to be, > > eqT = TransientTerm(rho_b_MH * Cp_b, var=T) == DiffusionTerm(coeff > = L_eff, var=T) + rho_b_MH*(dH/M)*rc > > to have the transient coefficient inside the term. Again, not sure if > that matters, but did it anyway. > > I changed the constraint to be > > constraint_value = FaceVariable(mesh=mesh) > T.faceGrad.constrain(constraint_value,mesh.facesLeft) > > and then updated the constraint in the loop with > > for sweep in range(sweeps): > constraint_value[:] = h * ((60. + 273.15) - T.faceValue) > > If FiPy worked correctly that wouldn't be necessary, but evidently it > doesn't. > > Anyway that all seems to work at least as far as I can tell. > > Cheers, > > Daniel > > -- > Daniel Wheeler > _______ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: FiPy Heat Transfer Solution
t; On Jul 24, 2018, at 9:12 AM, Daniel Wheeler > wrote: > > > > Jon, is that correct? > > I honestly don't know > > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ODE_Coupled_to_PDE.py Description: Binary data ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: FiPy Heat Transfer Solution
Thank you very much! On Tue, Jul 24, 2018 at 10:13 AM Daniel Wheeler wrote: > On Wed, Jul 18, 2018 at 4:36 PM, Daniel DeSantis > wrote: > > > > > > If I wanted to run this in a cylindrical coordinate grid, the equation > would become: > > > > > > Can I just call the following in FiPy to account for this coordinate > system change?: > > > > mesh = CylindricalGrid1D(nx = 100.,Lx = 1., dx = 1./100.) > > Yes, that should work. There is a bug (see > https://github.com/usnistgov/fipy/issues/547) when calculating > gradients, but I don't think that applies to diffusion terms. > > Jon, is that correct? > > > If not, how do I account for the dependent variable when it is not in > the differential? Essentially, how do can I put lambda/r in the coefficient > etc.? > > You can multiply through by r and then split the transient term into > an implicit TransientTerm and a source term. It gives an extra source > term that is dependent on the time step. > > > 2) Is the correct way to add a source term simply to write something > like: > > > > eq = TransientTerm() == DiffusionTerm() + S > > > > or > > > > eq = TransientTerm() == DiffusionTerm() + ImplicitSourceTerm(S)? > > Either one. ImplicitSourceTerm implies that the source term is "var * > S", not "S" only, but the "var" is the variable that you're solving > for. To use ImplicitSourceTerm the S should be negative. In your case, > the source does not depend on temperature so you can't use an > ImplicitSourceTerm. > > > 3) Regarding boundary conditions, I am trying to use a boundary > condition that has my dependent variable (T) in the boundary condition. The > condition is dT/dr = h(T - Tc), where Tc is a constant. Would this be the > correct way to do that? I'm mostly inquiring about writing the dependent > variable as T.faceValue... > > > > T.faceGrad.constrain(h*(T.faceValue - Tc), mesh.facesLeft) > > I think that should work. Test it carefully. It's never obvious to me > what the sign should be. Don't trust it though. > > -- > Daniel Wheeler > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
FiPy Heat Transfer Solution
Hello, First off, I'd like to say I really like FiPy and appreciate that you have made such great tool for everyone to use. I am trying to use FiPy to solve a heat transfer problem in 1D and I have a few implementation questions. Forgive me if they seem simplistic. I have looked at a lot of the documentation and examples, but there may be some things that have eluded me. If it seems like I'm writing very simple, obvious things it's just so I can get a full grasp of what is going on. 1) It seems that most, if not all, of the examples are in Cartesian coordinates. Thus, a 1D diffusion equation with a source term would be: [image: image.png] where rho is density, Cb is specific heat, lamba is an effective heat transfer and S is a source term. Of course, T is temperature, t is time, and x is the coordinate. I would normally set this mesh up by using mesh = Grid1D(nx =100., Lx = 1., dx = 1./100.) If I wanted to run this in a cylindrical coordinate grid, the equation would become: [image: image.png] Can I just call the following in FiPy to account for this coordinate system change?: mesh = CylindricalGrid1D(nx = 100.,Lx = 1., dx = 1./100.) If not, how do I account for the dependent variable when it is not in the differential? Essentially, how do can I put lambda/r in the coefficient etc.? 2) Is the correct way to add a source term simply to write something like: eq = TransientTerm() == DiffusionTerm() + S or eq = TransientTerm() == DiffusionTerm() + ImplicitSourceTerm(S)? 3) Regarding boundary conditions, I am trying to use a boundary condition that has my dependent variable (T) in the boundary condition. The condition is dT/dr = h(T - Tc), where Tc is a constant. Would this be the correct way to do that? I'm mostly inquiring about writing the dependent variable as T.faceValue... T.faceGrad.constrain(h*(T.faceValue - Tc), mesh.facesLeft) I've included a copy of the code below. There are some extraneous details/code in there that I was playing with. Thank you! -- Daniel DeSantis from fipy import * # Constants rho_b_MH = 589. # kg m^-3 Cp_b = 88.25 #kJ (mol*K)^-1, # I'm using L in place of lambda L_eg = 150. # W m^-1 K^-1 L_MH = 1.74 # W m^-1 K^-1 L_eff = 8.4 # W m^-1 K^-1 t_r = 3.7 #min M = 2.02 #g/mol dH = 28.*1000. #kJ/mol h = 150. # W/m^-2 K^-1 T_c = 60 # Coolant Temperature Equation Set up and Boundary Condition R = 1. # There was no radius provided. I just set it to 1 for now nx = 100. # arbitrary number of points dx= R/nx #mesh = Grid1D(nx = nx, dx=dx) # Create a "mesh" for the 1D array mesh = CylindricalGrid1D(nx=nx,dx=dx,Lx=R) T = CellVariable(name ="Temperature",mesh=mesh,value = 60.) #T.constrain(60.,mesh.facesLeft) #T.constrain(120.,mesh.facesRight) T.faceGrad.constrain(0,mesh.facesRight) T.faceGrad.constrain(h*(T.faceValue-T_c),mesh.facesLeft) eq1 = TransientTerm(coeff=rho_b_MH*Cp_b,var=T) == DiffusionTerm(coeff = L_eff, var = T) + rho_b_MH*(dH/M) # Equation Solution vi = Viewer(T,datamin=0,datamax=100) TSD = .0001 #min/step steps = 75 #steps for step in range(steps): eq1.solve(var=T,dt=TSD) vi.plot() ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Diffusion-Convection-Reactive Chemisty
I'll check through the units again. Honestly, I'm not sure about convergence and the res > 1e-2. Frankly, I'm still fairly new to FiPy and I saw a similar use of this method and tried it out. I'll play with it and see if it changes my value. Thanks On Wed, Jul 27, 2016 at 10:37 PM, Guyer, Jonathan E. Dr. (Fed) < jonathan.gu...@nist.gov> wrote: > I recommend you work through and check your units in all equations. I > don't have any intuition for what's a big value and what's small when we're > talking kmol. There aren't any units at all specified for D, k, etc. > > Is your solution converged when it finishes `while res > 1.e-2`? How did > you pick that value for the residual? > > > > On Jul 21, 2016, at 2:12 PM, Daniel DeSantis wrote: > > > > So, these changes all helped a lot, both in getting results and my > general understanding. Sorry to come back with more questions but I have > been trying to extend the model a bit. I've added a second, competing > reaction and have tried to incorporate a temperature profile. So far, I can > get answers that seem to match what I expect but I have to use strange > values to do so... > > > > The two problems I have are: > > 1) The temperature profile requires a k_eff of 5e6 or 5e7 to not > increase ridiculously high. > > > > 2) The diffusion coefficient has to be relatively high (D=100) in order > to get a decent concentration profile. In most models with a reaction that > has a decent velocity, you can ignore diffusion all together. That does not > seem to be the case here. Perhaps my understanding of how to code these > systems is incorrect? In this particular case, is there something I should > be doing to make the diffusion term second order? > > > > I've included codes and an equation sheet to try and clarify things. As > it stands, the coefficients (D, k1, k2, keff) in the code give me a > concentration profile I expect but not a temperature one. > > > > Thank you, > > > > Daniel DeSantis > > > > On Thu, Jul 14, 2016 at 10:36 AM, Daniel DeSantis >wrote: > > Thank you everyone. This helps a lot! > > > > On Wed, Jul 13, 2016 at 5:04 PM, Guyer, Jonathan E. Dr. (Fed) < > jonathan.gu...@nist.gov> wrote: > > That should be OK. FiPy automatically maps the constraint onto the > faceValue of a CellVariable. > > > > > On Jul 13, 2016, at 3:26 PM, Keller, Trevor (Fed) < > trevor.kel...@nist.gov> wrote: > > > > > > Is the definition of C_a_BC correct? For a 1D grid, is the behavior of > > > C_a.constrain(C_a_BC, where=mesh.facesRight) > > > with a CellVariable instead of a scalar value > > > C_a_BC= C_a_0*(1-X) > > > meaningful? > > > > > > Trevor > > > From: fipy-boun...@nist.gov on behalf of > Daniel DeSantis > > > Sent: Wednesday, July 13, 2016 4:08:50 PM > > > To: FIPY > > > Subject: Re: Diffusion-Convection-Reactive Chemisty > > > > > > I'm sorry. I was trying to fix the problem, and forgot to put a line > back in, which was masked by me not clearing a variable value for V. My > apologies. Please try this code instead. It has the traceback I mentioned > before. > > > > > > > > > > > > Traceback (most recent call last): > > > > > > File "", line 1, in > > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/CFD > Models/ConversionModel.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models') > > > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > > > execfile(filename, namespace) > > > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > > > exec(compile(scripttext, filename, 'exec'), glob, loc) > > > > > > File "C:/Users/ddesantis/Dropbox/PythonScripts/CFD > Models/ConversionModel.py", line 110, in > > > res = Eq.sweep(dt=dt, solver=solver) > > > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", > line 236, in sweep > > > solver = self._prepareLinearSystem(var=var, solver=solver, > boundaryConditions=boundaryConditions, dt=dt) > > > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib
Re: Diffusion-Convection-Reactive Chemisty
So, these changes all helped a lot, both in getting results and my general understanding. Sorry to come back with more questions but I have been trying to extend the model a bit. I've added a second, competing reaction and have tried to incorporate a temperature profile. So far, I can get answers that seem to match what I expect but I have to use strange values to do so... The two problems I have are: 1) The temperature profile requires a k_eff of 5e6 or 5e7 to not increase ridiculously high. 2) The diffusion coefficient has to be relatively high (D=100) in order to get a decent concentration profile. In most models with a reaction that has a decent velocity, you can ignore diffusion all together. That does not seem to be the case here. Perhaps my understanding of how to code these systems is incorrect? In this particular case, is there something I should be doing to make the diffusion term second order? I've included codes and an equation sheet to try and clarify things. As it stands, the coefficients (D, k1, k2, keff) in the code give me a concentration profile I expect but not a temperature one. Thank you, Daniel DeSantis On Thu, Jul 14, 2016 at 10:36 AM, Daniel DeSantis wrote: > Thank you everyone. This helps a lot! > > On Wed, Jul 13, 2016 at 5:04 PM, Guyer, Jonathan E. Dr. (Fed) < > jonathan.gu...@nist.gov> wrote: > >> That should be OK. FiPy automatically maps the constraint onto the >> faceValue of a CellVariable. >> >> > On Jul 13, 2016, at 3:26 PM, Keller, Trevor (Fed) < >> trevor.kel...@nist.gov> wrote: >> > >> > Is the definition of C_a_BC correct? For a 1D grid, is the behavior of >> > C_a.constrain(C_a_BC, where=mesh.facesRight) >> > with a CellVariable instead of a scalar value >> > C_a_BC= C_a_0*(1-X) >> > meaningful? >> > >> > Trevor >> > From: fipy-boun...@nist.gov on behalf of >> Daniel DeSantis >> > Sent: Wednesday, July 13, 2016 4:08:50 PM >> > To: FIPY >> > Subject: Re: Diffusion-Convection-Reactive Chemisty >> > >> > I'm sorry. I was trying to fix the problem, and forgot to put a line >> back in, which was masked by me not clearing a variable value for V. My >> apologies. Please try this code instead. It has the traceback I mentioned >> before. >> > >> > >> > >> > Traceback (most recent call last): >> > >> > File "", line 1, in >> > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/CFD >> Models/ConversionModel.py', >> wdir='C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models') >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", >> line 699, in runfile >> > execfile(filename, namespace) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", >> line 74, in execfile >> > exec(compile(scripttext, filename, 'exec'), glob, loc) >> > >> > File "C:/Users/ddesantis/Dropbox/PythonScripts/CFD >> Models/ConversionModel.py", line 110, in >> > res = Eq.sweep(dt=dt, solver=solver) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", >> line 236, in sweep >> > solver = self._prepareLinearSystem(var=var, solver=solver, >> boundaryConditions=boundaryConditions, dt=dt) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", >> line 170, in _prepareLinearSystem >> > buildExplicitIfOther=self._buildExplcitIfOther) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\coupledBinaryTerm.py", >> line 122, in _buildAndAddMatrices >> > buildExplicitIfOther=buildExplicitIfOther) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", >> line 68, in _buildAndAddMatrices >> > buildExplicitIfOther=buildExplicitIfOther) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", >> line 68, in _buildAndAddMatrices >> > buildExplicitIfOther=buildExplicitIfOther) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packag
Re: Diffusion-Convection-Reactive Chemisty
Thank you everyone. This helps a lot! On Wed, Jul 13, 2016 at 5:04 PM, Guyer, Jonathan E. Dr. (Fed) < jonathan.gu...@nist.gov> wrote: > That should be OK. FiPy automatically maps the constraint onto the > faceValue of a CellVariable. > > > On Jul 13, 2016, at 3:26 PM, Keller, Trevor (Fed) < > trevor.kel...@nist.gov> wrote: > > > > Is the definition of C_a_BC correct? For a 1D grid, is the behavior of > > C_a.constrain(C_a_BC, where=mesh.facesRight) > > with a CellVariable instead of a scalar value > > C_a_BC= C_a_0*(1-X) > > meaningful? > > > > Trevor > > From: fipy-boun...@nist.gov on behalf of Daniel > DeSantis > > Sent: Wednesday, July 13, 2016 4:08:50 PM > > To: FIPY > > Subject: Re: Diffusion-Convection-Reactive Chemisty > > > > I'm sorry. I was trying to fix the problem, and forgot to put a line > back in, which was masked by me not clearing a variable value for V. My > apologies. Please try this code instead. It has the traceback I mentioned > before. > > > > > > > > Traceback (most recent call last): > > > > File "", line 1, in > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/CFD > Models/ConversionModel.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models') > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > > execfile(filename, namespace) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > > exec(compile(scripttext, filename, 'exec'), glob, loc) > > > > File "C:/Users/ddesantis/Dropbox/PythonScripts/CFD > Models/ConversionModel.py", line 110, in > > res = Eq.sweep(dt=dt, solver=solver) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", > line 236, in sweep > > solver = self._prepareLinearSystem(var=var, solver=solver, > boundaryConditions=boundaryConditions, dt=dt) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", > line 170, in _prepareLinearSystem > > buildExplicitIfOther=self._buildExplcitIfOther) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\coupledBinaryTerm.py", > line 122, in _buildAndAddMatrices > > buildExplicitIfOther=buildExplicitIfOther) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", > line 68, in _buildAndAddMatrices > > buildExplicitIfOther=buildExplicitIfOther) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", > line 68, in _buildAndAddMatrices > > buildExplicitIfOther=buildExplicitIfOther) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", > line 68, in _buildAndAddMatrices > > buildExplicitIfOther=buildExplicitIfOther) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\unaryTerm.py", > line 99, in _buildAndAddMatrices > > diffusionGeomCoeff=diffusionGeomCoeff) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\abstractConvectionTerm.py", > line 211, in _buildMatrix > > self.constraintB = -((1 - alpha) * var.arithmeticFaceValue * > constraintMask * exteriorCoeff).divergence * mesh.cellVolumes > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", > line 1151, in __mul__ > > return self._BinaryOperatorVariable(lambda a,b: a*b, other) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", > line 1116, in _BinaryOperatorVariable > > if not v.unit.isDimensionless() or len(v.shape) > 3: > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", > line 255, in _getUnit > > return self._extractUnit(self.value) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\varia
Re: Diffusion-Convection-Reactive Chemisty
I'm sorry. I was trying to fix the problem, and forgot to put a line back in, which was masked by me not clearing a variable value for V. My apologies. Please try this code instead. It has the traceback I mentioned before. Traceback (most recent call last): File "", line 1, in runfile('C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models/ConversionModel.py', wdir='C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models') File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models/ConversionModel.py", line 110, in res = Eq.sweep(dt=dt, solver=solver) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", line 236, in sweep solver = self._prepareLinearSystem(var=var, solver=solver, boundaryConditions=boundaryConditions, dt=dt) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", line 170, in _prepareLinearSystem buildExplicitIfOther=self._buildExplcitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\coupledBinaryTerm.py", line 122, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\unaryTerm.py", line 99, in _buildAndAddMatrices diffusionGeomCoeff=diffusionGeomCoeff) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\abstractConvectionTerm.py", line 211, in _buildMatrix self.constraintB = -((1 - alpha) * var.arithmeticFaceValue * constraintMask * exteriorCoeff).divergence * mesh.cellVolumes File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 1151, in __mul__ return self._BinaryOperatorVariable(lambda a,b: a*b, other) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 1116, in _BinaryOperatorVariable if not v.unit.isDimensionless() or len(v.shape) > 3: File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 255, in _getUnit return self._extractUnit(self.value) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 561, in _getValue value[..., mask] = numerix.array(constraint.value)[..., mask] IndexError: index 100 is out of bounds for axis 0 with size 100 On Wed, Jul 13, 2016 at 3:59 PM, Daniel Wheeler wrote: > Hi Daniel, > > It is giving a different error for me > > Traceback (most recent call last): > File "ConversionModel.py", line 78, in > V.constrain(V0,mesh.facesLeft) > NameError: name 'V' is not defined > > Is this the correct script? > > > > On Wed, Jul 13, 2016 at 3:27 PM, Daniel DeSantis > wrote: > > Hello, > > > > I am having some trouble getting a workable convection coefficient on a > > reactive chemistry model with a vector velocity. I have reviewed several > > examples from the FiPy mailing list and tried several of the variations > > listed there. Originally, I was receiving the error that a coefficient > must > > be a vector. Now I seem to be getting an error that says the index is > out of > > bounds. Specific traceback is shown below, along with the code > attachment. > > > > Could anyone suggest what I am doing wrong and how to fix it? > > > > I'm relatively new to Python and FiPy, specifically, so please bear with > me > > as I am learning. > > > > Thank you all! > > > > -- > > Daniel DeSantis > > > > Traceback (most recent call last): > > > >
Diffusion-Convection-Reactive Chemisty
Hello, I am having some trouble getting a workable convection coefficient on a reactive chemistry model with a vector velocity. I have reviewed several examples from the FiPy mailing list and tried several of the variations listed there. Originally, I was receiving the error that a coefficient must be a vector. Now I seem to be getting an error that says the index is out of bounds. Specific traceback is shown below, along with the code attachment. Could anyone suggest what I am doing wrong and how to fix it? I'm relatively new to Python and FiPy, specifically, so please bear with me as I am learning. Thank you all! -- Daniel DeSantis Traceback (most recent call last): File "", line 1, in runfile('C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models/ConversionModel.py', wdir='C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models') File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/ddesantis/Dropbox/PythonScripts/CFD Models/ConversionModel.py", line 107, in res = Eq.sweep(dt=dt, solver=solver) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", line 236, in sweep solver = self._prepareLinearSystem(var=var, solver=solver, boundaryConditions=boundaryConditions, dt=dt) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\term.py", line 170, in _prepareLinearSystem buildExplicitIfOther=self._buildExplcitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\coupledBinaryTerm.py", line 122, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices buildExplicitIfOther=buildExplicitIfOther) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\unaryTerm.py", line 99, in _buildAndAddMatrices diffusionGeomCoeff=diffusionGeomCoeff) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\terms\abstractConvectionTerm.py", line 211, in _buildMatrix self.constraintB = -((1 - alpha) * var.arithmeticFaceValue * constraintMask * exteriorCoeff).divergence * mesh.cellVolumes File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 1151, in __mul__ return self._BinaryOperatorVariable(lambda a,b: a*b, other) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 1116, in _BinaryOperatorVariable if not v.unit.isDimensionless() or len(v.shape) > 3: File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 255, in _getUnit return self._extractUnit(self.value) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\variable.py", line 561, in _getValue value[..., mask] = numerix.array(constraint.value)[..., mask] IndexError: index 100 is out of bounds for axis 0 with size 100 ConversionModel.py Description: Binary data ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Error: Gmsh hasn't produced any cells!
I copied it from the website. I find it easier to learn/understand code when I retype it. That said, Gmsh is working when I run the file from github. I hadn't tried that before. I guess it raises the question of why Gmsh is giving me errors when I copy the exact same code into a new script by hand. For what it's worth, here's what I was trying to run before. I think you'll see the Gmsh code is the same as what is in your example On Thu, Mar 24, 2016 at 3:53 PM, Guyer, Jonathan E. Dr. (Fed) < jonathan.gu...@nist.gov> wrote: > OK, thank you. > > Diffusion_Circle.py is not the name of our example; did you just copy it > or has it been changed in any way? What happens if you run > examples/diffusion/circle.py as-is? > > If they haven't been deleted already, please email me the files > c:\users\ddesan~1\appdata\local\temp\tmpzs_8ji.msh > c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo > > > > On Mar 24, 2016, at 1:17 PM, Daniel DeSantis wrote: > > > Ok, I don't know what changed, but I reinstalled literally everything on > my system. Python, fipy, gmsh, etc. It seems, for the moment that gmsh 2.11 > is reading now. I'm still getting the error about not producing any cells. > > > > To answer your questions, I'm running Windows 7 Professional. > > > > Running gmsh --version at the command line gets me Gmsh 2.11.0 > > > > Here's the errors from running the circle example: > > > > Exception WindowsError: (32, 'The process cannot access the file because > it is being used by another process', > 'c:\\users\\ddesan~1\\appdata\\local\\temp\\tmpzs_8ji.msh') in method MSHFile.__del__ of 0x19FE09C8>> ignored > > Traceback (most recent call last): > > > > File "", line 1, in > > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > > execfile(filename, namespace) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > > exec(compile(scripttext, filename, 'exec'), glob, loc) > > > > File > "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line > 27, in > >''' % locals()) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", > line 1585, in __init__ > > self._orderedCellVertexIDs_data) = self.mshFile.read() > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", > line 809, in read > > raise GmshException(errStr) > > > > GmshException: Gmsh hasn't produced any cells! Check your Gmsh code. > > > > Gmsh output: > > Info: Running 'gmsh > c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo -2 -nopopup -format msh > -o c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh' [Gmsh 2.11.0, 1 > node, max. 1 thread] > > Info: Started on Thu Mar 24 13:13:57 2016 > > Info: Reading 'c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo'... > > Info: Done reading > 'c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo' > > Info: Meshing 1D... > > Info: Done meshing 1D (0 s) > > Info: Meshing 2D... > > Info: Done meshing 2D (0 s) > > Info: 1 vertices 1 elements > > Info: Writing 'c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh'... > > Info: Done writing > 'c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh' > > Info: Stopped on Thu Mar 24 13:13:57 2016 > > > > On Thu, Mar 24, 2016 at 12:49 PM, Guyer, Jonathan E. Dr. (Fed) < > jonathan.gu...@nist.gov> wrote: > > What platform are you running on? > > > > Gmsh 2.0 is ancient and it's possible we've broken compatibility in some > way (although I don't think so). What happens if you type `gmsh --version` > at the command-line with one of the newer versions of Gmsh you've tried? > > > > > > On Mar 24, 2016, at 11:56 AM, Daniel DeSantis > wrote: > > > > > Trevor, > > > > > > I have tried the develop branch and up-to-date Gmsh version. I had to > back it up to Gmsh 2.0 to avoid the error. Not sure w
Re: Error: Gmsh hasn't produced any cells!
Ok, I don't know what changed, but I reinstalled literally everything on my system. Python, fipy, gmsh, etc. It seems, for the moment that gmsh 2.11 is reading now. I'm still getting the error about not producing any cells. To answer your questions, I'm running Windows 7 Professional. Running gmsh --version at the command line gets me Gmsh 2.11.0 Here's the errors from running the circle example: Exception WindowsError: (32, 'The process cannot access the file because it is being used by another process', 'c:\\users\\ddesan~1\\appdata\\local\\temp\\tmpzs_8ji.msh') in > ignored Traceback (most recent call last): File "", line 1, in runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line 27, in ''' % locals()) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", line 1585, in __init__ self._orderedCellVertexIDs_data) = self.mshFile.read() File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", line 809, in read raise GmshException(errStr) GmshException: Gmsh hasn't produced any cells! Check your Gmsh code. Gmsh output: Info: Running 'gmsh c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo -2 -nopopup -format msh -o c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh' [Gmsh 2.11.0, 1 node, max. 1 thread] Info: Started on Thu Mar 24 13:13:57 2016 Info: Reading 'c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo'... Info: Done reading 'c:\users\ddesan~1\appdata\local\temp\tmp2hf2nq.geo' Info: Meshing 1D... Info: Done meshing 1D (0 s) Info: Meshing 2D... Info: Done meshing 2D (0 s) Info: 1 vertices 1 elements Info: Writing 'c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh'... Info: Done writing 'c:\users\ddesan~1\appdata\local\temp\tmpisuemv.msh' Info: Stopped on Thu Mar 24 13:13:57 2016 On Thu, Mar 24, 2016 at 12:49 PM, Guyer, Jonathan E. Dr. (Fed) < jonathan.gu...@nist.gov> wrote: > What platform are you running on? > > Gmsh 2.0 is ancient and it's possible we've broken compatibility in some > way (although I don't think so). What happens if you type `gmsh --version` > at the command-line with one of the newer versions of Gmsh you've tried? > > > On Mar 24, 2016, at 11:56 AM, Daniel DeSantis wrote: > > > Trevor, > > > > I have tried the develop branch and up-to-date Gmsh version. I had to > back it up to Gmsh 2.0 to avoid the error. Not sure why that seems to be. > > > > Thanks, > > > > Dan > > > > On Thu, Mar 24, 2016 at 11:43 AM, Keller, Trevor (Fed) < > trevor.kel...@nist.gov> wrote: > > Hi Daniel, > > > > > > examples/diffusion/circle.py executes cleanly for me, with FiPy > 3.1-dev131-g77851ef and Gmsh 2.11.0. > > > > This looks like an installation problem. The up-to-date FiPy codebase > should work smoothly with more recent versions of Gmsh than 2.0. From your > post, it's unclear whether you've recently pulled the develop branch from > github, or manually applied the changes in that pull request to an older > release. Please update both Gmsh and FiPy, then post the specific error > messages it returns. > > > > > > Thanks, > > > > Trevor > > > > > > From: fipy-boun...@nist.gov on behalf of Daniel > DeSantis > > Sent: Wednesday, March 23, 2016 4:09 PM > > To: FIPY > > Subject: Error: Gmsh hasn't produced any cells! > > > > Hello, > > > > I'm getting an error when trying to run the diffusion circle example. I > keep getting the following error: > > > > GmshException: Gmsh hasn't produced any cells! Check your Gmsh code. > > > > Gmsh output: > > > > > > I'm running Gmsh 2.0. Any other version gives me errors with the version > number despite having fixed the error as described here: > https://github.com/usnistgov/fipy/pull/442 > > > > > > Does anyone have any suggestions on how I can get Gmsh to produce the > cells it&
Re: Error: Gmsh hasn't produced any cells!
Trevor, I have tried the develop branch and up-to-date Gmsh version. I had to back it up to Gmsh 2.0 to avoid the error. Not sure why that seems to be. Thanks, Dan On Thu, Mar 24, 2016 at 11:43 AM, Keller, Trevor (Fed) < trevor.kel...@nist.gov> wrote: > Hi Daniel, > > > examples/diffusion/circle.py executes cleanly for me, with > FiPy 3.1-dev131-g77851ef and Gmsh 2.11.0. > > This looks like an installation problem. The up-to-date FiPy codebase > should work smoothly with more recent versions of Gmsh than 2.0. From your > post, it's unclear whether you've recently pulled the develop branch from > github, or manually applied the changes in that pull request to an older > release. Please update both Gmsh and FiPy, then post the specific error > messages it returns. > > > Thanks, > > Trevor > > ------ > *From:* fipy-boun...@nist.gov on behalf of Daniel > DeSantis > *Sent:* Wednesday, March 23, 2016 4:09 PM > *To:* FIPY > *Subject:* Error: Gmsh hasn't produced any cells! > > Hello, > > I'm getting an error when trying to run the diffusion circle example. I > keep getting the following error: > > GmshException: Gmsh hasn't produced any cells! Check your Gmsh code. > > Gmsh output: > > > I'm running Gmsh 2.0. Any other version gives me errors with the version > number despite having fixed the error as described here: > https://github.com/usnistgov/fipy/pull/442 > > > Does anyone have any suggestions on how I can get Gmsh to produce the > cells it's supposed to? Or perhaps someone could explain a different method > of importing a gmsh file? I don't mind creating something in gmsh and then > importing it separately if that's easier? > > Thank you! > > -- > Daniel DeSantis > > > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Error: Gmsh hasn't produced any cells!
Hello, I'm getting an error when trying to run the diffusion circle example. I keep getting the following error: GmshException: Gmsh hasn't produced any cells! Check your Gmsh code. Gmsh output: I'm running Gmsh 2.0. Any other version gives me errors with the version number despite having fixed the error as described here: https://github.com/usnistgov/fipy/pull/442 Does anyone have any suggestions on how I can get Gmsh to produce the cells it's supposed to? Or perhaps someone could explain a different method of importing a gmsh file? I don't mind creating something in gmsh and then importing it separately if that's easier? Thank you! -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: gmsh EnvironmentError: Gmsh version must be >= 2.0.
So, some of that information and a little research on my own helped. For some reason the PATH wasn't reading into the gmsh folder. By adding the folder with the gmsh executable into the path, I was able to get it to read. Just FYI, for anyone who might need it, I used this little guide http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7 When I type gmsh --version into the command window, I get 2.11.0 Of course, now I'm getting a ValueError saying that 2.11.0 is an invalid version number. Maybe I should download and try an older gmsh version? I will probably play with this some more unless you have any ideas? I'll post updates just in case anyone else ever runs into these problems. On Mon, Feb 8, 2016 at 3:51 PM, Guyer, Jonathan E. Dr. < jonathan.gu...@nist.gov> wrote: > Strange. I sort of understand what this error message means, but I don't > understand why it's never been a problem before. > > On Feb 5, 2016, at 12:26 PM, Daniel DeSantis wrote: > > > Dr. Guyer, > > > > Thanks for the advice. It seemed to solve the error. Unfortunately, > another one cropped up immediately. Sorry to be a bother but I have to ask, > have you seen any errors come up regarding a NameError on factory meshes? > > > > > > File "", line 1, in > > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > > execfile(filename, namespace) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > > exec(compile(scripttext, filename, 'exec'), glob, loc) > > > > File > "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line > 7, in > > from fipy import * > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\__init__.py", > line 45, in > > from fipy.boundaryConditions import * > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\__init__.py", > line 2, in > > from fipy.boundaryConditions.fixedFlux import * > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\fixedFlux.py", > line 40, in > > from fipy.boundaryConditions.boundaryCondition import > BoundaryCondition > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\boundaryCondition.py", > line 38, in > > from fipy.variables.variable import Variable > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\__init__.py", > line 11, in > > from fipy.variables.histogramVariable import * > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\histogramVariable.py", > line 38, in > > from fipy.meshes import Grid1D > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\__init__.py", > line 9, in > > __all__.extend(factoryMeshes.__all__) > > > > NameError: name 'factoryMeshes' is not defined > > > > On Fri, Feb 5, 2016 at 11:30 AM, Guyer, Jonathan E. Dr. < > jonathan.gu...@nist.gov> wrote: > > I would guess that you've run into the problem in > https://github.com/usnistgov/fipy/issues/462 > > > > We fixed this last summer, but haven't pushed a new release since then > (sorry about that). > > > > If you check out the `develop` branch from our repository, I think that > will correct this problem. > > > > If not, tell us what you get if you type `gmsh --version` at the command > line. > > > > > > On Feb 5, 2016, at 8:59 AM, Daniel DeSantis wrote: > > > > > Hello, > > > > > > I am trying to run FiPy on a Windows XP system. I have gmsh installed > on my system. Does gmsh need to be in a certain file location? > > > > > > If I try to run commands with the Gmsh interface commands, such as > Gmsh2D(), I receive the following error. > > > > > > File "", line 1, in > > > > runfile('C:/Users/ddesa
Re: gmsh EnvironmentError: Gmsh version must be >= 2.0.
Guess I spoke too soon. Somehow the same error came up again even though I still have the suggested edit to the gmshMesh.py file... I have the gmsh folder located in the site-packages folder, for whatever that is worth. If I run gmsh --version anywhere but from inside the gmsh folder, I get an error saying gmsh is not a command. If I run gmsh --version inside the gmsh folder, I get 2.11.0. Any ideas? Thanks On Fri, Feb 5, 2016 at 12:26 PM, Daniel DeSantis wrote: > Dr. Guyer, > > Thanks for the advice. It seemed to solve the error. Unfortunately, > another one cropped up immediately. Sorry to be a bother but I have to ask, > have you seen any errors come up regarding a NameError on factory meshes? > > > File "", line 1, in > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > execfile(filename, namespace) > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > exec(compile(scripttext, filename, 'exec'), glob, loc) > > File > "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line > 7, in > from fipy import * > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\__init__.py", > line 45, in > from fipy.boundaryConditions import * > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\__init__.py", > line 2, in > from fipy.boundaryConditions.fixedFlux import * > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\fixedFlux.py", > line 40, in > from fipy.boundaryConditions.boundaryCondition import BoundaryCondition > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\boundaryCondition.py", > line 38, in > from fipy.variables.variable import Variable > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\__init__.py", > line 11, in > from fipy.variables.histogramVariable import * > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\histogramVariable.py", > line 38, in > from fipy.meshes import Grid1D > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\__init__.py", > line 9, in > __all__.extend(factoryMeshes.__all__) > > NameError: name 'factoryMeshes' is not defined > > On Fri, Feb 5, 2016 at 11:30 AM, Guyer, Jonathan E. Dr. < > jonathan.gu...@nist.gov> wrote: > >> I would guess that you've run into the problem in >> https://github.com/usnistgov/fipy/issues/462 >> >> We fixed this last summer, but haven't pushed a new release since then >> (sorry about that). >> >> If you check out the `develop` branch from our repository, I think that >> will correct this problem. >> >> If not, tell us what you get if you type `gmsh --version` at the command >> line. >> >> >> On Feb 5, 2016, at 8:59 AM, Daniel DeSantis wrote: >> >> > Hello, >> > >> > I am trying to run FiPy on a Windows XP system. I have gmsh installed >> on my system. Does gmsh need to be in a certain file location? >> > >> > If I try to run commands with the Gmsh interface commands, such as >> Gmsh2D(), I receive the following error. >> > >> > File "", line 1, in >> > >> runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', >> wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", >> line 699, in runfile >> > execfile(filename, namespace) >> > >> > File >> "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", >> line 74, in execfile >> > exec(compile(scripttext, filename, 'exec'), glob, loc) >> > >> > File >> "C:/Users/ddesantis/Dropbox/PythonScr
Re: gmsh EnvironmentError: Gmsh version must be >= 2.0.
Dr. Guyer, Thanks for the advice. It seemed to solve the error. Unfortunately, another one cropped up immediately. Sorry to be a bother but I have to ask, have you seen any errors come up regarding a NameError on factory meshes? File "", line 1, in runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line 7, in from fipy import * File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\__init__.py", line 45, in from fipy.boundaryConditions import * File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\__init__.py", line 2, in from fipy.boundaryConditions.fixedFlux import * File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\fixedFlux.py", line 40, in from fipy.boundaryConditions.boundaryCondition import BoundaryCondition File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\boundaryCondition.py", line 38, in from fipy.variables.variable import Variable File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\__init__.py", line 11, in from fipy.variables.histogramVariable import * File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\histogramVariable.py", line 38, in from fipy.meshes import Grid1D File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\__init__.py", line 9, in __all__.extend(factoryMeshes.__all__) NameError: name 'factoryMeshes' is not defined On Fri, Feb 5, 2016 at 11:30 AM, Guyer, Jonathan E. Dr. < jonathan.gu...@nist.gov> wrote: > I would guess that you've run into the problem in > https://github.com/usnistgov/fipy/issues/462 > > We fixed this last summer, but haven't pushed a new release since then > (sorry about that). > > If you check out the `develop` branch from our repository, I think that > will correct this problem. > > If not, tell us what you get if you type `gmsh --version` at the command > line. > > > On Feb 5, 2016, at 8:59 AM, Daniel DeSantis wrote: > > > Hello, > > > > I am trying to run FiPy on a Windows XP system. I have gmsh installed on > my system. Does gmsh need to be in a certain file location? > > > > If I try to run commands with the Gmsh interface commands, such as > Gmsh2D(), I receive the following error. > > > > File "", line 1, in > > > runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', > wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 699, in runfile > > execfile(filename, namespace) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", > line 74, in execfile > > exec(compile(scripttext, filename, 'exec'), glob, loc) > > > > File > "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line > 26, in > >''' % locals()) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", > line 1578, in __init__ > > background=background) > > > > File > "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", > line 151, in openMSHFile > > raise EnvironmentError("Gmsh version must be >= 2.0.") > > > > EnvironmentError: Gmsh version must be >= 2.0. > > > > Any advice? > > > > Thank you, > > > > Dan > > > > > > ___ > > fipy mailing list > > fipy@nist.gov > > http://www.ctcms.nist.gov/fipy > > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel DeSantis ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
gmsh EnvironmentError: Gmsh version must be >= 2.0.
Hello, I am trying to run FiPy on a Windows XP system. I have gmsh installed on my system. Does gmsh need to be in a certain file location? If I try to run commands with the Gmsh interface commands, such as Gmsh2D(), I receive the following error. File "", line 1, in runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py', wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy') File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py", line 26, in ''' % locals()) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", line 1578, in __init__ background=background) File "C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py", line 151, in openMSHFile raise EnvironmentError("Gmsh version must be >= 2.0.") EnvironmentError: Gmsh version must be >= 2.0. Any advice? Thank you, Dan ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]