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

Add VTX Temperature Export #950

Open
wants to merge 25 commits into
base: fenicsx
Choose a base branch
from

Conversation

kaelyndunnell
Copy link
Contributor

Proposed changes

Add VTX Temperature Export for HydrogenTransportProblem Class.

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

Hi Kaelyn, again very much needed. Can you update your branch with fenicsx?

git fetch upstream
git merge upstream/main
git push

Comment on lines +377 to +378
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1)
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why create a unit square mesh everytime??? what if it's a 1D simulation?

You can use the mesh of the simulation directly:

Suggested change
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1)
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1))
V = dolfinx.fem.FunctionSpace(self.mesh, ("CG", 1))

mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1)
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1))
temperature_field = dolfinx.fem.Function(V)
temperature_field.interpolate(lambda x: np.full(x.shape[1], self.temperature_fenics))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why x.shape[1]?

@@ -786,6 +805,8 @@ def update_time_dependent_values(self):
if source.temperature_dependent:
source.update(t=t)

surface_temp_processed = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this?

Comment on lines +376 to +380
else:
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1)
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1))
temperature_field = dolfinx.fem.Function(V)
temperature_field.interpolate(lambda x: np.full(x.shape[1], self.temperature_fenics))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand that this handles the case where self.temperature_fenics is a fem.Constant. What if this constant is updated in time? Then the newly created fem.Function will not be updated, correct? can we test this?

If that's the case, we probably need to add something to post_processing to update it in time

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.

2 participants