butterfly.functions module

A cllection of OpenFOAM functions such as Probes.

class butterfly.functions.Function(name, cls, location=None, file_format='ascii', default_values=None, values=None)[source]

Bases: butterfly.foamfile.FoamFile

OpenFOAM function object.

Use this class to create conditions function objects. Functions don’t have OpenFOAM header and OpenFOAM FoamFile. It’s only values.

classmethod from_cpp_dictionary(dictionary)[source]

Create a foamfile from an OpenFOAM dictionary in text format.

header()[source]

Return conditions header.

class butterfly.functions.Probes(values=None)[source]

Bases: butterfly.functions.Function

Probes function.

fields

Get and set probes fields from list of tuples.

filename

Get Probes filename.

classmethod from_file(filepath)[source]

Create a FoamFile from a file.

Parameters:filepath – Full file path to dictionary.
probeLocations

Get and set probe locations from list of tuples.

probes_count

Get number of probes.

save(project_folder, sub_folder=None)[source]

Save to file.

Parameters:
  • project_folder – Path to project folder as a string.
  • sub_folder – Optional input for sub_folder (default: self.location).
writeInterval

100).

Type:Set the number of intervals for writing the results (default