Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Finite-Difference formulation #474

Merged
merged 14 commits into from
Jun 28, 2023
Merged

Conversation

rpvin
Copy link
Contributor

@rpvin rpvin commented Jun 16, 2023

Added all the necessary changes required to run the benchmarks on uniform FD grids when dr_input is not specified. When dr_input is specified using Fortran-based syntax in the main_input file, Rayleigh can be run with a non-uniform grid. Currently, when the chebyshev flag is set to false, finite-difference is activated.

@gassmoeller gassmoeller marked this pull request as ready for review June 16, 2023 17:11
@feathern
Copy link
Contributor

Is this ready for a review, or is this still work-in-progress?

@rpvin
Copy link
Contributor Author

rpvin commented Jun 17, 2023 via email

@tukss
Copy link
Contributor

tukss commented Jun 19, 2023

These are the results of a long, anelastic finite difference run with MHD. It ran for 6.1e8 s. The results look pretty good to me.

 ///////////////////////////////////////////////////////////////////////////
               RAYLEIGH ACCURACY BENCHMARK SUMMARY               
  
   Benchmark:  Jones et al. 2001  (Steady Dynamo Case)
  
   Radial Resolution      N_R =          128
   Angular Resolution N_theta =          192
  
   Averaging Interval (seconds) :   1.800000E+05
  
   Beginning Iteration :      3085100
   Ending Iteration    :      3086000
   Number of Samples   :           10
 ----------------------------------------------------------------------------
   Observable      |    Measured    | Suggested   | % Difference |  Std. Dev.
 ----------------------------------------------------------------------------
   Kinetic Energy  :  8.119345E+36  8.036230E+36  1.034251E+00  1.587161E+32
   Zonal KE        :  1.187032E+36  1.153180E+36  2.935532E+00  6.838595E+31
   Meridional KE   :  1.029017E+33  1.015870E+33  1.294139E+00  2.528745E+28
   Magnetic Energy :  6.019203E+36  6.133330E+36 -1.860765E+00  2.446445E+32
   Zonal ME        :  4.520376E+36  4.620460E+36 -2.166101E+00  2.100449E+32
   Meridional ME   :  3.147325E+35  3.249270E+35 -3.137471E+00  2.154197E+31
   Entropy         :  6.111929E+05  6.089300E+05  3.716264E-01  1.827545E-01
   Vphi            : -2.998166E+03 -2.942200E+03  1.902197E+00  3.806120E-02
   Btheta          :  2.602995E+02  2.729200E+02 -4.624238E+00  5.981200E-03
   Drift Frequency :  4.296363E-06  4.307600E-06 -2.608559E-01  2.182600E-11

@rpvin
Copy link
Contributor Author

rpvin commented Jun 19, 2023 via email

@tukss tukss requested a review from feathern June 19, 2023 13:46
@feathern
Copy link
Contributor

The results look good to me as well. The drift frequency is particularly hard to get correct if something is off. Did that run use the strict_L_conservation flag? Since this will be need a pretty lengthy read through, it will probably be next week before I can do a careful code review.

@feathern
Copy link
Contributor

Oh. One additional request. Can you possibly run this with 200 radial points (uniform grid) and see what the results look like? I seem to recall that that's the number we used with ASH several years ago, and I think most of the numbers were spot on at that resolution.

@tukss
Copy link
Contributor

tukss commented Jun 21, 2023

Did that run use the strict_L_conservation flag?

Yes, that flag was switched on.

@tukss
Copy link
Contributor

tukss commented Jun 22, 2023

Oh. One additional request. Can you possibly run this with 200 radial points (uniform grid) and see what the results look like? I seem to recall that that's the number we used with ASH several years ago, and I think most of the numbers were spot on at that resolution.

This is what I'm getting for 200 radial points. Looks like we're really close to the expected result.

 ///////////////////////////////////////////////////////////////////////////
               RAYLEIGH ACCURACY BENCHMARK SUMMARY               
  
   Benchmark:  Jones et al. 2001  (Steady Dynamo Case)
  
   Radial Resolution      N_R =          200
   Angular Resolution N_theta =          192
  
   Averaging Interval (seconds) :   1.980000E+06
  
   Beginning Iteration :      4200100
   Ending Iteration    :      4210000
   Number of Samples   :          100
 ----------------------------------------------------------------------------
   Observable      |    Measured    | Suggested   | % Difference |  Std. Dev.
 ----------------------------------------------------------------------------
   Kinetic Energy  :  8.037441E+36  8.036230E+36  1.507482E-02  5.035889E+29
   Zonal KE        :  1.152928E+36  1.153180E+36 -2.189514E-02  2.117157E+29
   Meridional KE   :  1.015979E+33  1.015870E+33  1.077104E-02  8.544276E+25
   Magnetic Energy :  6.137821E+36  6.133330E+36  7.322252E-02  7.714003E+29
   Zonal ME        :  4.623474E+36  4.620460E+36  6.522686E-02  6.648745E+29
   Meridional ME   :  3.253103E+35  3.249270E+35  1.179795E-01  6.914827E+28
   Entropy         :  6.089087E+05  6.089300E+05 -3.502790E-03  1.616939E-01
   Vphi            : -2.938927E+03 -2.942200E+03 -1.112285E-01  3.003451E-02
   Btheta          :  2.725399E+02  2.729200E+02 -1.392809E-01  1.544048E-03
   Drift Frequency :  4.307537E-06  4.307600E-06 -1.461858E-03  1.173114E-12

@feathern
Copy link
Contributor

Awesome. OK, I will do a code review next week once I'm freed from proposal purgatory this Friday!

Copy link
Contributor

@feathern feathern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I have three small requested changes:
1.) Can you fix the indent on line 54 of Sphere_Spectral_Space.F90?
2.) Could you provide the FD input file that you used to pass the Jone MHD benchmark?
3.) Can you provide a summary of the various new input parameter names and what they do? Once I have that info and an example input file, I can write a short blurb in the documentation about the 4th-order FD method and submit that as a separate PR..

@rpvin
Copy link
Contributor Author

rpvin commented Jun 28, 2023 via email

@feathern
Copy link
Contributor

Hey Rathish. I'm still not seeing the input files. If you place them Rayleigh/input_examples on your branch and commit/push, they should appear here without the need to initiate another PR.

@rpvin
Copy link
Contributor Author

rpvin commented Jun 28, 2023 via email

@feathern
Copy link
Contributor

Wonderful! Merging now. Thanks for the hard work on this!

@feathern feathern merged commit bbf4f69 into geodynamics:main Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants