Coder Social home page Coder Social logo

Comments (2)

zingale avatar zingale commented on May 30, 2024

this approach is done in Castro now. As pyro is not meant to be a research
code, I opted for simplicity here.

On Mon, Nov 30, 2015 at 9:56 AM, Ben Wibking [email protected]
wrote:

Energy conservation with body forces can be substantially improved if the
mass fluxes are used, instead of the cell-centered estimates of the work.
For general body forces, I have tested:

   energy_update  = 0.5*dtdy*(Flux_y.v(n=self.vars.idens) + Flux_y.jp(1,n=self.vars.idens)) * \
                     0.5*(old_yacc_src.v() + yacc_src.v())*myg.dy

    energy_update += 0.5*dtdx*(Flux_x.v(n=self.vars.idens) + Flux_x.ip(1,n=self.vars.idens)) * \
                     0.5*(old_xacc_src.v() + xacc_src.v())*myg.dx

    ener.v()[:,:] += energy_update

This is identical to the formulation in Springel 2010 (the Arepo paper).

I also switched the half-step prediction using the primitive variables:

V_l[1:,:,vars.iu] += 0.5*dt*0.5*(xacc_src.d[0:-1,:]+xacc_src.d[1:,:])
V_l[1:,:,vars.iv] += 0.5*dt*0.5*(yacc_src.d[0:-1,:]+yacc_src.d[1:,:])

V_r[1:-1,:,vars.iu] += 0.5*dt*0.5*(xacc_src.d[2:,:]+xacc_src.d[1:-1,:])
V_r[1:-1,:,vars.iv] += 0.5*dt*0.5*(yacc_src.d[2:,:]+yacc_src.d[1:-1,:])

``
and likewise for the y-direction. This seems to work well, though there may be a better way to do the indexing for the half-step variables.


Reply to this email directly or view it on GitHub
https://github.com/zingale/pyro2/issues/5.

Michael Zingale
Associate Professor

Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
11794-3800
phone: 631-632-8225
e-mail: [email protected]
web: http://www.astro.sunysb.edu/mzingale
github: http://github.com/zingale

from pyro2.

BenWibking avatar BenWibking commented on May 30, 2024

That is good to know. It is not apparent from the documentation. It is much easier to learn the state-of-the-art techniques if I only have to read through thousands of lines of source code, rather than tens of thousands of lines!

from pyro2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.