Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
cd userCase
blockMesh
decomposePar
mpirun -n 6 --oversubscribe --allow-run-as-root additiveFoam -parallel
mpirun -n 8 --oversubscribe --allow-run-as-root additiveFoam -parallel
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# Derived files
lex.yy.c
.venv/

# Corefiles
core
Expand Down
32 changes: 25 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,45 @@ minimum_pre_commit_version: "3.7.0"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
files: &openfoam_cpp_files '\.(C|H|I|cc|cpp|cxx|hh|hpp|hxx)$'
exclude: &openfoam_excludes '(^|/)(lnInclude|ThirdParty|platforms|build|processor[0-9]+|postProcessing)/'
files: &python_files '(\.pyi?$|(^|/)bin/calibrateHeatSource$)'

- id: end-of-file-fixer
files: *openfoam_cpp_files
exclude: *openfoam_excludes
files: *python_files

- id: mixed-line-ending
args: [--fix=lf]
files: *openfoam_cpp_files
exclude: *openfoam_excludes
files: &openfoam_cpp_files '\.(C|H|I|cc|cpp|cxx|hh|hpp|hxx)$'
exclude: &openfoam_excludes '(^|/)(lnInclude|ThirdParty|platforms|build|processor[0-9]+|postProcessing)/'

- id: check-merge-conflict

- id: check-yaml

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
args: [--line-length=80]
files: *python_files

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["-L", "mater,nd,coefficent,ot"]
files: *python_files

- repo: local
hooks:
- id: python-max-80-columns
name: "Python style: max 80 characters"
language: pygrep
entry: '^.{81,}$'
files: *python_files

- id: openfoam-no-tabs
name: "OpenFOAM style: no tabs"
language: pygrep
Expand Down
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The documentation for `AdditiveFOAM` is hosted on [GitHub Pages](https://ornl.gi
|-----------------------------------------------------------|------------------------------------------|
| [solver](applications/solvers/additiveFoam) | Development version of the solver |
| [tutorials](tutorials) | Tutorial cases |
| [calibration utility](bin/calibrateHeatSource) | Heat-source calibration command |
| [calibration tutorial](tutorials/heatSourceCalibration) | Projected heat-source calibration workflow |

## Installation
[![OpenFOAM-14](https://img.shields.io/badge/OpenFOAM-14-blue.svg)](https://github.com/OpenFOAM/OpenFOAM-14)
Expand Down Expand Up @@ -42,8 +44,28 @@ script from the repository root:
./Allwmake
```

For regular use, source both environments in each new shell or add them to your
shell startup file:
The Python utilities require Python 3.10 or newer. To use a dedicated virtual
environment, create it and install the pinned dependencies from the repository
root:

```sh
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python -m pip check
calibrateHeatSource --help
```

To use an existing Python environment instead, activate that environment and
install the same requirements into it:

```sh
python -m pip install -r /path/to/AdditiveFOAM/requirements.txt
python -m pip check
```

The AdditiveFOAM environment does not create or activate a Python environment.
Source the OpenFOAM and AdditiveFOAM environments in each new shell:

```sh
source /path/to/OpenFOAM-14/etc/bashrc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bool Foam::functionObjects::meltPoolDimensions::execute()
// physical boundary : take face point if above iso value
const vectorField& Cf = mesh_.Cf().boundaryField()[patchi];

const scalarField& pif(TPf.patchInternalField());
const scalarField pif(TPf.patchInternalField());

forAll(faceCells, facei)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ Foam::absorptionModels::Kelly::Kelly
etaMin_("etaMin", dimless, absorptionModelCoeffs_),
aspectRatioSwitch_
(
absorptionModelCoeffs_.lookupOrDefault<scalar>
max
(
"aspectRatioSwitch",
1.0
absorptionModelCoeffs_.lookupOrDefault<scalar>
(
"aspectRatioSwitch",
1.0
),
scalar(1e-10)
)
)
{
Expand Down Expand Up @@ -116,12 +120,15 @@ bool Foam::absorptionModels::Kelly::read()
absorptionModelCoeffs_.lookup("geometry") >> geometry_;
absorptionModelCoeffs_.lookup("eta0") >> eta0_;
absorptionModelCoeffs_.lookup("etaMin") >> etaMin_;
aspectRatioSwitch_ =
aspectRatioSwitch_ = max
(
absorptionModelCoeffs_.lookupOrDefault<scalar>
(
"aspectRatioSwitch",
1.0
);
),
scalar(1e-10)
);

return true;
}
Expand Down
Binary file not shown.
Loading
Loading