[yt-users] angular momentum conservation

Matthew Turk matthewturk at gmail.com
Tue Nov 10 07:45:55 PST 2015


Hi Cynthia,

Nathan IMmed me and pointed out that you probably want to do:

Lx, Ly, Lz = sp.total_quantity(["angular_momentum_x",
"angular_momentum_y", "angular_momentum_z"])
L = (Lx**2 + Ly**2 + Lz**2)**0.5

-Matt

On Tue, Nov 10, 2015 at 9:34 AM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi Cynthia,
>
> If I understand what you are trying to do correctly, you can use
> .total_quantity("angular_momentum_magnitude").  But I'd be careful how
> you calculate that precisely, since the "center" field parameter will
> need to be set on the object you're looking at.  For instance:
>
> sp = ds.sphere(...
> sp.set_field_parameter("center", ds.domain_center)
> sp.total_quantity("angular_momentum_magnitude")
>
> Keep in mind also that this will sum up the magnitude of the angular
> momentum *within each cell*, over the whole domain.
>
> On Tue, Nov 10, 2015 at 1:55 AM, Cynthia Saad (Student)
> <crs07 at mail.aub.edu> wrote:
>>
>> hi matt,
>> thank you so much for your help. it worked perfectly.
>> one more thing. for the conservation of angular momentum test, i can get the value of the angular_momentum_vector. but i need the angular_momentum_magnitude. although i can see it in the derived fields list of my simulation. but i am not being able to get its value.
>> any help with that?
>> http://paste.yt-project.org/show/6034/
>>
>> cynthia
>> ________________________________________
>> From: yt-users <yt-users-bounces at lists.spacepope.org> on behalf of yt-users-request at lists.spacepope.org <yt-users-request at lists.spacepope.org>
>> Sent: Monday, November 9, 2015 9:04 PM
>> To: yt-users at lists.spacepope.org
>> Subject: yt-users Digest, Vol 93, Issue 6
>>
>> Send yt-users mailing list submissions to
>>         yt-users at lists.spacepope.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> or, via email, send a message with subject or body 'help' to
>>         yt-users-request at lists.spacepope.org
>>
>> You can reach the person managing the list at
>>         yt-users-owner at lists.spacepope.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of yt-users digest..."
>>
>>
>> Today's Topics:
>>
>>    1. mass conservation-enzo (Cynthia Saad (Student))
>>    2. Re: mass conservation-enzo (Matthew Turk)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Mon, 9 Nov 2015 10:25:38 +0000
>> From: "Cynthia Saad (Student)" <crs07 at mail.aub.edu>
>> To: "yt-users at lists.spacepope.org" <yt-users at lists.spacepope.org>
>> Subject: [yt-users] mass conservation-enzo
>> Message-ID:
>>         <AM3PR06MB1025B0E9082C03F6F2D704E794150 at AM3PR06MB1025.eurprd06.prod.outlook.com>
>>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> hello,
>>
>> i am trying to test for mass conservstion in an enzo simulation.
>>
>> would you please tell me what is wrong with this py script?
>>
>> http://paste.yt-project.org/show/6030/
>>
>>
>>
>> any alternative ideas would be highly appreciated.
>>
>> thanks
>>
>> Cynthia
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20151109/0bc93655/attachment.html>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Mon, 9 Nov 2015 07:49:05 -0600
>> From: Matthew Turk <matthewturk at gmail.com>
>> To: Discussion of the yt analysis package
>>         <yt-users at lists.spacepope.org>
>> Subject: Re: [yt-users] mass conservation-enzo
>> Message-ID:
>>         <CALO3=5FyRBLMqpd-MCPR-Wcu+5qObN3bCNH4YBErYhjqkQ9YVw at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> Hi Cynthia,
>>
>> Ah, this looks like a units thing!  I made a simple change to get rid
>> of the 0 and it worked for me:
>>
>> http://paste.yt-project.org/show/6031/
>>
>> Can you give a shot with that? (I also changed the load command.)
>>
>> -Matt
>>
>> On Mon, Nov 9, 2015 at 4:25 AM, Cynthia Saad (Student)
>> <crs07 at mail.aub.edu> wrote:
>>> hello,
>>>
>>> i am trying to test for mass conservstion in an enzo simulation.
>>>
>>> would you please tell me what is wrong with this py script?
>>>
>>> http://paste.yt-project.org/show/6030/
>>>
>>>
>>>
>>> any alternative ideas would be highly appreciated.
>>>
>>> thanks
>>>
>>> Cynthia
>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>
>>
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>> ------------------------------
>>
>> End of yt-users Digest, Vol 93, Issue 6
>> ***************************************
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list