Skip to content

Commit

Permalink
[field] FVM fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Nov 16, 2023
1 parent 9c4804c commit 1baaac8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phi/field/_field_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def laplace(u: Field,
ortho_correction = gradient @ n2
grad = connecting_grad * math.vec_length(n1) + ortho_correction
else:
assert not correct_skew, f"FVM skew correction only available when gradient is specified. Pass gradient or set ignore_skew=False"
assert not correct_skew, f"FVM skew correction only available when gradient is specified. Pass gradient or set correct_skew=False"
grad = connecting_grad
laplace_values = u.mesh.integrate_surface(grad) / u.mesh.volume # 1/V ∑_f ∇T ν A
result = weights * laplace_values if weights is not None else laplace_values
Expand Down
2 changes: 1 addition & 1 deletion phi/field/_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def centroid_to_faces(u: Field, boundary: Extrapolation, order=2, upwind: Field
gradient = green_gauss_gradient(u, order=order, upwind=None, stack_dim=dual('vector')) # we cannot pass same interpolation here
neighbor_grad = u.mesh.pad_boundary(gradient.values, mode=gradient.boundary)
interpolated_from_self = u.values + gradient.values.vector.dual @ (u.mesh.face_centers - u.mesh.center).vector
interpolated_from_neighbor = neighbor_val + neighbor_grad.vector @ (u.mesh.face_centers - (u.mesh.center + u.mesh.neighbor_offsets)).vector
interpolated_from_neighbor = neighbor_val + neighbor_grad.vector.dual @ (u.mesh.face_centers - (u.mesh.center + u.mesh.neighbor_offsets)).vector
# ToDo limiter
result = math.where(flows_out, interpolated_from_self, interpolated_from_neighbor)
return slice_off_constant_faces(result, u.mesh.boundary_faces, boundary)
Expand Down

0 comments on commit 1baaac8

Please sign in to comment.