Caelus Python Library (CPL)¶
- Version:
v4.0.0
- Date:
Jul 13, 2024
Caelus Python Library is a companion package for interacting with OpenFOAM and its derivative Caelus CML open-source CFD packages. The library provides utilities for pre and post-processing, as well as automating various aspects of the CFD simulation workflow. Written in Python, it provides a consistent user-interface across the three major operating systems Linux, Windows, and Mac OS X ensuring that the scripts written in one platform can be quickly copied and used on other platforms.
Like CML, CPL is also an open-source library released under the Apache License Version 2.0 license. See Apache License Version 2.0 for more details on use and distribution.
This documentation is split into two parts: a user and a developer manual. New users should start with the user manual that provides an overview of the features and capabilities currently available in CPL, the installation process and examples of usage. The developer manual documents the application programming interface (API) and is useful for users and developers looking to write their own python scripts to extend functionality or add features to the library. See Introduction for more details.
User Manual¶
- Introduction
- Installing Caelus Python Library (CPL)
- Configuring Caelus Python Library
- Command-line Applications
- Common CLI options
- Available command-line applications
caelus
– Common CPL actions- caelus cfg – Print CPL configuration
- caelus clone – Clone a case directory
- caelus tasks – run tasks from a file
- caelus run – run an executable in the appropriate environment
- caelus runpy – Run a custom python script
- caelus logs – process a solver log file from a run
- caelus clean – clean a case directory
- caelus build – Compile OpenFOAM or CML sources
caelus_sim
– Parametric Run CLI- caelus_tutorials – Run tutorials
- Caelus Tasks
- Tutorials
Developer Manual¶
- Caelus Python API
- caelus.config – Caelus Configuration Infrastructure
- Caelus Python Configuration
CaelusCfg
configure_logging()
get_appdata_dir()
get_caelus_root()
get_config()
get_cpl_root()
get_default_config()
rcfiles_loaded()
reload_config()
reset_default_config()
search_cfg_files()
- Caelus CML Environment Manager
CMLEnv
FOAMEnv
FOAMEnv.etc_file()
FOAMEnv.from_modules()
FOAMEnv.bin_dir
FOAMEnv.build_dir
FOAMEnv.build_option
FOAMEnv.environ
FOAMEnv.etc_dirs
FOAMEnv.foam_api_info
FOAMEnv.foam_bashrc
FOAMEnv.foam_version
FOAMEnv.lib_dir
FOAMEnv.module_list
FOAMEnv.mpi_bindir
FOAMEnv.mpi_dir
FOAMEnv.mpi_libdir
FOAMEnv.project_dir
FOAMEnv.root
FOAMEnv.site_dir
FOAMEnv.site_libdir
FOAMEnv.user_bindir
FOAMEnv.user_dir
FOAMEnv.user_libdir
FOAMEnv.version
HelyxEnv
HelyxEnv.etc_file()
HelyxEnv.bin_dir
HelyxEnv.build_dir
HelyxEnv.build_option
HelyxEnv.environ
HelyxEnv.etc_dirs
HelyxEnv.foam_bashrc
HelyxEnv.lib_dir
HelyxEnv.module_list
HelyxEnv.mpi_bindir
HelyxEnv.mpi_dir
HelyxEnv.mpi_libdir
HelyxEnv.project_dir
HelyxEnv.site_dir
HelyxEnv.site_libdir
HelyxEnv.user_bindir
HelyxEnv.user_dir
HelyxEnv.user_libdir
HelyxEnv.version
cml_get_latest_version()
cml_get_version()
discover_versions()
get_cmlenv_instance()
is_foam_var()
- caelus.utils – Basic utilities
- caelus.run – CML Execution Utilities
- Caelus Tasks Manager
Tasks
TasksMeta
- CML Simulation
CMLSimBase
CMLSimBase.clean()
CMLSimBase.clone()
CMLSimBase.get_input_dict()
CMLSimBase.load()
CMLSimBase.save_state()
CMLSimBase.LESProperties
CMLSimBase.RASProperties
CMLSimBase.basedir
CMLSimBase.blockMeshDict
CMLSimBase.casedir
CMLSimBase.changeDictionaryDict
CMLSimBase.cmlControls
CMLSimBase.controlDict
CMLSimBase.decomposeParDict
CMLSimBase.env
CMLSimBase.fvSchemes
CMLSimBase.fvSolution
CMLSimBase.name
CMLSimBase.parent
CMLSimBase.run_config
CMLSimBase.run_flags
CMLSimBase.transportProperties
CMLSimBase.turbulenceProperties
CMLSimBase.udf
CMLSimCollection
CMLSimCollection.filter_cases()
CMLSimCollection.load()
CMLSimCollection.post()
CMLSimCollection.prep()
CMLSimCollection.save_state()
CMLSimCollection.setup()
CMLSimCollection.simulation_class()
CMLSimCollection.solve()
CMLSimCollection.status()
CMLSimCollection.udf_instance()
CMLSimCollection.basedir
CMLSimCollection.case_names
CMLSimCollection.casedir
CMLSimCollection.cases
CMLSimCollection.env
CMLSimCollection.name
CMLSimCollection.udf
CMLSimCollection.udf_params
CMLSimCollection.udf_script
CMLSimMeta
CMLSimulation
CMLSimulation.case_log()
CMLSimulation.decompose_case()
CMLSimulation.post_case()
CMLSimulation.prep_case()
CMLSimulation.reconstruct_case()
CMLSimulation.run_tasks()
CMLSimulation.solve()
CMLSimulation.status()
CMLSimulation.update()
CMLSimulation.LESProperties
CMLSimulation.RASProperties
CMLSimulation.blockMeshDict
CMLSimulation.changeDictionaryDict
CMLSimulation.cmlControls
CMLSimulation.controlDict
CMLSimulation.decomposeParDict
CMLSimulation.fvSchemes
CMLSimulation.fvSolution
CMLSimulation.job_ids
CMLSimulation.logfile
CMLSimulation.run_flags
CMLSimulation.solver
CMLSimulation.task_file
CMLSimulation.transportProperties
CMLSimulation.turbulenceProperties
- CML Parametric Run Manager
CMLParametricRun
iter_case_params()
normalize_variable_param()
- Caelus Job Manager Interface
CaelusCmd
- CML Execution Utilities
clean_casedir()
clean_polymesh()
clone_case()
find_caelus_recipe_dirs()
find_case_dirs()
find_recipe_dirs()
get_mpi_size()
is_caelus_casedir()
- Job Scheduler Interface
HPCQueue
HPCQueue.name
HPCQueue.queue
HPCQueue.account
HPCQueue.num_nodes
HPCQueue.num_ranks
HPCQueue.stdout
HPCQueue.stderr
HPCQueue.join_outputs
HPCQueue.mail_opts
HPCQueue.email_address
HPCQueue.qos
HPCQueue.time_limit
HPCQueue.shell
HPCQueue.mpi_extra_args
HPCQueue.delete()
HPCQueue.get_queue_settings()
HPCQueue.is_job_scheduler()
HPCQueue.is_parallel()
HPCQueue.prepare_mpi_cmd()
HPCQueue.process_cml_run_env()
HPCQueue.process_foam_run_env()
HPCQueue.process_run_env()
HPCQueue.submit()
HPCQueue.update()
HPCQueue.write_script()
HPCQueue.queue_name
HPCQueue.script_body
PBSQueue
ParallelJob
SerialJob
SlurmQueue
caelus_execute()
get_job_scheduler()
python_execute()
- caelus.post – Post-processing utilities
- Post-processing interface
PostProcessing
- Core function object utilities
DictMeta
FuncObjMeta
FunctionObject
FunctionObject.create()
FunctionObject.funcobj_type()
FunctionObject.enabled
FunctionObject.executeControl
FunctionObject.executeInterval
FunctionObject.latest_time
FunctionObject.libs
FunctionObject.log
FunctionObject.region
FunctionObject.root
FunctionObject.timeEnd
FunctionObject.timeStart
FunctionObject.times
FunctionObject.writeControl
FunctionObject.writeInterval
- Sets and surfaces sampling
SampledData
SampledSet
SampledSets
SampledSurface
SampledSurfaces
Sampling
- Force and Force coefficients interface
ForceCoeffs
Forces
LiftDrag
LiftDrag.Uinf
LiftDrag.dragDirection
LiftDrag.liftDirection
LiftDrag.maxCp
LiftDrag.minCp
LiftDrag.nAveragingSteps
LiftDrag.outputRegionData
LiftDrag.patches
LiftDrag.pitchAxis
LiftDrag.porosity
LiftDrag.referenceArea
LiftDrag.referenceLength
LiftDrag.rhoInfo
LiftDrag.runOnLastIterOnly
LiftDrag.wheelbase
LiftDrag.writeFields
- Caelus Log Analyzer
LogProcessor
LogProcessor.add_rule()
LogProcessor.bounding_processor()
LogProcessor.completion_processor()
LogProcessor.continuity_processor()
LogProcessor.convergence_processor()
LogProcessor.courant_processor()
LogProcessor.exec_time_processor()
LogProcessor.exiting_processor()
LogProcessor.extend_rule()
LogProcessor.fatal_error_processor()
LogProcessor.residual_processor()
LogProcessor.time_processor()
LogProcessor.watch_file()
LogProcessor.bound_files
LogProcessor.case_dir
LogProcessor.converged
LogProcessor.converged_time
LogProcessor.current_state
LogProcessor.failed
LogProcessor.logfile
LogProcessor.logs_dir
LogProcessor.res_files
LogProcessor.solve_completed
LogProcessor.subiter_map
LogProcessor.time
LogProcessor.time_str
SolverLog
- Caelus Plotting Utilities
CaelusPlot
LogWatcher
PlotsMeta
make_plot_method()
mpl_settings()
- caelus.io – CML Input File Manipulation
- Caelus/OpenFOAM Input File Interface
BlockMeshDict
ChangeDictionaryDict
CmlControls
ControlDict
ControlDict.create_default_entries()
ControlDict.adjustTimeStep
ControlDict.application
ControlDict.deltaT
ControlDict.endTime
ControlDict.functions
ControlDict.graphFormat
ControlDict.maxCo
ControlDict.purgeWrite
ControlDict.runTimeModifiable
ControlDict.startFrom
ControlDict.startTime
ControlDict.stopAt
ControlDict.timeFormat
ControlDict.timePrecision
ControlDict.writeCompression
ControlDict.writeControl
ControlDict.writeFormat
ControlDict.writeInterval
ControlDict.writePrecision
DecomposeParDict
DictFile
DictMeta
FvSchemes
FvSolution
LESProperties
PolyMeshBoundary
RASProperties
TransportProperties
TurbModelProps
TurbulenceProperties
cml_std_files
- Caelus/OpenFOAM Dictionary Implementation
CaelusDict
BoundaryList
CalcDirective
CodeStream
DimStr
DimValue
Dimension
Directive
EvalDirective
Field
FoamType
ListTemplate
MacroSubstitution
MultipleValues
- Caelus Input File Pretty-printer
DictPrinter
Indenter
foam_writer()
- caelus.scripts – CLI App Utilities
- caelus.config – Caelus Configuration Infrastructure