Skip to content

Track min and max of important quantities#376

Merged
marchdf merged 10 commits intodevelopmentfrom
bperry/extrema
Nov 19, 2021
Merged

Track min and max of important quantities#376
marchdf merged 10 commits intodevelopmentfrom
bperry/extrema

Conversation

@baperry2
Copy link
Copy Markdown
Contributor

I made some modifications so the terminal output and datalog files track extrema of important quantities (e.g., species mass fractions) for debugging purposes and thought it might be generally useful. This tracking occurs at the same intervals as tracking integrated quantities but can be turned off independently.

Some notes:

  • I modified the function maxDerive, which in the previous implementation ignored coarse cells covered by fine cells (good), but assumed maxima were positive (bad, e.g. for eint). The new implementation does not ignore covered cells, but this should be okay - average down is always called before the tracking, so covered cells should never have more extreme values than the cells covering them.
  • "massfrac" reports extrema across all mass fractions. The individual extrema for the species mass fractions corresponding to pelec.fuel_name, pelec.ftrac_spec_name, and a new input called pelec.extrema_spec_name are also reported if these input parameters are specified.

@baperry2 baperry2 requested a review from marchdf November 16, 2021 23:52
@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

Hey Bruce, this is great! There are a bunch of things the linter picked up if you wouldn't mind fixing those. I left some other minor comments

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

Is there a reason not to just output the extrema of all the mass fractions? I guess it can get verbose...

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

And can you post an example of the log file with these modifications? Curious to see what it looks like.

@baperry2
Copy link
Copy Markdown
Contributor Author

Here is what the output looks like:
Screen Shot 2021-11-17 at 9 34 23 AM

And here is the log file:
Screen Shot 2021-11-17 at 9 34 03 AM

@jrood-nrel
Copy link
Copy Markdown
Contributor

I think I would be fine replacing the integrated quantities with this.

@shashankNREL
Copy link
Copy Markdown
Contributor

@baperry2 : A small suggestion - can you either print on the screen as exponentials with only a few digits or print just the one decimal point. We perhaps don't need that much resolution in min and max. You can retain the full in the log file.

@shashankNREL
Copy link
Copy Markdown
Contributor

@baperry2 : A small suggestion - can you either print on the screen as exponentials with only a few digits or print just the one decimal point. We perhaps don't need that much resolution in min and max. You can retain the full in the log file.

@baperry2 baperry2 reopened this Nov 17, 2021
@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

I think I would be fine replacing the integrated quantities with this.

I want to keep the integrated quantities. I use them for things like TG and quick plotting of integral quantities.

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

@baperry2 : A small suggestion - can you either print on the screen as exponentials with only a few digits or print just the one decimal point. We perhaps don't need that much resolution in min and max. You can retain the full in the log file.

I second this. Can we also make it look more like the other ones instead of whitespace before the name, make the whitespace between the name and the equal? Also, a space between MIN/MAX and = sign?

@baperry2
Copy link
Copy Markdown
Contributor Author

Okay, I think I addressed all of the above comments. I also added tracking for the sum of mass fractions (actually sumY - 1 to make any discrepancy easier to track without requiring crazy precision). And I added an option to print extrema for all mass fractions by setting pelec.extrema_spec_name = ALL.

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

Excellent idea. Can you repost the new output here?

@baperry2
Copy link
Copy Markdown
Contributor Author

baperry2 commented Nov 17, 2021

Log file:
Screen Shot 2021-11-17 at 1 26 58 PM

Output:
Screen Shot 2021-11-17 at 1 26 18 PM

(without the option to print all species to keep these reasonably sized)

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 17, 2021

Sweet. One last thing. Can you remove TEMP from the Integrated quantities ?

@jrood-nrel
Copy link
Copy Markdown
Contributor

Do we need to list TIME before everything? Looks really redundant now.

@drummerdoc
Copy link
Copy Markdown
Contributor

Not required, but makes it easy to make plots using grep in the log

@jrood-nrel
Copy link
Copy Markdown
Contributor

Maybe we could just use QUANTITY or something.

@baperry2
Copy link
Copy Markdown
Contributor Author

@drummerdoc I've found having TIME in the output handy for the same reason. But the datalog file is there for plotting purposes (except on runs when you didn't set it up, which you sometimes still want to plot).

My preference would be to record datalog files by default.

I need to reshuffle the log file in some way because I noticed it conflicts with the prob log file for some of the test cases.

@baperry2
Copy link
Copy Markdown
Contributor Author

Ok, I removed TEMP but left TIME there. Also modified things so datalogs are specified by name instead of index to avoid potential overlap. I think this is ready to merge.

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Nov 19, 2021

there's even documentation!!

@marchdf marchdf merged commit 8a6ba07 into development Nov 19, 2021
@marchdf marchdf deleted the bperry/extrema branch November 19, 2021 21:33
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.

6 participants