multi-rate time integration using sundials #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds multi-rate time integration support using SUNDIALS library.
Code compiles, runs, and gives correct answers using both single rate and multi rate options.
I have added two input files which I used to test :
inputs_mfim_sundials
for single rate methodinputs_mfim_sundials_mri
for multi-rate methodResult at same physical time using the two input files are shown below:
![image](https://private-user-images.githubusercontent.com/89051199/373369027-47627285-f6be-4851-a646-4b69e922c27e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk3ODksIm5iZiI6MTczOTE4OTQ4OSwicGF0aCI6Ii84OTA1MTE5OS8zNzMzNjkwMjctNDc2MjcyODUtZjZiZS00ODUxLWE2NDYtNGI2OWU5MjJjMjdlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEyMTEyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzYTQwNTVkYTEzMGE2MmY0MjQzYmM4YzQ2ZjlkNmQ0MTQzMWJjYTcxYTk3MjBmY2RmM2VlMTIwNDZkYmYzNTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.M4V2ZJJRvrBvCwbCbpsI-9zzaZQYGkyPfpa8NMcbt-s)
Using single rate method
Using multi-rate method
![image](https://private-user-images.githubusercontent.com/89051199/373368429-fec480aa-61f4-4cdd-b0d8-ed41ced267cb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk3ODksIm5iZiI6MTczOTE4OTQ4OSwicGF0aCI6Ii84OTA1MTE5OS8zNzMzNjg0MjktZmVjNDgwYWEtNjFmNC00Y2RkLWIwZDgtZWQ0MWNlZDI2N2NiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEyMTEyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ0N2IyNjc2OTFjMGQ0NWJkZTIyODRmMzQxNzg3ZjYyNTE1NmViYzJjNTUzMjhkNzVlODlmYjA3ZDk4Njg0MDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vn3VvBbLM0jUx8EsOLSJQFMngw9EstAoLePY0Feip3s)
I am able to use a 5x larger time step with MRI [will check if I can increase it even more].
Overall simulation time to reach same physical time of 4e-10 s:
single rate: 1861.619992 seconds
multi rate : 415.7616465 seconds
So, MRI is roughly 4.5 x faster than single rate for the above test.