# Current scores tally

**URL:** <https://openmc.discourse.group/t/current-scores-tally/1539>\
**Category:** User Support\
**Created:** [November 16, 2021, 10:41am UTC](https://openmc.discourse.group/t/current-scores-tally/1539 "2021-11-16T10:41:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eyvaz](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@Eyvaz](https://openmc.discourse.group/u/Eyvaz)\
**Post date:** [November 16, 2021, 10:41am UTC](https://openmc.discourse.group/t/current-scores-tally/1539/1 "2021-11-16T10:41:10Z")

</div>

Hello everyone!  
I’m the newest user of Openmc, please help.

How to calculate current scores by changing the energy?  
I don’t know how to complete it

```
tally_forward = openmc.Tally(name="forward current")
tally_backward = openmc.Tally(name="backward current")
tally_forward.scores = ["current"]
tally_backward.scores = ["current"]
sur_fwd_filter = openmc.filter.SurfaceFilter(sample_plane2.id)
sur_bwd_filter = openmc.filter.SurfaceFilter(sample_plane1.id)
from_sample_filter = openmc.filter.CellFromFilter(cell_sample.id)
tally_forward.filters = [sur_fwd_filter, from_sample_filter]
tally_backward.filters = [sur_bwd_filter, from_sample_filter]

```

Best regards

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 19, 2021, 5:06am UTC](https://openmc.discourse.group/t/current-scores-tally/1539/2 "2021-11-19T05:06:40Z")

</div>

Hi @Eyvaz and welcome to the forum. What you have set up there looks like a partial current. If you just use a surface filter and ask for the “current” score, it will give you the net current through the surface. Combining a surface filter and a cellfrom filter allows you to get partial currents. Does that answer your question?

---

<div class="post-metadata">

**Author:** ![Eyvaz](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@Eyvaz](https://openmc.discourse.group/u/Eyvaz)\
**Post date:** [November 19, 2021, 12:26pm UTC](https://openmc.discourse.group/t/current-scores-tally/1539/3 "2021-11-19T12:26:39Z")

</div>

Thank You so much, Mr. Paul Romano.

I run this:

def run\_model():  
!rm \*.h5  
openmc.run(output=False)

create\_model(1e-05, 3.0, add\_forward\_tally=True)  
run\_model()

create\_model(1e-04, 3.0, add\_forward\_tally=True)  
run\_model()

create\_model(1e-03, 3.0, add\_forward\_tally=True)  
run\_model()

But, I obtain an error message. How to correct mistakes here?

Best regards,  
Eyvaz

---

<div class="post-metadata">

**Author:** ![Eyvaz](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@Eyvaz](https://openmc.discourse.group/u/Eyvaz)\
**Post date:** [November 20, 2021, 6:05pm UTC](https://openmc.discourse.group/t/current-scores-tally/1539/4 "2021-11-20T18:05:15Z")

</div>

And how to run and obtain current on the surface of the material by changing energy and thickness?
