Re: Compressible euler equations

2017-05-17 Thread 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/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
>>
>>-
>> 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 

Re: Fresh installation tests fail

2017-05-17 Thread Daniel Wheeler
Hi Carsten,

I'm not sure why that error is occurring, but the following Dockerfile
works for me.

https://github.com/wd15/extremefill2D-dockerize/blob/master/Dockerfile

It might help you debug. The FiPy version is "3.1.3.dev138+gecbe868".
Maybe try that and see if it helps.

Cheers,

Daniel

On Tue, May 16, 2017 at 5:14 PM, Carsten Langrock  wrote:
> Following installation guide using conda under macOS 10.12.5, I am not able
> to run the fipy.test() function without it throwing an exception. The output
> is listed below. Any hint on how to solve this would be appreciated.
>
> Python 2.7.13 | packaged by conda-forge | (default, May  2 2017, 13:29:36)
> [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
 import fipy
 fipy.test()
> running egg_info
> creating
> /var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info
> writing
> /var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/PKG-INFO
> writing top-level names to
> /var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/top_level.txt
> writing dependency_links to
> /var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/dependency_links.txt
> writing manifest file
> '/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
> reading manifest file
> '/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
> writing manifest file
> '/var/folders/68/q7ztlcxx3nldk6drfnp4l5_hgn/T/tmp6x5SYr/FiPy.egg-info/SOURCES.txt'
> running test
> running build_ext
> fipy version 3.1.3
> numpy version 1.10.4
> pysparse version 1.3-dev
> scipy version 0.17.1
> matplotlib version 2.0.0
> gist is not installed
> mpi4py version 2.0.0
> Trilinos version: 11.10.2
> PyTrilinos version: 4.10d
> mayavi version 4.5.0
> gmsh version 2.15.0
> Traceback (most recent call last):
>   File "", line 1, in 
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/fipy/__init__.py",
> line 164, in test
> cmdclass={'test': _TestClass(_test)})
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/core.py",
> line 151, in setup
> dist.run_commands()
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/dist.py",
> line 953, in run_commands
> self.run_command(cmd)
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/distutils/dist.py",
> line 972, in run_command
> cmd_obj.run()
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/setuptools/command/test.py",
> line 211, in run
> self.run_tests()
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/site-packages/fipy/tests/testClass.py",
> line 236, in run_tests
> testLoader = loader_class()
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py",
> line 94, in __init__
> self.parseArgs(argv)
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py",
> line 149, in parseArgs
> self.createTests()
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/main.py",
> line 158, in createTests
> self.module)
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/loader.py",
> line 130, in loadTestsFromNames
> suites = [self.loadTestsFromName(name, module) for name in names]
>   File
> "/Users/langrock/anaconda/envs/MYFIPYENV/lib/python2.7/unittest/loader.py",
> line 100, in loadTestsFromName
> parent, obj = obj, getattr(obj, part)
> AttributeError: 'module' object has no attribute 'testFiPy'
>
> ___
> 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 ]