Skip to content

Commit 9c05c5e

Browse files
authored
Add heat-source calibration and prepared for AdditiveFOAM 2.0.0 (#103)
* calibration for projected heat source models * Updated calibration workflow for tabulated beam profile * Doc: code and documentation clean up and consistency fixes for 2.0.0 release * Correct projected heat source bounds and Kelly absorption - apply projected heat sources only below the beam plane - align source bounds with one-sided normalization - rename source bounds to sourceMin and sourceMax - preserve the configured Kelly aspect-ratio switch - apply etaMin as a lower bound on the Kelly curve - safely evaluate Kelly at zero aspect ratio - restore PRIMES profile output precision - update related documentation * Cleanup * Correct heat-source integration and release-gate issues (#103) - derive model-specific integration bounds from profileTol - synchronize heat-source dimensions, normalization, and shape state - preserve partial-time-step power at the end of scan paths - restrict transient depth calculations to one-sided source support - reconstruct the PRIMES calculation ROI and report D4Sigma statistics - correct refinement updates, MRF flux handling, boundary initialization, and exact thermodynamic-path node bracketing - update tutorials and release documentation for the 2.0.0 interfaces * major refactor of proejcted heat sources to seperable radial and axial integrations * Replace local NUTS calibration with posterior quadrature - integrate one-dimensional local posteriors deterministically - propagate stratified posterior samples through the robust global fit - update calibration configuration, reporting, documentation, and dependencies * Refactor heat source models and reference dimensions - generalize profile metrics and D4Sigma reference widths - centralize heat-source width and depth references - simplify projected and super-Gaussian model interfaces - update calibration workflows, tutorials, and OpenFOAM 14 integration * Doc: update CHANGELOG
1 parent e5f0db4 commit 9c05c5e

125 files changed

Lines changed: 8236 additions & 3035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/CI.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
cd userCase
4343
blockMesh
4444
decomposePar
45-
mpirun -n 6 --oversubscribe --allow-run-as-root additiveFoam -parallel
45+
mpirun -n 8 --oversubscribe --allow-run-as-root additiveFoam -parallel

‎Allwmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd ${0%/*} || exit 1 # Run from this directory
1010
#------------------------------------------------------------------------------
1111
# AdditiveFOAM build information
1212

13-
GIT_DESCRIBE=$(git describe --tags --always 2>/dev/null) \
13+
GIT_DESCRIBE=$(git describe --tags --always --dirty 2>/dev/null) \
1414
|| GIT_DESCRIBE="undefined"
1515

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

‎CHANGELOG.md‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,91 @@
1+
# Release 2.0.0
2+
3+
## Features
4+
5+
- Ported AdditiveFOAM to OpenFOAM-14.
6+
- Added dynamic refinement models and reusable material and heat-source
7+
configuration files.
8+
- Added a general projected heat source with super-Gaussian, nLight AFX, and
9+
tabulated planar profiles and an exponential axial projection.
10+
- Added conversion of PRIMES beam measurements with `primesToAdditiveFoam`.
11+
- Added general planar-profile moment metrics, tabulated-profile inspection,
12+
and automatic `D4Sigma` calculation.
13+
- Added rotated elliptical analytic profiles, `e2` and `secondMoment` radius
14+
definitions, and selectable area-equivalent, major, or minor `D4Sigma`
15+
reference widths.
16+
- Added model-specific heat-source bounds that retain at least
17+
`1-tolerance` of the analytical source power.
18+
- Added support-based heat-source quadrature.
19+
- Added an adaptive Bayesian workflow with deterministic posterior quadrature
20+
for calibrating the projected heat-source axial closure.
21+
- Expanded the AMB2018, multi-beam, multi-layer, nLight AFX, and tabulated
22+
tutorials.
23+
24+
## Bug fixes
25+
26+
- Made all heat sources one-sided, consistent with their analytic
27+
normalization.
28+
- Synchronized heat-source depth, shape parameters, normalization, and bounds
29+
once before beam subcycling.
30+
- Preserved the active-power fraction when a solver time step crosses the end
31+
of a scan path.
32+
- Restricted isotherm source-depth measurements to the planar source support
33+
below the beam plane and removed a modified super-Gaussian endpoint
34+
singularity.
35+
- Added calculation-ROI reconstruction, coordinate-preserving support cropping,
36+
and beam-statistics reporting to `primesToAdditiveFoam`.
37+
- Preserved an explicitly configured Kelly `aspectRatioSwitch` value and
38+
applied `etaMin` as a lower bound on the Kelly absorption curve.
39+
40+
## Upgrade notes
41+
42+
- AdditiveFOAM 2.0 requires OpenFOAM-14. Source the OpenFOAM-14 environment
43+
before sourcing `etc/bashrc` and rebuild AdditiveFOAM with `./Allwmake`.
44+
- Sources now use nested `absorption`, `heatSource`, `profile`, `projection`,
45+
and `refinement` dictionaries with a `model` entry instead of `*Coeffs`
46+
dictionaries.
47+
- The former projected Gaussian, nLight AFX, and tabulated heat-source models
48+
are profiles selected by the `projected` model. Their shared axial model is
49+
selected in the `projection` dictionary.
50+
- `superGaussian` remains a volumetric model and is also a planar profile.
51+
`radius` is two-dimensional and `depth` is a separate scalar.
52+
- The tabulated profile derives its D4Sigma metrics from the beam-profile
53+
table. No user-supplied lateral dimensions are required.
54+
- Profile metrics expose `D4Sigma` as `(major minor)`. Reference dimensions
55+
select the scalar width and constant or isotherm depth used by aspect-ratio
56+
closures.
57+
- Aspect-ratio closures use a `D4Sigma` width reference, with selectable
58+
`areaEquivalent`, `major`, or `minor` component, and a `constant` or
59+
`isotherm` depth reference.
60+
- The `A` and `B` projected-depth coefficients are named `nSlope` and
61+
`nIntercept` in the `projection` dictionary.
62+
- Python 3.10 through 3.12 and the packages in `requirements.txt` are required
63+
only for the calibration and plotting utilities.
64+
65+
## Full Changelog
66+
67+
For a complete list of changes, see the [full changelog](https://github.com/ORNL/AdditiveFOAM/compare/1.2.0...2.0.0).
68+
69+
70+
# Release 1.2.0
71+
72+
## Features
73+
74+
- Added the projected Gaussian heat-source model.
75+
- Added melt-pool-dimension and solidification-data function objects.
76+
- Added optional implicit temperature limiting through the PIMPLE dictionary.
77+
- Added multi-layer scan-path support and updated the ExaCA tutorials.
78+
- Added the top-level build script for solvers and utilities.
79+
80+
## Bug Fixes
81+
82+
- Corrected thermophysical file handling for cases launched with `-case`.
83+
84+
## Full Changelog
85+
86+
For a complete list of changes, see the [full changelog](https://github.com/ORNL/AdditiveFOAM/compare/1.1.0...1.2.0).
87+
88+
189
# Release 1.1
290

391
## Features

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU GENERAL PUBLIC LICENSE
22

33
Copyright (C) 2011-2017 OpenFOAM Foundation
4-
Copyright (C) 2023 Oak Ridge National Laboratory
4+
Copyright (C) 2023-2026 Oak Ridge National Laboratory
55

66
You may use, distribute and copy AdditiveFOAM under the terms
77
of GNU General Public License version 3, which is displayed below, or

‎README.md‎

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ The documentation for `AdditiveFOAM` is hosted on [GitHub Pages](https://ornl.gi
1111
### Repository Features
1212
| Link | Description |
1313
|-----------------------------------------------------------|------------------------------------------|
14-
| [solver](applications/solvers/additiveFoam) | Development version of the solver |
14+
| [solver](applications/solvers/additiveFoam) | AdditiveFOAM solver source |
1515
| [tutorials](tutorials) | Tutorial cases |
16+
| [calibration utility](bin/calibrateHeatSource) | Heat-source calibration command |
17+
| [calibration tutorial](tutorials/heatSourceCalibration) | Projected heat-source calibration workflow |
1618

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

45-
For regular use, source both environments in each new shell or add them to your
46-
shell startup file:
47+
The Python utilities require Python 3.10 through 3.12. To use a dedicated
48+
virtual environment, create it and install the pinned dependencies from the
49+
repository root:
50+
51+
```sh
52+
python3 -m venv .venv
53+
. .venv/bin/activate
54+
python -m pip install -r requirements.txt
55+
python -m pip check
56+
calibrateHeatSource --help
57+
```
58+
59+
To use an existing Python environment instead, activate that environment and
60+
install the same requirements into it:
61+
62+
```sh
63+
python -m pip install -r /path/to/AdditiveFOAM/requirements.txt
64+
python -m pip check
65+
```
66+
67+
The AdditiveFOAM environment does not create or activate a Python environment.
68+
Source the OpenFOAM and AdditiveFOAM environments in each new shell:
4769

4870
```sh
4971
source /path/to/OpenFOAM-14/etc/bashrc

‎applications/solvers/additiveFoam/additiveFoam.C‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Description
4242

4343
#include "fvmDiv.H"
4444
#include "fvmDdt.H"
45+
#include "fvcDdt.H"
46+
#include "fvcFlux.H"
47+
#include "fvcLaplacian.H"
48+
#include "fvcMeshPhi.H"
49+
#include "fvcReconstruct.H"
50+
#include "fvcSnGrad.H"
4551
#include "fvcSurfaceIntegrate.H"
4652
#include "fvcVolumeIntegrate.H"
4753
#include "fvmLaplacian.H"
@@ -56,7 +62,7 @@ Description
5662
#include "CrankNicolsonDdtScheme.H"
5763

5864
#include "additiveFoamInfo.H"
59-
#include "movingHeatSourceModel.H"
65+
#include "movingHeatSources.H"
6066
#include "thermoPath.H"
6167
#include "interpolateXY.H"
6268

@@ -82,7 +88,7 @@ int main(int argc, char *argv[])
8288
// Initialize time-stepping controls
8389
scalar DiNum = 0.0;
8490
scalar alphaCoNum = 0.0;
85-
movingHeatSourceModel sources(mesh);
91+
movingHeatSources sources(mesh);
8692

8793
Info<< "\nStarting time loop\n" << endl;
8894

‎applications/solvers/additiveFoam/derivedFvPatchFields/marangoni/marangoniFvPatchVectorField.H‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ SourceFiles
3636
3737
\*---------------------------------------------------------------------------*/
3838

39-
#ifndef BC_H
40-
#define BC_H
39+
#ifndef marangoniFvPatchVectorField_H
40+
#define marangoniFvPatchVectorField_H
4141

4242
#include "fvPatchFields.H"
4343
#include "transformFvPatchFields.H"

‎applications/solvers/additiveFoam/derivedFvPatchFields/mixedTemperature/mixedTemperatureFvPatchScalarField.C‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ mixedTemperatureFvPatchScalarField
7878
valueFraction() = 0.0;
7979

8080
refValue() = scalarField("Tinf", dict, p.size());
81-
fvPatchScalarField::operator=(refValue());
81+
fvPatchScalarField::operator=
82+
(
83+
scalarField("value", iF.dimensions(), dict, p.size())
84+
);
8285
}
8386

8487

‎applications/solvers/additiveFoam/derivedFvPatchFields/mixedTemperature/mixedTemperatureFvPatchScalarField.H‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Usage
4747
h | Uniform convection coeff | yes |
4848
emissivity | Uniform surface emissivity | no | transportProperties
4949
Tinf | Ambient temperature | yes |
50+
value | Initial patch temperature | yes |
5051
\endtable
5152
5253
Example of the boundary condition specification:
@@ -55,6 +56,8 @@ Usage
5556
{
5657
type mixedTemperature;
5758
h 10.0;
59+
Tinf uniform 300;
60+
value uniform 300;
5861
}
5962
\endverbatim
6063
@@ -63,8 +66,8 @@ SourceFiles
6366
6467
\*---------------------------------------------------------------------------*/
6568

66-
#ifndef BC_H
67-
#define BC_H
69+
#ifndef mixedTemperatureFvPatchScalarField_H
70+
#define mixedTemperatureFvPatchScalarField_H
6871

6972
#include "mixedFvPatchFields.H"
7073
#include "Function1.H"

‎applications/solvers/additiveFoam/functionObjects/meltPoolDimensions/meltPoolDimensions.C‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
\\ / A nd | Copyright (C) 2024 OpenFOAM Foundation
66
\\/ M anipulation |
77
-------------------------------------------------------------------------------
8-
Copyright (C) 2023 Oak Ridge National Laboratory
8+
Copyright (C) 2023-2026 Oak Ridge National Laboratory
99
-------------------------------------------------------------------------------
1010
License
1111
This file is part of OpenFOAM.
@@ -247,7 +247,7 @@ bool Foam::functionObjects::meltPoolDimensions::execute()
247247
// physical boundary : take face point if above iso value
248248
const vectorField& Cf = mesh_.Cf().boundaryField()[patchi];
249249

250-
const scalarField& pif(TPf.patchInternalField());
250+
const scalarField pif(TPf.patchInternalField());
251251

252252
forAll(faceCells, facei)
253253
{

0 commit comments

Comments
 (0)