Thermodynamics and Fluid Mechanics Thermodynamics and Fluid Mechanics Physics Help Forum Feb 14th 2010, 04:32 AM #1 Junior Member   Join Date: Nov 2009 Posts: 3 Energy Values Hi all, I have written a program that numerically solves the Euler equations and it does this correctly. I am now trying to calculate the total energy at each time step using the following: $\displaystyle E=\int_{0}^{L}{}\int_{0}^{L}\frac{1}{2}\rho (H(u^{2}+v^{2})+g\eta^{2})dxdy$ To calculate this I am using the following code: Code: for (int i = 1; i <= N-1; i++){ for (int j = 1; j <= N-1; j++){ double x = 0.5*rho*(H*(pow(u.getValue(i,j,N),2) + pow(v.getValue(i,j,N),2)) + g*pow(eta.getValue(i,j,N),2));//*Deltax*Deltay; energy.setValue(i,j,N,x); } } My question is this... Do I need to include the dx and dy at the end of the calculation. I calculate the difference between the exact and the approximate after the energy reaches steady state and when I add the dxdy the value is huge 3.61x10^14. Since the lengthscale is 1,000,000 m and my grid is 10x10, dx and dy are 100,000 each. The analytic and numerical are supposed to converge as the number of grid sizes increases and they do but it is difficult to tell. 3.61x10^14, 2.7x10^14, 2.1x10^14... when I don't include dxdy it is more like 908,767, 604,653, 477,999 ... which seems more sensible which of the following seem sensible for ocean gyre energy values? 7x10^15 J or 230,000 J really sorry for the long post   Feb 14th 2010, 12:20 PM #2 Member   Join Date: Feb 2010 Posts: 66 An typical electric heater uses 2000J every second.  Tags energy, values Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Similar Physics Forum Discussions Thread Thread Starter Forum Replies Last Post thinhnghiem Light and Optics 1 Aug 30th 2016 09:51 AM ling233 Nuclear and Particle Physics 3 Oct 20th 2014 03:27 PM hooperoo Kinematics and Dynamics 2 Aug 3rd 2013 03:28 PM stealth Electricity and Magnetism 1 Feb 28th 2010 10:37 PM s3a Energy and Work 1 May 28th 2009 06:02 PM