User:Tohline/PGE/Hybrid Scheme
From VisTrailsWiki
Contents 
Hybrid Advection Scheme
Preface
March 1, 2014 by Joel E. Tohline
<full preface> … This seemed too good to be true. The discovered code modification would allow us to conserve angular momentum very accurately and, at the same time, allow us to use a rotating grid and thereby minimize numerical diffusion … <read more>
In his dissertation research, Jay Call (see Call, Tohline, & Lehner 2010) derived a complete description of this hybrid advection scheme in a fully relativistic and generalized coordinate framework. He showed that one can write the system of fluid equations in a manner that facilitates advection of inertialframe quantities across a rotating grid. In addition — and more importantly — he showed how to write the system of fluid equations to allow advection of inertialframe angular momentum (generally associated with a cylindrical coordinate mesh) across a rotating Cartesian grid. Since that time, primarily in the context of Zach Byerly's doctoral dissertation research, my group has demonstrated that this hybrid advection scheme works extremely well (see Byerly, AdelsteinLelbach, Tohline, & Marcello (2014)). In the discussion that follows here, we derive the Newtonian version of Jay's hybrid scheme.
 Tiled Menu  Tables of Content  Banner Video  Tohline Home Page  
Setting the Stage
Recognizing Statements of Conservation
When dealing with the compressible fluid equations, we will often encounter hyperbolic PDEs of the following form:



where we are using to represent the velocity field of the fluid as viewed from an inertial frame of reference, and the total (as opposed to partial) time derivative indicates the timerate of change of is being measured in a socalled Lagrangian fashion, that is, at the location of some fluid element and moving along with that fluid element.
When we encounter a situation in which the "source" term, , on the righthand side is zero, we will be able to identify the scalar variable, , as the volume density of some conserved quantity. For example, the continuity equation — which is a mathematical statement of mass conservation — has the form,
where, is the mass per unit volume or, simply, the mass density of the fluid element. Clearly, when the mass of a Lagrangian fluid element is conserved, the fluid element's mass density changes only in accordance with the divergence of the local velocity field.
Similarly, if we are following the evolution of a fluid that expands and contracts adiabatically, we should expect to encounter an equation of the form,



or, equivalently, 



where, is the entropy density of a Lagrangian fluid element. Or, if an axisymmetric distribution of fluid is moving in an axisymmetric potential, we should expect the azimuthal component of the fluid's angular momentum to be conserved, in which case we should expect to encounter a dynamical equation of the form,



where, is the Lagrangian fluid element's (cylindrical radial) distance measured from the symmetry axis of the underlying potential and is the azimuthal component of the inertial velocity field, , at the location of the fluid element.
Alternative Reference Frames
Now, we might want to examine the timedependent behavior of a fluid system while viewing the flow from a reference frame that is more or less moving along with the fluid. This new frame of reference need not be an inertial frame; for example, when studying a rotating fluid, we may want to view the system's evolution from a rotating frame of reference. This will be accomplished mathematically by adjusting the dynamical equations so that the velocity that appears in the divergence term accounts for the new "frame" velocity field; specifically, we want to replace with,



(Here, we will consider only timeindependent functional expressions for the frame velocity, .) Of course, switching to the rotating frame must be done in such a way that the resulting, new PDE describes exactly the same physical behavior of the system as was described by the original equation; that is, the new equation must be derivable from the original one.
If is a divergencefree velocity field, then the transformation is trivial. For example, if we choose a frame of reference that is rotating uniformly with angular velocity, , then,



and, utilizing cylindrical coordinates,



Hence,





so the new generic hyperbolic PDE becomes,



and we can be confident that this new PDE represents the physics of the system just as well as the original PDE.
Eulerian Representation
We can shift any of the PDEs from a Lagrangian to an Eulerian representation — and thereby use them to follow the timerate of change of physical variables at a point in space that is fixed with respect to the chosen frame of reference — by using the following transformation to replace each total time derivative with a partial time derivative:



Hence, the "new" generic hyperbolic PDE derived above can be rewritten as,



or, more succinctly,



This equation also is broadly recognized as a conservation statement because, when , the variable will represent the volume density of a conserved quantity.
We should emphasize that the inertialframe version of this Eulerian conservation equation can be retrieved straightforwardly by setting , which is equivalent to setting . It is,



The physics of the flow that is being described by this PDE is identical to the physics that is described by the preceding PDE. But an important distinction must be made regarding how the two equations are interpreted. The "inertial frame" version of the equation (explicitly containing ) provides the timerate of change of at a fixed point in inertial space, while the "new" version (explicitly containing ) provides the timerate of change of at a fixed point in our "new" rotating coordinate frame.
Angular Momentum Conservation
When the three vector components of the Euler equation (of motion) are projected onto a nonrotating cylindrical coordinate grid, the azimuthal component of the Euler equation may be written as,



For this equation, the source term is identified as,



and is the inertialframe angular momentum density, as measured with respect to the coordinate axis. This corresponds the scalar equation and representation referred to as "Case B ()" in CTL (2010).
From Tables 6.1 & 6.2 of Call, Tohline, & Lehner (2010)






As foreshadowed above — see the subsection titled, Recognizing Statements of Conservation — the angular momentum of a Lagrangian fluid element will be conserved if the "source" term, . This situation will arise if, at the fluid element's location, the azimuthal pressure variation, , and the azimuthal variation in the gravitational potential, , are both zero, or if the two balance one another (i.e.,).
Based on the above discussion, we can equally well view the flow from a frame of reference that is rotating with a constant angular velocity, , and write,



where, as before,



Also, following the earlier discussion, if one wants to follow the timevariation of the fluid's inertialframe angular momentum at a fixed location in inertial space, then the appropriate Eulerian representation of this azimuthal component of the equation of motion is,



If, however, one wants to follow the timevariation of the fluid's inertialframe angular momentum at a fixed location on a rotating coordinate grid, then the appropriate Eulerian representation of this azimuthal component of the equation of motion is obtained by replacing the "transport" velocity, with ; specifically,



An Element of the Hybrid Scheme
This last equation displays one subtle, but valuable, element of the hybrid scheme developed by Call, Tohline, & Lehner (2010). The velocity component, , that appears in the formulation of the relevant conserved quantity — the inertialframe angular momentum density — is drawn from the velocity vector, , which is different from the transport velocity vector, , that defines the Eulerian frame from which the dynamical evolution of the system is being viewed. This equation is usually written, instead, in a form such that the angular momentum density is expressed in terms of the azimuthal component of the transport velocity; see, for example, equation (7) in Norman & Wilson (1978) and equation (12) in New & Tohline (1997). In this more familiar formulation, the momentum density and the transport velocity both directly refer to the same frame of reference. But, as a consequence, the source term is more complicated.
The more familiar formulation — including its modified source term — can be derived from our "hybrid" formulation by recognizing that,



So we can write,



where, as shorthand, we have used,



This implies,









As we see, all terms involving the velocity now explicitly refer to and, hence, to the velocity as measured in the rotating reference frame. But the source now includes a Coriolis term. This corresponds the scalar equation and representation referred to as "Case B ()" in CTL (2010).
From Tables 6.1 & 6.2 of Call, Tohline, & Lehner (2010)






Even Broader Generalization
As Call, Tohline, & Lehner (2010) point out, we are free to measure — and follow the evolution of — the angular momentum density with respect to any of a variety of different rotating frames of reference. Specifically, we are not constrained to choose between the inertial (nonrotating) frame — in which the measured angular momentum density is — and the "grid" frame — in which the measured angular momentum density is . Quite generally, we can choose to measure the angular momentum with respect to a separate "primed" frame that is rotating with angular velocity and in which the measured azimuthal component of the fluid velocity is,
With this definition in hand, we also recognize that,
These two substitutions allow us to rewrite the angular momentum evolution equation in the forms that Call, Tohline, & Lehner (2010) label as Case C () and Case C ().
From Tables 6.1 & 6.2 of Call, Tohline, & Lehner (2010)






From Tables 6.1 & 6.2 of Call, Tohline, & Lehner (2010)






In the latter case, becomes , as it should, when the choice is made to measure the angular momentum density in the "grid" frame, that is, when the choice is made to set .
Zach's Dissertation Paper
Section 2.3
Building on our introductory discussion of the Euler equation (see also Appendix 1.D, §3 of BT87), we begin with the,
Lagrangian Representation
of the Euler Equation
as viewed from a Rotating Reference Frame
,
where we choose to define the frame rotation by the vector,
and,



is the velocity field as viewed from the frame of reference that is rotating at constant angular frequency, . (Note that we can retrieve the inertialframe Euler equation and inertialframe variables by setting at any point in the subsequent derivations.) Because the velocity field introduced by frame rotation is divergence free, that is, because,



the relevant (rotatingframe) continuity equation is identical in form to its inertialframe counterpart, specifically,



We can transform the above rotatingframe Euler equation to a momentum conservation equation by multiplying the equation through by and using the continuity equation to combine and simplify the lefthandside, obtaining,
,
In order to convert this generalpurpose vector equation into the specific set of scalar component equations that embody the desired elements of our hybrid scheme, we need to:
 Step 1: Choose the unitvector basis set associated with the momentum components that we want to track — if tracking linear momentum, or, if tracking radial and angular momentum — and break the vector equation into these specified components;
 Step 2: In all relevant equations, replace the scalar components of the "rotatingframe" momentum density with the scalar components of the "intertialframe" momentum density, drawing each component relation from the vector transformation, ;
 Step 3: Write all of the spatial operators in terms of spatial derivatives that are associated with the unitvector basis set of the desired computational mesh.
Focus on Tracking Linear Momentum
Step 1
If the focus is on tracking linear momentum components, then we need to break the vector momentum equation into its components. This is done by, in turn, "dotting" each unit vector into the vector equation. It is straightforward once we appreciate that the orientation of these Cartesian unit vectors does not vary in space and that, within the context of the rotating frame on which they are defined, these unit vectors do not vary in time. Hence, the first term in the vector equation — the material time derivative — can be written as,
and the process of "dotting" each unit vector into the equation leads to the following set of scalar momentumcomponent equations:
























In deriving these expressions, we also (a) have recognized from the start that, when expressed in Cartesian coordinates,









and (b) have used the familiar operator mapping,
to shift from the total (Lagrangian) time derivative to the partial (Eulerian) time derivative, which is usually the more desirable representation for computational simulations.
Step 2
Next, throughout this set of scalar equations, we replace each component of with the corresponding component of , that is, we perform the following mappings:









As a result, the first of the three "hybrid" momentumcomponent equations becomes,






Referencing the continuity equation, the middle bracketed term on the lefthand side can be set to zero; and the last term on the lefthand side,



can be combined with terms on the righthand side — cutting the Coriolis term in half and canceling the centrifugal acceleration term — to give,



Following a similar sequence of steps, the other two "hybrid" momentum conservation relations become,






Step 3
Cartesian Grid: Assuming the numerical simulation will be conducted on a Cartesian coordinate mesh, the divergence (advection) term on the lefthandside should be evaluated by breaking the transport velocity into its three Cartesian components,
and, on the righthandside, the projection of the spatial operators should be written in the familiar form,
In summary, then, the relevant set of momentum conservation equations is,
Cartesian Components of the InertialFrame Momentum 

 
This is the set of equations that has served as the foundation of the Cartesian simulations reported in Byerly, AdelsteinLelbach, Tohline, & Marcello (2014). 
Cylindrical Grid: If, instead, the numerical simulation is to be conducted on a cylindrical coordinate mesh, the spatial operators on both sides of the component momentum equations should be broken down into their cylindricalcoordinate components. In concert with this, the divergence (advection) term on the lefthandside should be evaluated by breaking the transport velocity into its three cylindrical components,
Furthermore, recognizing that, when written in cylindrical coordinates, the gradient operator is,
and that the unit vectors in cylindrical coordinates can be related to their Cartesian counterparts via the mappings,
the relevant projections of the gradient operator on the righthandsides of the governing equations should take the form,









In summary, then, the relevant set of momentum conservation equations is,
Cartesian Components of the InertialFrame Momentum 


Focus on Tracking Angular Momentum
Step 1
If the focus is on tracking angular momentum, then we need to break the vector momentum equation into its components. As before, this is done by "dotting" each unit vector into the vector equation. This is less straightforward than in the Cartesian case because the orientation of both the and unit vectors vary in space. As a result, the first term in the vector equation — the material time derivative — generates a couple of extra terms, viz.,









We also recognize that, when expressed in cylindrical coordinates,









Hence, the process of "dotting" each unit vector into the equation leads to the following set of scalar momentumcomponent equations:
















(mult. thru by R) 















ASIDE: If we pause our discussion here and map this set of component equations onto a (rotating) cylindrical coordinate mesh — that is, if on the righthandsides we implement the straightforward operator projections,
we obtain a formulation that is familiar to the astrophysics community. For example, as the following table of equations illustrates, it is the component set that has been spelled out in equations (5)  (7) of Norman & Wilson (1978) and equations (11), (12), & (3) of New & Tohline (1997).
Cylindrical Components of the RotatingFrame Momentum 


Paragraph extracted without modification from p. 499 of M. L. Norman & J. R. Wilson (1978)
"The Fragmentation of Isothermal Rings and Star Formation"
ApJ, vol. 224, pp. 497511 © American Astronomical Society 
Note: For complete correspondence with equations derived herein, set in all three component equations. 
Equations extracted^{†} from K. C. B. New & J. E. Tohline (1997)
"The Relative Stability Against Merger of Close, Compact Binaries"
ApJ, vol. 490, pp. 311327 © American Astronomical Society 
^{†}Mathematical expressions displayed here, as a single digital image, with presentation order & layout modified from the original publication.
Note: When comparing this set of equations to the set presented by Norman & Wilson (1978), the definitions of the variables, and , must be swapped. 
[Comment by J. E. Tohline (April 7, 2014)] This is the set of equations that my research group has been using to simulate a wide variety of astrophysical fluid flows over the past twenty years. This is no longer our method of choice, however. A numerical algorithm based on the hybrid scheme, as summarized below, is far preferable to an algorithm that is based on this more familiar, traditional set of equations for several reasons:
 In the hybrid scheme, the Coriolis term disappears from the source term, so it is much easier to design and implement a computational algorithm that conserves angular momentum conservation.
 Although the hybrid scheme advects inertialframe angular momentum, it retains all of the advantages associated with using a rotating frame of reference; for example, numerical diffusion is less severe and, in general, the Courantlimited timestep is larger than would be the case if you were forced to transport fluid in the inertial frame of reference.
 The hybrid scheme facilitates transport (and conservation) of angular momentum across a (rotating) Cartesian mesh. This facilitates the use of adaptivemesh refinement (AMR) techniques and simplifies loadbalancing on distributed memory, highperformance computers.
Step 2
Next, throughout this set of scalar equations, we replace each component of with the corresponding component of , that is, we perform the following mappings:









As a result, the first and third of the three "hybrid" momentumcomponent equations become, respectively,








The second of the three "hybrid" momentum component equations — the one governing conservation of angular momentum — becomes,






Referencing the continuity equation, as before, the middle bracketed term on the lefthand side can be set to zero; and the last term on the lefthand side,



matches and, hence, exactly cancels the Coriolis term on the righthand side to give,




Step 3
Cylindrical Grid: If the numerical simulation is to be conducted on a cylindrical coordinate mesh, the spatial operators on both sides of the component momentum equations should be broken down into their cylindricalcoordinate components. That is, as in the above "ASIDE," the appropriate operator projections on the righthandsides of the equations are,
In concert with this, the divergence (advection) term on the lefthandside should be evaluated by breaking the transport velocity into its three cylindrical components,
The relevant set of momentum conservation equations is, therefore,
Cylindrical Components of the InertialFrame Momentum 


Cartesian Grid: If, instead, the numerical simulation is to be conducted on a Cartesian coordinate mesh, the spatial operators on both sides of the component momentum equations should be broken down into their Cartesiancoordinate components. In concert with this, the divergence (advection) term on the lefthandside should be evaluated by breaking the transport velocity into its three Cartesian components,
Furthermore, recognizing that, when written in Cartesian coordinates, the gradient operator is,
and that the unit vectors in Cartesian coordinates can be related to their cylindrical counterparts via the mappings,
the relevant projections of the gradient operator on the righthandsides of the governing equations should take the form,









In summary, then, the relevant set of momentum conservation equations is,
Cylindrical Components of the InertialFrame Momentum 

 
This is the set of equations that has served as the foundation of the socalled Hybrid simulations reported in Byerly, AdelsteinLelbach, Tohline, & Marcello (2014). 
Related Discussions
 Jay Call's dissertation at LSU
 Euler equation viewed from a rotating frame of reference, or Main Page.
 An earlier draft of this "Euler equation" presentation.
 Early draft of Hybrid Scheme discussion: Appendix/Ramblings/Hybrid Scheme Old
© 2014  2019 by Joel E. Tohline 