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
<thibault.bridellel...@gmail.com> 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 <daniel.wheel...@gmail.com>:
>>
>> 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
>> <thibault.bridellel...@gmail.com> 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 ]
>
>
>
> _______________________________________________
> 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 ]

Reply via email to