Re: Compressible euler equations
On Thu, May 18, 2017 at 2:16 PM, Thibault Bridel-Bertomeu wrote: > > 1/ for the pressure equation, when you meant implicitTerm were you thinking > about this : > > eqnP = fipy.ImplicitSourceTerm(coeff=1.0, var=p) == gm1*roE - > 0.5*gm1*(roU**2 + roV**2)/ro Exactly, you can also use implicit terms for roU and roV as well, but linearized. > 2/ Okay, for the dp/dx and dp/dy, I agree now I see that we can use a > centralconvectionterm indeed. Can you confirm they are to be written as : > > coeffForX = fipy.CellVariable(mesh=mesh, rank=1) > coeffForX[0] = 1.0 > coeffForX[1] = 0.0 > fipy.CentralDifferenceConvectionTerm(coeff=coeffForX, var=p) That looks right. > for dp/dx, and as : > > coeffForY = fipy.CellVariable(mesh=mesh, rank=1) > > coeffForY[0] = 0.0 > > coeffForY[1] = 1.0 > > fipy.CentralDifferenceConvectionTerm(coeff=coeffForY, var=p) Seems OK. > > > for dp/dy ? > As for the roE equation, I combined the gradient components into this : > > coeffConv = fipy.CellVariable(mesh=mesh, rank=1) > coeffConv[0] = roU/ro > coeffConv[1] = roV/ro > fipy.CentralDifferenceConvectionTerm(coeff=coeffConv.faceValue, var=p) > > Does it seem reasonable to you ? That last one isn't right. I think that the roU and roV won't be updated as you advance the time steps. I think that you need to define the "coeffConv" to be coeffConv = (fipy.Varialbe((1, 0)) * roU + fipy.Variable((0, 1)) * roV) / ro The assignment into convCoeff that you are using above just inputs the current values from roU / ro into coeffConv not the dependency. > 3/ By non-linear, I get that you mean sweeping the equations several times > before actually updating the solution in time. But I don’t know what > equations i am supposed to be sweeping here, I think I lack the experience. > The whole system should be swept, like so : You need to sweep all of them as you're doing. I don't think that the order matters. -- Daniel Wheeler ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Compressible euler equations
Dear Thibault, I have studied the example you sent me, and I noticed you inserted 0.5-0.5tan(Dx) for PHI. I was not sure on how FiPY worked in the first place, and wondered if your example basically tests whether 0.5-0.5tan(Dx) fits in and solves the given PDE, which I wrote in the beginning? This eqn was u_t + u_xx +u² = 0 As 0.5-0.5tan(Dx) does not give zero here, when inserted, does this mean that FiPY tests the fitness of a function (phi) in a PDE, and if it fits, it ends up with a zero-line for homogenous cases as this PDE? Thanks In advance! Sergio Manzetti [ http://www.fjordforsk.no/logo_hr2.jpg ] [ http://www.fjordforsk.no/ | Fjordforsk AS ] [ http://www.fjordforsk.no/ | ] Midtun 6894 Vangsnes Norge Org.nr. 911 659 654 Tlf: +47 57695621 [ http://www.oekolab.com/ | Økolab ] | [ http://www.nanofact.no/ | Nanofactory ] | [ http://www.aq-lab.no/ | AQ-Lab ] | [ http://www.phap.no/ | FAP ] From: "Thibault Bridel-Bertomeu" To: "fipy" Sent: Thursday, May 18, 2017 8:16:47 PM Subject: Re: Compressible euler equations Hi Daniel, Thank you for your answer, I feel I am getting close thanks to you but it still does not work .. can you please shed some light on the following points : 1/ for the pressure equation, when you meant implicitTerm were you thinking about this : eqnP = fipy.ImplicitSourceTerm(coeff=1.0, var=p) == gm1*roE - 0.5*gm1*(roU**2 + roV**2)/ro 2/ Okay, for the dp/dx and dp/dy, I agree now I see that we can use a centralconvectionterm indeed. Can you confirm they are to be written as : coeffForX = fipy.CellVariable(mesh=mesh, rank=1) coeffForX[0] = 1.0 coeffForX[1] = 0.0 fipy.CentralDifferenceConvectionTerm(coeff=coeffForX, var=p) for dp/dx, and as : coeffForY = fipy.CellVariable(mesh=mesh, rank=1) coeffForY[0] = 0.0 coeffForY[1] = 1.0 fipy.CentralDifferenceConvectionTerm(coeff=coeffForY, var=p) for dp/dy ? As for the roE equation, I combined the gradient components into this : coeffConv = fipy.CellVariable(mesh=mesh, rank=1) coeffConv[0] = roU/ro coeffConv[1] = roV/ro fipy.CentralDifferenceConvectionTerm(coeff=coeffConv.faceValue, var=p) Does it seem reasonable to you ? 3/ By non-linear, I get that you mean sweeping the equations several times before actually updating the solution in time. But I don’t know what equations i am supposed to be sweeping here, I think I lack the experience. The whole system should be swept, like so : for step in range(steps): ro.updateOld() roU.updateOld() roV.updateOld() roE.updateOld() p.updateOld() # # eqn.solve(dt=dt) for sweep in range(sweeps): print "ITER %d, SWEEP %d"%(step+1, sweep+1) vi2D.plot() eqnP.sweep(dt=dt) eqnC.sweep(dt=dt) eqnMx.sweep(dt=dt) eqnMy.sweep(dt=dt) eqnE.sweep(dt=dt) or is it only a few equations, in a certain order ? I need your help on that please. Thank you so much again, Cordialement, -- T. BRIDEL-BERTOMEU 2017-05-18 16:28 GMT+02:00 Daniel Wheeler < [ mailto:daniel.wheel...@gmail.com | daniel.wheel...@gmail.com ] > : Hi Thibault, I think that you are almost there with your implementation. There are a few more things to do to get it working. - First, use an ImplciitSourceTerm rather than a TransientTerm to represent "p" in the pressure equation. - Secondly, use a CentralDifferenceConvectionTerm in the momentum equations to represent dp/dx etc. This will give you the implicit coupling. Also, maybe, in the roE equation, though that is more complicated. - Thirdly, as this is non-linear, you also need an extra non-linear loop at each time step. - Fourthly, if you can't get this working in a coupled manner. Maybe try uncoupling and solving each equation separately, but use the non-linear loop mentioned above. Only when that is working you should start coupling terms one by one. Cheers, Daniel On Thu, May 18, 2017 at 5:55 AM, Thibault Bridel-Bertomeu < [ mailto:thibault.bridellel...@gmail.com | thibault.bridellel...@gmail.com ] > wrote: > Hello Daniel, > > Thank you for the paper and the script - I am afraid it will take me some > time though, its impressive and long work !! > > Regarding the equations, I think I was not clear enough in my previous > explanations, I apologize. > In substance, I have 4 variables : ro, roU, roV and roE. They are density, > velocity along X, velocity along Y and energy. > I also have 4 differential equations : > > dro/dt + nabla.(ro*[U,V]) = 0 > droU/dt + nabla.(roU*[U,V]) = -dp / dx > droV/dt + nabla.(roV*[U,V]) = -dp / dy > droE/dt + nabla.(roE*[U,V]) = - d(p*(roU/ro))/dx - d(p*(roV/ro))/dy > > As you can see, they are written with a fifth variable, p, for pressure, > that is related to the others by : > > p = (gamma-1.0)*roE - 0.5*(gamma-1.0)*(roU**2 + roV**2)/ro > > this is what I call the equation of state, it is
Re: Compressible euler equations
Hi Daniel, Thank you for your answer, I feel I am getting close thanks to you but it still does not work .. can you please shed some light on the following points : 1/ for the pressure equation, when you meant implicitTerm were you thinking about this : eqnP = fipy.ImplicitSourceTerm(coeff=1.0, var=p) == gm1*roE - 0.5*gm1*(roU**2 + roV**2)/ro 2/ Okay, for the dp/dx and dp/dy, I agree now I see that we can use a centralconvectionterm indeed. Can you confirm they are to be written as : coeffForX = fipy.CellVariable(mesh=mesh, rank=1) coeffForX[0] = 1.0 coeffForX[1] = 0.0 fipy.CentralDifferenceConvectionTerm(coeff=coeffForX, var=p) for dp/dx, and as : coeffForY = fipy.CellVariable(mesh=mesh, rank=1) coeffForY[0] = 0.0 coeffForY[1] = 1.0 fipy.CentralDifferenceConvectionTerm(coeff=coeffForY, var=p) for dp/dy ? As for the roE equation, I combined the gradient components into this : coeffConv = fipy.CellVariable(mesh=mesh, rank=1) coeffConv[0] = roU/ro coeffConv[1] = roV/ro fipy.CentralDifferenceConvectionTerm(coeff=coeffConv.faceValue, var=p) Does it seem reasonable to you ? 3/ By non-linear, I get that you mean sweeping the equations several times before actually updating the solution in time. But I don’t know what equations i am supposed to be sweeping here, I think I lack the experience. The whole system should be swept, like so : for step in range(steps): ro.updateOld() roU.updateOld() roV.updateOld() roE.updateOld() p.updateOld() # # eqn.solve(dt=dt) for sweep in range(sweeps): print "ITER %d, SWEEP %d"%(step+1, sweep+1) vi2D.plot() eqnP.sweep(dt=dt) eqnC.sweep(dt=dt) eqnMx.sweep(dt=dt) eqnMy.sweep(dt=dt) eqnE.sweep(dt=dt) or is it only a few equations, in a certain order ? I need your help on that please. Thank you so much again, Cordialement, -- T. BRIDEL-BERTOMEU 2017-05-18 16:28 GMT+02:00 Daniel Wheeler : > Hi Thibault, > > I think that you are almost there with your implementation. There are > a few more things to do to get it working. > > - First, use an ImplciitSourceTerm rather than a TransientTerm to > represent "p" in the pressure equation. > > - Secondly, use a CentralDifferenceConvectionTerm in the momentum > equations to represent dp/dx etc. This will give you the implicit > coupling. Also, maybe, in the roE equation, though that is more > complicated. > > - Thirdly, as this is non-linear, you also need an extra non-linear > loop at each time step. > > - Fourthly, if you can't get this working in a coupled manner. Maybe > try uncoupling and solving each equation separately, but use the > non-linear loop mentioned above. Only when that is working you should > start coupling terms one by one. > > Cheers, > > Daniel > > > On Thu, May 18, 2017 at 5:55 AM, Thibault Bridel-Bertomeu > wrote: > > Hello Daniel, > > > > Thank you for the paper and the script - I am afraid it will take me some > > time though, its impressive and long work !! > > > > Regarding the equations, I think I was not clear enough in my previous > > explanations, I apologize. > > In substance, I have 4 variables : ro, roU, roV and roE. They are > density, > > velocity along X, velocity along Y and energy. > > I also have 4 differential equations : > > > > dro/dt + nabla.(ro*[U,V]) = 0 > > droU/dt + nabla.(roU*[U,V]) = -dp / dx > > droV/dt + nabla.(roV*[U,V]) = -dp / dy > > droE/dt + nabla.(roE*[U,V]) = - d(p*(roU/ro))/dx - d(p*(roV/ro))/dy > > > > As you can see, they are written with a fifth variable, p, for pressure, > > that is related to the others by : > > > > p = (gamma-1.0)*roE - 0.5*(gamma-1.0)*(roU**2 + roV**2)/ro > > > > this is what I call the equation of state, it is not differential it is > just > > algebraic. > > > > I wager the differential equations above are not the most complex you > have > > seen or implemented in FiPy, and I think I succeeded, although of course, > > since the whole thing does not work, I cannot be sure. But then I am > stuck > > with that non-differential equation that I would have to solve with the > four > > differential (?) to close the system … > > > > Can you see what I am stuck with ? > > Also, could you please elaborate on the last paragraph of your previous > > e-mail ? « If you do include … » I am not sure I get why you speak of > > linearization and relaxation ? > > > > I attach the latest version of my non-working script .. > > > > Thanks for the help > > > > Best, > > > > Thibault > > > > -- > Daniel Wheeler > > ___ > 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 ]
Re: Compressible euler equations
Hi Thibault, I think that you are almost there with your implementation. There are a few more things to do to get it working. - First, use an ImplciitSourceTerm rather than a TransientTerm to represent "p" in the pressure equation. - Secondly, use a CentralDifferenceConvectionTerm in the momentum equations to represent dp/dx etc. This will give you the implicit coupling. Also, maybe, in the roE equation, though that is more complicated. - Thirdly, as this is non-linear, you also need an extra non-linear loop at each time step. - Fourthly, if you can't get this working in a coupled manner. Maybe try uncoupling and solving each equation separately, but use the non-linear loop mentioned above. Only when that is working you should start coupling terms one by one. Cheers, Daniel On Thu, May 18, 2017 at 5:55 AM, Thibault Bridel-Bertomeu wrote: > Hello Daniel, > > Thank you for the paper and the script - I am afraid it will take me some > time though, its impressive and long work !! > > Regarding the equations, I think I was not clear enough in my previous > explanations, I apologize. > In substance, I have 4 variables : ro, roU, roV and roE. They are density, > velocity along X, velocity along Y and energy. > I also have 4 differential equations : > > dro/dt + nabla.(ro*[U,V]) = 0 > droU/dt + nabla.(roU*[U,V]) = -dp / dx > droV/dt + nabla.(roV*[U,V]) = -dp / dy > droE/dt + nabla.(roE*[U,V]) = - d(p*(roU/ro))/dx - d(p*(roV/ro))/dy > > As you can see, they are written with a fifth variable, p, for pressure, > that is related to the others by : > > p = (gamma-1.0)*roE - 0.5*(gamma-1.0)*(roU**2 + roV**2)/ro > > this is what I call the equation of state, it is not differential it is just > algebraic. > > I wager the differential equations above are not the most complex you have > seen or implemented in FiPy, and I think I succeeded, although of course, > since the whole thing does not work, I cannot be sure. But then I am stuck > with that non-differential equation that I would have to solve with the four > differential (?) to close the system … > > Can you see what I am stuck with ? > Also, could you please elaborate on the last paragraph of your previous > e-mail ? « If you do include … » I am not sure I get why you speak of > linearization and relaxation ? > > I attach the latest version of my non-working script .. > > Thanks for the help > > Best, > > Thibault -- Daniel Wheeler ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Re: Compressible euler equations
Hello Daniel, Thank you for the paper and the script - I am afraid it will take me some time though, its impressive and long work !! Regarding the equations, I think I was not clear enough in my previous explanations, I apologize. In substance, I have 4 variables : ro, roU, roV and roE. They are density, velocity along X, velocity along Y and energy. I also have 4 differential equations : dro/dt + nabla.(ro*[U,V]) = 0 droU/dt + nabla.(roU*[U,V]) = -dp / dx droV/dt + nabla.(roV*[U,V]) = -dp / dy droE/dt + nabla.(roE*[U,V]) = - d(p*(roU/ro))/dx - d(p*(roV/ro))/dy As you can see, they are written with a fifth variable, p, for pressure, that is related to the others by : p = (gamma-1.0)*roE - 0.5*(gamma-1.0)*(roU**2 + roV**2)/ro this is what I call the equation of state, it is not differential it is just algebraic. I wager the differential equations above are not the most complex you have seen or implemented in FiPy, and I think I succeeded, although of course, since the whole thing does not work, I cannot be sure. But then I am stuck with that non-differential equation that I would have to solve with the four differential (?) to close the system … Can you see what I am stuck with ? Also, could you please elaborate on the last paragraph of your previous e-mail ? « If you do include … » I am not sure I get why you speak of linearization and relaxation ? I attach the latest version of my non-working script .. Thanks for the help Best, Thibault 2017-05-17 17:06 GMT+02:00 Daniel Wheeler : > Hi Thibault, > > The paper and your attempts at solving it are very impressive, nice > work. I'm not sure I understand the issue with the equation of state / > 2D issue though. Is it that you want to couple in the equation of > state with the other equations instead of solving explicitly? > > Here is a link for some work I did with FiPy quite a long time ago, > > https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec2d > > It resulted in a publication, see https://arxiv.org/pdf/1006.4881.pdf. > In that work, everything is being solved in one matrix, see > > https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec > 2d#file-input-py-L245 > > Look at, > > https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec > 2d#file-input-py-L286 > > That particular equation is like an equation of state (it has no > transient term). The point is that with the use of > ImplicitSourceTerm's, you can include an equation of state implicitly. > I'm not sure whether this is your issue or not, but it might be > related. The above set of equations are dissipative, which yours are > not, but also, I wasn't concerned with resolving the shocks > numerically so a Roe solver wasn't used. Also, this work was done > before FiPy had coupled solutions. > > If you do include the equation of state in the matrix, then think > carefully about how you linearize the "roU" and "roV" terms. Also, as > the equation of state is like an immediate update, it might be > necessary to relax the updates a bit during the non-linear iteration > cycle. > > Cheers, > > Daniel > > > > On Mon, May 15, 2017 at 11:46 AM, Thibault Bridel-Bertomeu > wrote: > > Hello Daniel, > > > > Thanks for the answer > > > > An implementation of the Roe scheme would certainly go a long way in > > simplifying the resolution of hyperbolic equations but I think FiPy > already > > has was it takes to do that - terms wise. > > I know of CLAWPACK yes, but I really would like to see if FiPy can handle > > fluid dynamics equations. I work at CERFACS, a lab in France centered > around > > the use of Computational Fluid Dynamics for academic and industrial > purpose, > > and although we do have a production code, I would like to let my > colleagues > > know about FiPy because I think it has the potential to be a great > > first-approach solver for simple to mildly complex problems. > > > > I actually already succeeded in solving (and validating with the known > Sod > > shock tube test case) the 1D compressible Euler equations (script > attached > > with an exact solver for reference). > > But then in 1D, things are pretty easy - equation wise. > > If you have time to check the code, can you tell me if you see any kind > of > > mis-use of FiPy ? Are there any lines you would have written differently > ? > > > > In 2D everything becomes harder and I can’t get it right - although I > > suspect it is because I don’t know FiPy very well yet. > > If you don’t mind, I have a couple questions to try and make it work. > > > > 1/ I do not get how to include the resolution of an equation of state in > the > > system
Re: Compressible euler equations
Hi Thibault, The paper and your attempts at solving it are very impressive, nice work. I'm not sure I understand the issue with the equation of state / 2D issue though. Is it that you want to couple in the equation of state with the other equations instead of solving explicitly? Here is a link for some work I did with FiPy quite a long time ago, https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec2d It resulted in a publication, see https://arxiv.org/pdf/1006.4881.pdf. In that work, everything is being solved in one matrix, see https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec2d#file-input-py-L245 Look at, https://gist.github.com/wd15/c28ab796cb3d9781482b01fb67a7ec2d#file-input-py-L286 That particular equation is like an equation of state (it has no transient term). The point is that with the use of ImplicitSourceTerm's, you can include an equation of state implicitly. I'm not sure whether this is your issue or not, but it might be related. The above set of equations are dissipative, which yours are not, but also, I wasn't concerned with resolving the shocks numerically so a Roe solver wasn't used. Also, this work was done before FiPy had coupled solutions. If you do include the equation of state in the matrix, then think carefully about how you linearize the "roU" and "roV" terms. Also, as the equation of state is like an immediate update, it might be necessary to relax the updates a bit during the non-linear iteration cycle. Cheers, Daniel On Mon, May 15, 2017 at 11:46 AM, Thibault Bridel-Bertomeu wrote: > Hello Daniel, > > Thanks for the answer > > An implementation of the Roe scheme would certainly go a long way in > simplifying the resolution of hyperbolic equations but I think FiPy already > has was it takes to do that - terms wise. > I know of CLAWPACK yes, but I really would like to see if FiPy can handle > fluid dynamics equations. I work at CERFACS, a lab in France centered around > the use of Computational Fluid Dynamics for academic and industrial purpose, > and although we do have a production code, I would like to let my colleagues > know about FiPy because I think it has the potential to be a great > first-approach solver for simple to mildly complex problems. > > I actually already succeeded in solving (and validating with the known Sod > shock tube test case) the 1D compressible Euler equations (script attached > with an exact solver for reference). > But then in 1D, things are pretty easy - equation wise. > If you have time to check the code, can you tell me if you see any kind of > mis-use of FiPy ? Are there any lines you would have written differently ? > > In 2D everything becomes harder and I can’t get it right - although I > suspect it is because I don’t know FiPy very well yet. > If you don’t mind, I have a couple questions to try and make it work. > > 1/ I do not get how to include the resolution of an equation of state in the > system of differential equations. I wrote a stub of code (attached, called > 7-covo2D.py) in which I solve for (rho, rhoU, rhoV, rhoE) as usual. An easy > way to write the Euler equations however is to include a notion of pressure, > which is related to the unknown by an equation of state (it is not a > differential equation though) - see for instance > http://bender.astro.sunysb.edu/hydro_by_example/compressible/Euler.pdf. > Because of this, I have to inject the EoS directly into the equations and > try and make do with that, but the Finite Volume method is not designed to > have the fluxes computed like I do in the script, so naturally everything > crashes or gives nonsensical results. > Do you see a possibility in FiPy to solve 4 differential equations and 1 > algebraic equation (the EoS) in a coupled manner ? > > 2/ If it is not possible to include the equation of state in the system, how > would you take the -dp/dx and the -dp/dy from the momentum equations (with p > expanded as a function of rhoE, rhoU and rhoV) into account ? > > Thank you very much for your help, > > Best regards, > > Thibault > > > > 2017-05-15 15:38 GMT+02:00 Daniel Wheeler : >> >> Hi Thibault, >> >> I started down the road of implementing a Riemann solver in FiPy, see >> >> >> https://github.com/usnistgov/fipy/blob/riemann/fipy/terms/baseRoeConvectionTerm.py >> >> Unfortunately, I never completed and merged this work. You might want >> to look into CLAWPACK for a code to better handle compressible flow. >> >> I've given a few answers about this in the past as well, see >> >>- http://git.net/ml/python-fipy/2012-02/msg00024.html >> >>- >> http://fipy.nist.narkive.com/A0gJrSl2/semilinear-wave-equation-in-fipy >> >>- &g
Re: Compressible euler equations
Hello Daniel, Thanks for the answer An implementation of the Roe scheme would certainly go a long way in simplifying the resolution of hyperbolic equations but I think FiPy already has was it takes to do that - terms wise. I know of CLAWPACK yes, but I really would like to see if FiPy can handle fluid dynamics equations. I work at CERFACS, a lab in France centered around the use of Computational Fluid Dynamics for academic and industrial purpose, and although we do have a production code, I would like to let my colleagues know about FiPy because I think it has the potential to be a great first-approach solver for simple to mildly complex problems. I actually already succeeded in solving (and validating with the known Sod shock tube test case) the 1D compressible Euler equations (script attached with an exact solver for reference). But then in 1D, things are pretty easy - equation wise. If you have time to check the code, can you tell me if you see any kind of mis-use of FiPy ? Are there any lines you would have written differently ? In 2D everything becomes harder and I can’t get it right - although I suspect it is because I don’t know FiPy very well yet. If you don’t mind, I have a couple questions to try and make it work. 1/ I do not get how to include the resolution of an equation of state in the system of differential equations. I wrote a stub of code (attached, called 7-covo2D.py) in which I solve for (rho, rhoU, rhoV, rhoE) as usual. An easy way to write the Euler equations however is to include a notion of pressure, which is related to the unknown by an equation of state (it is not a differential equation though) - see for instance http://bender.astro.sunysb.edu/hydro_by_example/compressible/Euler.pdf. Because of this, I have to inject the EoS directly into the equations and try and make do with that, but the Finite Volume method is not designed to have the fluxes computed like I do in the script, so naturally everything crashes or gives nonsensical results. Do you see a possibility in FiPy to solve 4 differential equations and 1 algebraic equation (the EoS) in a coupled manner ? 2/ If it is not possible to include the equation of state in the system, how would you take the -dp/dx and the -dp/dy from the momentum equations (with p expanded as a function of rhoE, rhoU and rhoV) into account ? Thank you very much for your help, Best regards, Thibault 2017-05-15 15:38 GMT+02:00 Daniel Wheeler : > Hi Thibault, > > I started down the road of implementing a Riemann solver in FiPy, see > > https://github.com/usnistgov/fipy/blob/riemann/fipy/terms/ > baseRoeConvectionTerm.py > > Unfortunately, I never completed and merged this work. You might want > to look into CLAWPACK for a code to better handle compressible flow. > > I've given a few answers about this in the past as well, see > >- http://git.net/ml/python-fipy/2012-02/msg00024.html > >- http://fipy.nist.narkive.com/A0gJrSl2/semilinear-wave- > equation-in-fipy > >- http://fipy.nist.narkive.com/YVZTRM0G/1d-coupled-fluid- > equations-in-fipy > > Cheers, > > Daniel > > On Sun, May 14, 2017 at 9:33 AM, Thibault Bridel-Bertomeu > wrote: > > Good afternoon, > > > > I was wondering if anyone had ever tried implementing the compressible > euler > > equations in FiPy ? > > I have been trying for a while now but even in 1D I can’t get a proper > shock > > tube solution. > > > > If anyone has ever tried, I would be infinitely grateful if they were to > > share their knowledge !! > > > > Thank you very much, > > > > T. BRIDEL-BERTOMEU > > > > > > > > ___ > > fipy mailing list > > fipy@nist.gov > > http://www.ctcms.nist.gov/fipy > > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > > > > > -- > Daniel Wheeler > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > #!/usr/bin/env python import fipy from fipy import numerix #== nx = 1000 dx = 1./nx Lx = nx * dx gamma = 1.4 gm1 = gamma-1.0 #-- mesh = fipy.Grid1D(nx=nx, dx=dx) X = mesh.cellCenters[0] x = mesh.faceCenters[0] #-- ro = fipy.CellVariable(mesh=mesh, name="ro", hasOld=True) roU = fipy.CellVariable(mesh=mesh, name="roU", hasOld=True) roE = fipy.CellVariable(mesh=mesh, name="roE", hasOld=True) ro.setValue( 1.0*(X<=0.5)+0.125*(X>0.5) ) roU.setValue( 0.0 ) roE.setValue( 1.0/gm1*(X<=0.5)+0.1/gm1*(X>0.5) ) ro.constrain(value=1.0, where=mesh.facesLeft) ro.constrain(value=0.125, whe
Re: Compressible euler equations
Hi Thibault, I started down the road of implementing a Riemann solver in FiPy, see https://github.com/usnistgov/fipy/blob/riemann/fipy/terms/baseRoeConvectionTerm.py Unfortunately, I never completed and merged this work. You might want to look into CLAWPACK for a code to better handle compressible flow. I've given a few answers about this in the past as well, see - http://git.net/ml/python-fipy/2012-02/msg00024.html - http://fipy.nist.narkive.com/A0gJrSl2/semilinear-wave-equation-in-fipy - http://fipy.nist.narkive.com/YVZTRM0G/1d-coupled-fluid-equations-in-fipy Cheers, Daniel On Sun, May 14, 2017 at 9:33 AM, Thibault Bridel-Bertomeu wrote: > Good afternoon, > > I was wondering if anyone had ever tried implementing the compressible euler > equations in FiPy ? > I have been trying for a while now but even in 1D I can’t get a proper shock > tube solution. > > If anyone has ever tried, I would be infinitely grateful if they were to > share their knowledge !! > > Thank you very much, > > T. BRIDEL-BERTOMEU > > > > ___ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel Wheeler ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
Compressible euler equations
Good afternoon, I was wondering if anyone had ever tried implementing the compressible euler equations in FiPy ? I have been trying for a while now but even in 1D I can’t get a proper shock tube solution. If anyone has ever tried, I would be infinitely grateful if they were to share their knowledge !! Thank you very much, T. BRIDEL-BERTOMEU ___ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]