You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
target offset based on the velocity field `v`. The interpolation is done axis-wise and uses the upwind scheme where values are taken from upstream cells based on the flow direction.
52
55
53
56
The module identifies the interpolation axis (must be a single axis) and selects values from the previous cell for positive velocity or the next cell for negative velocity along that axis.
@@ -73,7 +76,9 @@ def __init__(
73
76
):
74
77
super().__init__()
75
78
self.grid=grid
76
-
self.target_offset=target_offset# this is the offset to which we will interpolate c
79
+
self.target_offset= (
80
+
target_offset# this is the offset to which we will interpolate c
target_offset: offset to which we will interpolate `c`.
351
+
target_offset: offset to which we will interpolate `c`.
339
352
Must have the same length as `c.offset` and differ in at most one entry. This offset should interface as other interpolation methods (take `c`, `v` and `dt` arguments and return value of `c` at offset `offset`).
340
-
limiter: flux limiter function that evaluates the portion of the correction (high_accuracy - low_accuracy) to add to low_accuracy solution based on the ratio of the consecutive gradients.
353
+
limiter: flux limiter function that evaluates the portion of the correction (high_accuracy - low_accuracy) to add to low_accuracy solution based on the ratio of the consecutive gradients.
341
354
Takes array as input and return array of weights. For more details see:
v: GridVariableVector representing the velocity field.
371
392
dt: Time step size (not used in this interpolation).
372
393
373
-
Returns:
374
-
Interpolated scalar field c to a target offset using Van Leer flux limiting, which uses a combination of high and low order methods to produce monotonic interpolation method."""
394
+
Returns:
395
+
Interpolated scalar field c to a target offset using Van Leer flux limiting, which uses a combination of high and low order methods to produce monotonic interpolation method.
assertinterp.target_offset==self.target_offsets[dim], f"Expected flux interpolation for dimension {dim} to have target offset {self.target_offsets[dim]}, but got {interp.target_offset}."
463
-
486
+
assert (
487
+
interp.target_offset==self.target_offsets[dim]
488
+
), f"Expected flux interpolation for dimension {dim} to have target offset {self.target_offsets[dim]}, but got {interp.target_offset}."
489
+
464
490
fordim, interpinenumerate(self._velocity_interp):
465
-
assertinterp.target_offset==self.target_offsets[dim], f"Expected velocity interpolation for dimension {dim} to have target offset {self.target_offsets[dim]}, but got {interp.target_offset}."
491
+
assert (
492
+
interp.target_offset==self.target_offsets[dim]
493
+
), f"Expected velocity interpolation for dimension {dim} to have target offset {self.target_offsets[dim]}, but got {interp.target_offset}."
466
494
467
495
defflux_interp(
468
496
self,
@@ -478,7 +506,9 @@ def velocity_interp(
478
506
self, v: GridVariableVector, *args, **kwargs
479
507
) ->GridVariableVector:
480
508
"""Interpolate the velocity field `v` to the target offsets."""
0 commit comments