Skip to content

Adding volume postprocessor#916

Open
andrsd wants to merge 15 commits intoOpen-Sn:mainfrom
andrsd:vol-pps
Open

Adding volume postprocessor#916
andrsd wants to merge 15 commits intoOpen-Sn:mainfrom
andrsd:vol-pps

Conversation

@andrsd
Copy link
Copy Markdown
Collaborator

@andrsd andrsd commented Feb 2, 2026

Ref #856

@andrsd andrsd self-assigned this Feb 2, 2026
@andrsd andrsd added the enhancement New feature or request label Feb 2, 2026
@andrsd andrsd marked this pull request as draft February 2, 2026 20:08
@andrsd
Copy link
Copy Markdown
Collaborator Author

andrsd commented Feb 2, 2026

This is on top of #896 - only the top 3 patches are related to PPS.

I am looking for feedback if this is the direction to go to support the other capability described in #856 .
Currently, this can do min, max, average, and integral.
It can be restricted to "group" or "groupset". Restriction to logical volume is possible, but not for materials (I will be adding that).

User can do these things now:

    # integral
    pps_int = VolumePostprocessor(problem=phys, value_type="integral")
    pps_int.Initialize()
    pps_int.Execute()
    vals = pps_int.GetValue()
    print(vals)

    #
    pps_min = VolumePostprocessor(problem=phys, value_type="min")
    pps_min.Initialize()
    pps_min.Execute()
    vals = pps_min.GetValue()
    print(vals)

    #
    pps_max = VolumePostprocessor(problem=phys, value_type="max")
    pps_max.Initialize()
    pps_max.Execute()
    vals = pps_max.GetValue()
    print(vals)

    #
    vol0 = RPPLogicalVolume(infx=True, infy=True, zmin=0.2, zmax=1.6)
    pps_avg = VolumePostprocessor(problem=phys, value_type="avg", logical_volume=vol0, group=0)
    pps_avg.Initialize()
    pps_avg.Execute()
    vals = pps_avg.GetValue()
    print(vals)

NOTE: ignore all the duplicated code, I needed something quick that I can test.

I will be creating tests for the current capability - I tried only very simple things.

@ragusa
Copy link
Copy Markdown
Contributor

ragusa commented Feb 2, 2026

quick and likely silly quesiton: why an initilaizer() function? can we execute multiple times a PP?

@andrsd
Copy link
Copy Markdown
Collaborator Author

andrsd commented Feb 4, 2026

quick and likely silly quesiton: why an initilaizer() function?

Currently the only reason is to match the API pattern in things like Solvers, some FieldFunctions. If we ever needed polymorphism, it is where it would need to go. But, maybe I can just make it protected and call it from the ctor for right now..

can we execute multiple times a PP?

Yes. However, I do not have any API that would change the class so that Execute would give a different answer ATM. Do you think that would be needed (e.g. in transient runs)? Or should there be just Compute() that would compute the value and would return it back (i.e. Execute + GetValue would become a single API)?

@andrsd andrsd requested review from ragusa and wdhawkins March 3, 2026 16:38
@andrsd andrsd marked this pull request as ready for review March 3, 2026 16:38
@andrsd andrsd changed the title PREVIEW: volume postprocessor Adding volume postprocessor Mar 3, 2026
@andrsd andrsd force-pushed the vol-pps branch 2 times, most recently from b472efb to 0205b30 Compare March 6, 2026 17:36
@andrsd andrsd force-pushed the vol-pps branch 6 times, most recently from c6e0424 to 1b876a6 Compare March 19, 2026 17:42
@wdhawkins
Copy link
Copy Markdown
Collaborator

This looks good, but I don't see support for the optional multiplier. Did I miss that?

@ragusa
Copy link
Copy Markdown
Contributor

ragusa commented Mar 25, 2026

This looks good, but I don't see support for the optional multiplier. Did I miss that?

I concur with Daryl. Earlier today, I was wondering how to compute reaction rates. Here's the blurb from the issue. The none (current status) and the constant are trivial. The group vector is a bit annoying and you could leave it out for now (the issue I note with it is that I would recommend that the user always supplies a vector of lengths equals tot he total number of groups in the problem, even if a few groups are requested in the edit. The reason is that it makes the group sets easier to handle). The xs or material dependent is, however, very important to add.


Multiplier / response

Supported types (v1)

  • none
    $R_{c,g}=1$
  • constant
    $R_{c,g}=c$
  • group_vector
    $R_{c,g}=R_g$
  • xs
    $R_{c,g} = \text{XS}[material(c), g]$

XS sources

  • Solver-available XS (examples): sigma_t, sigma_a, sigma_f, etc.
  • Response-only XS (examples): kappa_sigma_f, edep, dpa, charge_dep, etc.

Material dependence rule

If the multiplier is material-dependent, it is evaluated using each selected cell’s material ID:
$R_{c,g} = R_{\text{material}(c),g}$

@andrsd
Copy link
Copy Markdown
Collaborator Author

andrsd commented Mar 25, 2026

My understanding was that @kitamuraa24 was assigned to implemented this and he has some code for that as far as I am aware. But I have not seen that, so IDK in which state that is.

@wdhawkins
Copy link
Copy Markdown
Collaborator

My understanding was that @kitamuraa24 was assigned to implemented this and he has some code for that as far as I am aware. But I have not seen that, so IDK in which state that is.

I knew he was working on a solution for his project, but I didn't realize it was intended to supplement the vpp work.

@kitamuraa24
Copy link
Copy Markdown
Contributor

kitamuraa24 commented Mar 25, 2026

Hi, I have some stuff here with a unit test based off the reed problem; but it does not test multigroup fluxes or the block_id filtering. I have tested for the block_id, but I have not yet tested the multigroup fluxes yet. Here is my branch: features/reaction_rates. The implementation here is based off utilizing field functions.

@ragusa
Copy link
Copy Markdown
Contributor

ragusa commented Mar 25, 2026

@andrsd (cc @wdhawkins ) I think you should add the multiplier. Can you do this today? Tomorrow, Daryl and I have a session planned to use the VPP for sensitivity and we'd like to base it on the VPP and would prefer to branch out from main instead of from this PR.

@andrsd
Copy link
Copy Markdown
Collaborator Author

andrsd commented Mar 25, 2026

I think you should add the multiplier. Can you do this today?

I should be able to get it in today.

@andrsd andrsd force-pushed the vol-pps branch 2 times, most recently from d1b4736 to cd0aea0 Compare March 29, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants