fluidsimfoam.output.fields#

Class for the sim.output.fields object

Functions

check_opacity(opacity)

check_pyvista_importable()

find_nearest(arr, value)

get_dimensions(mesh)

is_time_name(name)

Classes

Fields(output)

Reader(*args, **kwargs)

fluidsimfoam.output.fields.check_pyvista_importable()[source]#
fluidsimfoam.output.fields.is_time_name(name)[source]#
fluidsimfoam.output.fields.find_nearest(arr, value)[source]#
fluidsimfoam.output.fields.check_opacity(opacity)[source]#
class fluidsimfoam.output.fields.Reader(*args, **kwargs)[source]#
set_active_time(time=None)[source]#
fluidsimfoam.output.fields.get_dimensions(mesh)[source]#
class fluidsimfoam.output.fields.Fields(output)[source]#
get_saved_times()[source]#
get_path_dir_time(time_approx='last', dirname=None)[source]#
read_field(name, time_approx='last')[source]#
reconstruct_par(fields=None, latest_time=None, time=None)[source]#
plot_field(name, time_approx='last')[source]#
plot_boundary(name=None, show_edges=True, lighting=True, camera_position=None, color='w', mesh_opacity=1, add_legend=False, show=True, plotter=None, **kwargs)[source]#
Parameters:
  • name (str) – Boundary name

  • show_edges (bool) – Show edges

  • lighting (bool) – Lighting of this boundary

  • camera_position (str) – Camera position, like “xy”

  • color (str) – Color of the boundary

  • mesh_opacity (float) – The opacity of the whole mesh, in range (0, 1)

  • add_legend (bool) – Add legend for domain and boundary

  • show (bool) – Show plot

Examples

>>> sim.output.fields.plot_boundary(
...     "bottom", color="g", mesh_opacity=0.05)
>>> sim.output.fields.plot_boundary(
...     "lowerBoundary", color="b", mesh_opacity=0.05, add_legend=True)
plot_contour(variable='U', component=None, time=None, equation=None, camera_position=None, mesh_opacity=0, show=True, contour=False, plotter=None, **kwargs)[source]#
Parameters:
  • variable (str) – Variable name

  • component (int) – Components of vector field (x:0, y:1, z:2)

  • time (float) – Simulation time

  • equation (str) – The equation of the plane for contour

  • camera_position (str) – Camera position plane like: “xy”

  • mesh_opacity (float) – The opacity of the whole mesh, in range (0, 1)

  • contour (bool) – Apply a contour filter after slicing.

Examples

>>> sim.output.fields.plot_contour(
...     equation="y=0", variable="U",
...     mesh_opacity=0.1, time=86400.0, component=2)
>>> sim.output.fields.plot_contour(
...     equation="z=0", variable="T", time=3600.0, contour=True)
plot_profile(point0=[0, 0, 0], point1=[0, 1, 0], variable='U', component=None, time=None, line_width=2, color='r', show_line_in_domain=False, show=True, plotter=None, **kwargs)[source]#
Parameters:
  • point0 (list) – Coordinate of first point

  • point1 (list) – Coordinate of second point

  • variable (str) – Variable name

  • component (int) – Components of vector field (x:0, y:1, z:2)

  • line_width (str) – Line width of preview plot

  • color (str) – Line color of preview plot

  • time (float) – Simulation time

  • show_line_in_domain (bool) – Preview line in the domain

Examples

>>> sim.output.fields.plot_profile(
...     point0=[0,0,5], point1=[0,0,20], variable="T", time=3600,
...     ylabel="T(K)", title="Temperature")
plot_mesh(color='w', style='wireframe', show=True, plotter=None, **kwargs)[source]#
Parameters:
  • color (str) – Color of mesh

  • style (str) – Style of mesh (‘wireframe’, ‘points’, ‘surface’)

  • show (bool) – Show plot

Examples

>>> sim.output.fields.plot_mesh(color="g")