Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c77d063
ported to OpenFOAM-13. Function Objects not yet supported.
colemanjs Apr 30, 2026
24a3480
WIP V2.0 refinement model (#92)
colemanjs May 20, 2026
c39cd1e
V2.0 refinement model (#94)
colemanjs Jun 2, 2026
7cdb8b0
Add nLight AFX heat source model
colemanjs Jun 2, 2026
5de83fe
Add tabulated heat source tutorial
colemanjs Jun 2, 2026
ee225ee
Added README.md for nLight tutorial to help users understand usage an…
colemanjs Jun 2, 2026
c7b047d
fix and add tutorials readme
colemanjs Jun 2, 2026
2c6ea65
Function Objects for Dynamic Meshing. Note that the current ExaCA fun…
colemanjs Jun 4, 2026
ea0f2c9
This pre-commit setup enforces the mechanical subset of the OpenFOAM …
colemanjs Jun 4, 2026
0af77f3
fixup for CI using OpenFOAM-13
colemanjs Jun 4, 2026
a6440cf
fixup CI for OpenFOAM-13
colemanjs Jun 4, 2026
61f4c9f
fix type in CI for OpenFOAM-13
colemanjs Jun 4, 2026
9f107ac
clean up CI for OpenFOAM-13
colemanjs Jun 4, 2026
a6a65e5
dynamic mesh refinement and distributor cleaned in tutorials
colemanjs Jun 5, 2026
a76821c
Corrected consistent pressure field reference. However, I am still no…
colemanjs Jun 5, 2026
8aa37f9
clean up tutorials with consistent formatting
colemanjs Jun 5, 2026
842aab7
moved verification and validation to tests
colemanjs Jun 5, 2026
2dbe1c6
clean up includes and source file headers
colemanjs Jun 8, 2026
bad23f0
updated OpenFOAM version to in tutorial headers. This should be made…
colemanjs Jun 8, 2026
6d44c1d
Update ORNL copyright for v2.0.0 (#96)
colemanjs Jun 8, 2026
09b5b06
update heatSourceDict
colemanjs Jun 8, 2026
92e3398
Merge branch 'main' into candidate-v2.0.0
colemanjs Jun 29, 2026
f4e3dcb
AdditiveFOAM environment variables and version check added to etc/bashrc
colemanjs Jul 1, 2026
044f6f2
aspect ratio clipping fix for heatsource projection functions
colemanjs Jul 1, 2026
0c92e3d
fixup CI
colemanjs Jul 1, 2026
8f6ce81
fixup CI
colemanjs Jul 1, 2026
adc445b
Build: centralize AdditiveFOAM build metadata
colemanjs Jul 1, 2026
77f206a
Build: cleanup .gitignore
colemanjs Jul 1, 2026
62801a7
Bug: initial limiting on minimum melt pool aspect ratio
colemanjs Jul 1, 2026
cf1b815
Added primesToAdditiveFOAM converter and updated tabulated heat sourc…
colemanjs Jul 6, 2026
79b0758
fixup: aluminum absorption
colemanjs Jul 6, 2026
b4d5f17
Added beam bounding box output from primes converter. NOTE: this does…
colemanjs Jul 7, 2026
24ded06
fixup: formatting
colemanjs Jul 7, 2026
3b163fd
fixup: formatting
colemanjs Jul 7, 2026
aefc9df
Modified miltBeam tutorial to be a simple extension of AMB2018-02-B w…
colemanjs Jul 8, 2026
9be1217
fixup: marangoni test and openfoam version
colemanjs Jul 8, 2026
cacb523
moved helper scripts to AdditiveFOAM/bin similar to OpenFOAM
colemanjs Jul 8, 2026
ffd5d79
synced transportProperties
colemanjs Jul 8, 2026
5980707
Added tool to plot Hunt Curves from solidification data
colemanjs Jul 8, 2026
5de781a
Fixup: utilities and utility paths
colemanjs Jul 8, 2026
81e165b
rename hunt to cet
colemanjs Jul 8, 2026
7b9b28c
Add material configuration files for tutorial properties (#98)
colemanjs Jul 9, 2026
8becbfa
Doc: material configuration file header
colemanjs Jul 9, 2026
85eabcd
Fix: source AdditiveFOAM/etc/bashrc in CI
colemanjs Jul 9, 2026
52aa4cc
Fix: improved user interface for refinementModel (#99)
colemanjs Jul 9, 2026
6e3bfa2
Add power plotting script
colemanjs Jul 9, 2026
da0139e
tutorial and function object clean
colemanjs Jul 9, 2026
7b1188b
Update installation instructions in README
colemanjs Jul 9, 2026
421a5f3
Update installation instructions in README
colemanjs Jul 9, 2026
dbcdfe5
Update installation instructions in README
colemanjs Jul 9, 2026
132aa20
Change MaterialFileName to SS316L_AusteniteFerrite.json
colemanjs Jul 10, 2026
46cfa8a
Change MaterialFileName from Inconel625 to AlSi10Mg
colemanjs Jul 10, 2026
0c48d09
Fix: trailing character removed
colemanjs Jul 10, 2026
4bf49b3
udpated ExaCA input file formatting
colemanjs Jul 10, 2026
2e39f24
Documentation: cleaned tutorial READMEs
colemanjs Jul 10, 2026
8f709f8
Corrected DOI in README
colemanjs Jul 10, 2026
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
66 changes: 66 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
Language: Cpp
BasedOnStyle: LLVM

ColumnLimit: 80
IndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
UseTab: Never

# OpenFOAM-style brace placement.
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# if (...), for (...), while (...), switch (...)
# but:
# forAll(...), not forAll (...)
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: false
AfterOverloadedOperator: false
AfterPlacementOperator: false

ForEachMacros:
- forAll
- forAllReverse
- forAllIter
- forAllConstIter
- forAllIters
- forAllConstIters

DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Left

SortIncludes:
Enabled: false
ReflowComments: Never
FixNamespaceComments: false

BreakBeforeBinaryOperators: NonAssignment
AlignOperands: AlignAfterOperator
...
10 changes: 6 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@ jobs:

runs-on: ubuntu-latest
container:
image: docker.io/openfoam/openfoam10-paraview510
image: microfluidica/openfoam:13
options: --user root
steps:
- name: Checkout AdditiveFOAM
uses: actions/checkout@v2
- name: Build AdditiveFOAM
run: |
. /opt/openfoam10/etc/bashrc
. /opt/openfoam13/etc/bashrc || true
. ./etc/bashrc
test -n "$WM_PROJECT_DIR"
./Allwmake
- name: Test AdditiveFOAM
run: |
. /opt/openfoam10/etc/bashrc
. /opt/openfoam13/etc/bashrc || true
. ./etc/bashrc
cp -r tutorials/AMB2018-02-B userCase
cd userCase
# FIXME: use built-in "additiveFoam" smaller case when created
blockMesh
decomposePar
mpirun -n 6 --oversubscribe --allow-run-as-root additiveFoam -parallel
66 changes: 66 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
minimum_pre_commit_version: "3.7.0"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.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)/'

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

- id: mixed-line-ending
args: [--fix=lf]
files: *openfoam_cpp_files
exclude: *openfoam_excludes

- id: check-merge-conflict

- id: check-yaml

- repo: local
hooks:
- id: openfoam-no-tabs
name: "OpenFOAM style: no tabs"
language: pygrep
entry: '\t'
files: *openfoam_cpp_files
exclude: *openfoam_excludes

# [Manual]: Fixing long C++ lines usually requires judgment.
- id: openfoam-max-80-columns
name: "OpenFOAM style: max 80 characters"
language: pygrep
entry: '^.{81,}$'
files: *openfoam_cpp_files
exclude: *openfoam_excludes
stages: [manual]

- id: openfoam-space-after-control-keyword
name: "OpenFOAM style: use if (...), for (...), while (...), switch (...)"
language: pygrep
entry: '^(?!\s*#).*\b(if|for|while|switch)\('
files: *openfoam_cpp_files
exclude: *openfoam_excludes

- id: openfoam-forall-no-space
name: "OpenFOAM style: use forAll(...), not forAll (...)"
language: pygrep
entry: '\b(forAll|forAllReverse|forAllIter|forAllConstIter|forAllIters|forAllConstIters)\s+\('
files: *openfoam_cpp_files
exclude: *openfoam_excludes

# [Manual]: clang-format is useful as a helper, but it cannot exactly
# represent OpenFOAM stream/math/operator spacing conventions.
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.5
hooks:
- id: clang-format
name: "clang-format: approximate OpenFOAM style, requires manual changes"
args: [--style=file]
files: *openfoam_cpp_files
exclude: *openfoam_excludes
stages: [manual]
23 changes: 21 additions & 2 deletions Allwmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Source the AdditiveFOAM environment variables
. "${0%/*}/etc/bashrc" || exit 1

# Parse arguments for library/application compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments || exit 1

#------------------------------------------------------------------------------
# AdditiveFOAM build information

GIT_DESCRIBE=$(git describe --tags --always 2>/dev/null) \
|| GIT_DESCRIBE="undefined"

GIT_SHA1=$(git rev-parse HEAD 2>/dev/null) \
|| GIT_SHA1="undefined"

export ADDITIVEFOAM_BUILD_FLAGS="\
$ADDITIVEFOAM_BUILD_FLAGS \
-DADDITIVEFOAM_GIT_DESCRIBE=\\\"$GIT_DESCRIBE\\\" \
-DADDITIVEFOAM_GIT_SHA1=\\\"$GIT_SHA1\\\""

#------------------------------------------------------------------------------
# Compile AdditiveFOAM libraries and applications

applications/Allwmake $targetType $*

#------------------------------------------------------------------------------
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,43 @@ The documentation for `AdditiveFOAM` is hosted on [GitHub Pages](https://ornl.gi
| Link | Description |
|-----------------------------------------------------------|------------------------------------------|
| [solver](applications/solvers/additiveFoam) | Development version of the solver |
| [utilities](applications/utilities) | Utilities for post-processing and code wrappers |
| [tutorials](tutorials) | Tutorial cases |

## Installation and Dependencies
[![OpenFOAM-10](https://img.shields.io/badge/OpenFOAM-10-blue.svg)](https://github.com/OpenFOAM/OpenFOAM-10)
## Installation
[![OpenFOAM-13](https://img.shields.io/badge/OpenFOAM-13-blue.svg)](https://github.com/OpenFOAM/OpenFOAM-13)

AdditiveFOAM is built on source code released by the OpenFOAM Foundation [openfoam.org](https://openfoam.org/), which is available in public [OpenFOAM repositories](https://github.com/OpenFOAM).
AdditiveFOAM requires OpenFOAM-13 from the OpenFOAM Foundation. Install or
build OpenFOAM-13 first, then source the OpenFOAM environment:

[![Spack-Dev](https://img.shields.io/badge/Spack-Dev-blue.svg)](https://github.com/spack/spack)
```sh
source /path/to/OpenFOAM-13/etc/bashrc
```

Clone AdditiveFOAM, enter the repository, and source the AdditiveFOAM
environment:

The easiest way to install AdditiveFOAM is using [spack](https://spack.readthedocs.io/en/latest/):
```sh
git clone https://github.com/ORNL/AdditiveFOAM.git
cd AdditiveFOAM
source etc/bashrc
```
spack install additivefoam

The AdditiveFOAM `etc/bashrc` checks that OpenFOAM-13 is active and sets the required paths.

Build all AdditiveFOAM libraries, solvers, and utilities with the master build
script from the repository root:

```sh
./Allwmake
```

See the [installation instructions](https://ornl.github.io/AdditiveFOAM/docs/installation/#installation) in the [documentation](https://ornl.github.io/AdditiveFOAM/) for other options for building `AdditiveFOAM`.
For regular use, source both environments in each new shell or add them to your
shell startup file:

```sh
source /path/to/OpenFOAM-13/etc/bashrc
source /path/to/AdditiveFOAM/etc/bashrc
```

## Citing
[![DOI](https://joss.theoj.org/papers/10.21105/joss.07770/status.svg)](https://doi.org/10.21105/joss.07770)
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/additiveFoam/Allwclean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
rm -rf Make/gitInfo.H

wclean libso functionObjects
wmake libso utilities
wclean libso movingHeatSource
wclean

Expand Down
23 changes: 1 addition & 22 deletions applications/solvers/additiveFoam/Allwmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments

#------------------------------------------------------------------------------
# Generate header for git information
HEADER_FILE="${0%/*}/Make/gitInfo.H"
GIT_DESCRIBE=$(git describe --tags --always 2>/dev/null) || GIT_DESCRIBE="undefined"
GIT_SHA1=$(git rev-parse HEAD 2>/dev/null) || GIT_SHA1="undefined"

cat > "$HEADER_FILE" << EOF
#ifndef gitInfo_H
#define gitInfo_H

// Git describe
#define ADDITIVEFOAM_GIT_DESCRIBE "$GIT_DESCRIBE"

// Git hash
#define ADDITIVEFOAM_GIT_SHA1 "$GIT_SHA1"

#endif
EOF

export ADDITIVEFOAM_BUILD_FLAGS="-DGIT_MODULE_ENABLED=1"

#------------------------------------------------------------------------------
# Build libraries and solver
wmake $targetType utilities
wmake $targetType functionObjects
wmake $targetType movingHeatSource
wmake $targetType
Expand Down
2 changes: 2 additions & 0 deletions applications/solvers/additiveFoam/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ EXE_INC = \
$(ADDITIVEFOAM_BUILD_FLAGS) \
-I. \
-ImovingHeatSource/lnInclude \
-Iutilities/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/randomProcesses/lnInclude

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lmovingBeamModels \
-ladditiveFoamUtilities \
-lfiniteVolume \
-lmeshTools \
-lrandomProcesses
Loading
Loading