scalar_adv_diff module#

class scalar_adv_diff.adv_diffusion(domain: dolfinx.mesh.Mesh, ft: dolfinx.cpp.mesh.MeshTags_int32, boundary_marks: dict)[source]#

Bases: object

This class implements the solution of the advection-diffusion of a passive scalar in a flow field:

\[\frac{\partial T}{\partial t } + \mathbf{u}\cdot \nabla T-\alpha\Delta T=0\]
Parameters:
  • domain (dolfinx.mesh.Mesh) – Mesh imported.

  • ft (dolfinx.cpp.mesh.MeshTags_int32) – Face tags of the boundaries.

  • boundary_marks (dict) – Dictionary with the markers for the boundaries.

assemble(bc_values: dict, dt=0.01, alpha=0.001, T_0=0.0, direct: bool = False)[source]#

This function assigns the boundary conditions, assembles the forms of the weak formulations and creates the linear structures for the solution (matrix, rhs and solver).

Parameters:
  • bc_values (dictionary) – Dictionary with the boundary conditions to assign.

  • dt (float (Default: 1e-2)) – Time step.

  • alpha (float (Default: 1e-3)) – Thermal Diffusivity.

  • T_0 (float (Default: 0.)) – Initial value of the temperature.

  • direct (boolean (Default: False)) – Boolean variable to identify if a direct solver must be used.

solve(uTilde: dolfinx.fem.Function)[source]#

This function solves the advection-diffusion problem.

Parameters:

uTilde (dolfinx.fem.Function) – Velocity field coming from the ISF step.