Skip to content

Thermal constraints¤

Boundary conditions¤

phydrax.constraints.ContinuousHeatFluxBoundaryConstraint(temperature_var: str, component: DomainComponent, /, *, k: DomainFunction | ArrayLike, flux: DomainFunction | ArrayLike | None = None, var: str = 'x', mode: Literal[reverse, forward] = 'reverse', num_points: int | tuple[Any, ...], structure: Any, sampler: str = 'latin_hypercube', weight: DomainFunction | ArrayLike = 1.0, label: str | None = None, over: str | tuple[str, ...] | None = None, reduction: Literal[mean, integral] = 'mean') -> FunctionalConstraint ¤

Prescribed heat-flux (Neumann) boundary condition.

Enforces \(k\\,\\partial T/\\partial n = q\) on the boundary component, where \(q\) is the heat flux (default \(0\)).

Arguments:

  • temperature_var: Name of the temperature field.
  • component: Boundary component.
  • k: Thermal conductivity.
  • flux: Target flux \(q\) (defaults to 0).
  • var: Geometry variable used to compute normals.
  • mode: Differentiation mode ("reverse" or "forward").
  • num_points: Number of boundary samples.
  • structure: Sampling structure over labels.
  • sampler: Sampling method.
  • weight: Scalar weight.
  • label: Optional label for logging.
  • over: Optional reduction axes.
  • reduction: "mean" or "integral".

Returns:

  • A FunctionalConstraint enforcing the heat-flux condition.

phydrax.constraints.ContinuousConvectionBoundaryConstraint(temperature_var: str, component: DomainComponent, /, *, h: DomainFunction | ArrayLike, k: DomainFunction | ArrayLike, ambient_temp: DomainFunction | ArrayLike | None = None, var: str = 'x', mode: Literal[reverse, forward] = 'reverse', num_points: int | tuple[Any, ...], structure: Any, sampler: str = 'latin_hypercube', weight: DomainFunction | ArrayLike = 1.0, label: str | None = None, over: str | tuple[str, ...] | None = None, reduction: Literal[mean, integral] = 'mean') -> FunctionalConstraint ¤

Convection (Robin) boundary condition.

Enforces \(k\\,\\partial T/\\partial n = h\\,(T - T_\\infty)\) on the boundary component, where \(T_\\infty\) is the ambient temperature (default \(0\)).

Arguments:

  • temperature_var: Name of the temperature field.
  • component: Boundary component.
  • h: Convection coefficient.
  • k: Thermal conductivity.
  • ambient_temp: Ambient temperature \(T_\\infty\) (defaults to 0).
  • var: Geometry variable used to compute normals.
  • mode: Differentiation mode ("reverse" or "forward").
  • num_points: Number of boundary samples.
  • structure: Sampling structure over labels.
  • sampler: Sampling method.
  • weight: Scalar weight.
  • label: Optional label for logging.
  • over: Optional reduction axes.
  • reduction: "mean" or "integral".

Returns:

  • A FunctionalConstraint enforcing the convection condition.

phydrax.constraints.DiscreteHeatFluxBoundaryConstraint(temperature_var: str, component: DomainComponent, /, *, points: Mapping[str, ArrayLike] | ArrayLike, values: ArrayLike, k: DomainFunction | ArrayLike, var: str = 'x', mode: Literal[reverse, forward] = 'reverse', weight: DomainFunction | ArrayLike = 1.0, label: str | None = None, reduction: Literal[mean, sum] = 'mean') -> PointSetConstraint ¤

Discrete heat-flux (Neumann-type) constraint at explicit anchor points.

Enforces \(k\,\partial T/\partial n = q\) at the provided points.


phydrax.constraints.DiscreteConvectionBoundaryConstraint(temperature_var: str, component: DomainComponent, /, *, points: Mapping[str, ArrayLike] | ArrayLike, ambient_values: ArrayLike, h: DomainFunction | ArrayLike, k: DomainFunction | ArrayLike, var: str = 'x', mode: Literal[reverse, forward] = 'reverse', weight: DomainFunction | ArrayLike = 1.0, label: str | None = None, reduction: Literal[mean, sum] = 'mean') -> PointSetConstraint ¤

Discrete convection (Robin) constraint at explicit anchor points.

Enforces \(k\,\partial T/\partial n = h\,(T - T_\infty)\) at the provided points, where \(T_\infty\) is given by ambient_values (interpolated when needed).


phydrax.constraints.DiscreteRobinBoundaryConstraint(constraint_var: str, component: DomainComponent, /, *, points: Mapping[str, ArrayLike] | ArrayLike, values: ArrayLike, dirichlet_coeff: DomainFunction | ArrayLike, neumann_coeff: DomainFunction | ArrayLike, var: str = 'x', mode: Literal[reverse, forward] = 'reverse', weight: DomainFunction | ArrayLike = 1.0, label: str | None = None, reduction: Literal[mean, sum] = 'mean') -> PointSetConstraint ¤

Discrete Robin constraint evaluated at explicit boundary anchor points.

Enforces \(c_0 T + c_1\,\partial T/\partial n = g\) at the provided points.