Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Spatio-Temporal Path system #117

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions doc/content/source/actions/AddSpatioTemporalPathAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AddSpatioTemporalPathAction

This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPath/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPath/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system.
This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPaths/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system.

11 changes: 11 additions & 0 deletions doc/content/source/materials/ADMovingEllipsoidalHeatSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ADMovingEllipsoidalHeatSource

!syntax description /Materials/ADMovingEllipsoidalHeatSource

## Example Input File Syntax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add example input file syntax for each of these documentation files, for those objects present in the added tests. This applies to all the new documentation files except for the action and system pages.


!syntax parameters /Materials/ADMovingEllipsoidalHeatSource

!syntax inputs /Materials/ADMovingEllipsoidalHeatSource

!syntax children /Materials/ADMovingEllipsoidalHeatSource
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CSVPiecewiseLinearSpatioTemporalPath

!syntax description /UserObjects/CSVPiecewiseLinearSpatioTemporalPath

## Example Input File Syntax

!syntax parameters /UserObjects/CSVPiecewiseLinearSpatioTemporalPath

!syntax inputs /UserObjects/CSVPiecewiseLinearSpatioTemporalPath

!syntax children /UserObjects/CSVPiecewiseLinearSpatioTemporalPath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FunctionSpatioTemporalPath

!syntax description /UserObjects/FunctionSpatioTemporalPath

## Example Input File Syntax

!syntax parameters /UserObjects/FunctionSpatioTemporalPath

!syntax inputs /UserObjects/FunctionSpatioTemporalPath

!syntax children /UserObjects/FunctionSpatioTemporalPath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PiecewiseLinearSpatioTemporalPath

!syntax description /UserObjects/PiecewiseLinearSpatioTemporalPath

## Example Input File Syntax

!syntax parameters /UserObjects/PiecewiseLinearSpatioTemporalPath

!syntax inputs /UserObjects/PiecewiseLinearSpatioTemporalPath

!syntax children /UserObjects/PiecewiseLinearSpatioTemporalPath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SpatioTemporalPathElementSubdomainModifier

!syntax description /UserObjects/SpatioTemporalPathElementSubdomainModifier

## Example Input File Syntax

!syntax parameters /UserObjects/SpatioTemporalPathElementSubdomainModifier

!syntax inputs /UserObjects/SpatioTemporalPathElementSubdomainModifier

!syntax children /UserObjects/SpatioTemporalPathElementSubdomainModifier
32 changes: 32 additions & 0 deletions doc/content/syntax/SpatioTemporalPaths/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SpatioTemporalPath System
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a general comment/question - have you thought about (or do you see) this system being applied to some of our current laser melting and laser welding examples? I wonder if there's some quality of life updates to be made in some of these older examples after this goes in....


The SpatioTemporalPath system offers flexible ways of defining spatio-temporal paths, hereinafter referred to as paths, that are often useful in additive manufacturing simulations.

## Overview

A spatio-temporal path is a vector-valued function of time, written as

\begin{equation}
\begin{aligned}
\boldsymbol{x} = f(t)
\end{aligned}
\end{equation}

where $\boldsymbol{x}$ is the path front at time $t$. In addition to the path front, the path object also defines the path's moving velocity $\boldsymbol{v}$ and the path's moving direction $\boldsymbol{t}$, defined as

\begin{equation}
\begin{aligned}
\boldsymbol{v} &= \dfrac{\boldsymbol{x}}{t}
\boldsymbol{t} &= \dfrac{\boldsymbol{v}}{\lVert\boldsymbol{v}\rVert}
\end{aligned}
\end{equation}

## Example Input File Syntax

Spatio-temporal paths are defined under the `[SpatioTemporalPaths]` in the input file and can be referenced by other objects in the input file.

!syntax list /SpatioTemporalPath objects=True actions=False subsystems=False

!syntax list /SpatioTemporalPath objects=False actions=False subsystems=True

!syntax list /SpatioTemporalPath objects=False actions=True subsystems=False
Comment on lines +28 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!syntax list /SpatioTemporalPath objects=True actions=False subsystems=False
!syntax list /SpatioTemporalPath objects=False actions=False subsystems=True
!syntax list /SpatioTemporalPath objects=False actions=True subsystems=False
!syntax list /SpatioTemporalPaths objects=True actions=False subsystems=False
!syntax list /SpatioTemporalPaths objects=False actions=False subsystems=True
!syntax list /SpatioTemporalPaths objects=False actions=True subsystems=False

25 changes: 25 additions & 0 deletions include/actions/AddSpatioTemporalPathAction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "MooseObjectAction.h"

/**
* Add SpatioTemporalPath
*/
class AddSpatioTemporalPathAction : public MooseObjectAction
{
public:
AddSpatioTemporalPathAction(const InputParameters & params);

static InputParameters validParams();

void act() override final;
};
51 changes: 51 additions & 0 deletions include/interfaces/SpatioTemporalPathInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "MooseTypes.h"
#include "InputParameters.h"

class FEProblemBase;
class InputParameters;
class MooseObject;
class SpatioTemporalPath;

/**
* Interface for objects that need to use SpatioTemporalPath
*/
class SpatioTemporalPathInterface
{
public:
SpatioTemporalPathInterface(const MooseObject * moose_object);

/**
* Get a SpatioTemporalPath with a given name
* @param name The name of the parameter key of the SpatioTemporalPath to retrieve
* @return The SpatioTemporalPath with name associated with the parameter 'name'
*/
const SpatioTemporalPath & getSpatioTemporalPath(const std::string & name) const;

/**
* Get a SpatioTemporalPath with a given name
* @param name The name of the SpatioTemporalPath to retrieve
* @return The SpatioTemporalPath with name 'name'
*/
const SpatioTemporalPath & getSpatioTemporalPathByName(const std::string & name) const;

private:
/// Parameters of the object with this interface
const InputParameters & _stpi_params;

/// Reference to FEProblemBase instance
FEProblemBase & _stpi_feproblem;

/// Thread ID
const THREAD_ID _stpi_tid;
};
37 changes: 37 additions & 0 deletions include/materials/ADMovingEllipsoidalHeatSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "ADMovingHeatSource.h"

/**
* @brief A moving ellipsoidal heat source following a SpatioTemporalPath
*/
class ADMovingEllipsoidalHeatSource : public ADMovingHeatSource
{
public:
static InputParameters validParams();

ADMovingEllipsoidalHeatSource(const InputParameters & parameters);

protected:
virtual ADReal computeHeatSource() override;

/// Input power
const ADMaterialProperty<Real> & _P;
/// Length of the ellipsoid semi-axis along the path direction
const ADMaterialProperty<Real> & _a;
/// Length of the ellipsoid semi-axis perpendicular to the path direction
const ADMaterialProperty<Real> & _b;
/// Process efficienty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Process efficienty
/// Process efficiency

const Real _eta;
/// Scaling factor
const Real _scale;
};
41 changes: 41 additions & 0 deletions include/materials/ADMovingHeatSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "Material.h"
#include "SpatioTemporalPath.h"
#include "SpatioTemporalPathInterface.h"

/**
* @brief A moving heat source following a SpatioTemporalPath
*/
class ADMovingHeatSource : public Material, public SpatioTemporalPathInterface
{
public:
static InputParameters validParams();

ADMovingHeatSource(const InputParameters & parameters);

protected:
virtual void computeQpProperties() override;
virtual ADReal computeHeatSource() = 0;

/// The path
const SpatioTemporalPath & _path;

/// The heat source
ADMaterialProperty<Real> & _volumetric_heat;

/// Tangential distance from the heat source
MaterialProperty<Real> & _tangential_distance;

/// Normal distance from the heat source
MaterialProperty<Real> & _normal_distance;
};
24 changes: 24 additions & 0 deletions include/spatiotemporalpaths/CSVPiecewiseLinearSpatioTemporalPath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "PiecewiseLinearSpatioTemporalPathBase.h"

/**
* @brief Construct a piecewise linear path from a csv file
*
*/
class CSVPiecewiseLinearSpatioTemporalPath : public PiecewiseLinearSpatioTemporalPathBase
{
public:
static InputParameters validParams();

CSVPiecewiseLinearSpatioTemporalPath(const InputParameters & params);
};
35 changes: 35 additions & 0 deletions include/spatiotemporalpaths/FunctionSpatioTemporalPath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "SpatioTemporalPath.h"

class Function;

/**
* @brief A spatiotemporal path whose coordinates are specified using MOOSE functions.
*/
class FunctionSpatioTemporalPath : public SpatioTemporalPath
{
public:
static InputParameters validParams();

FunctionSpatioTemporalPath(const InputParameters & params);

virtual Point position(Real t) const override;

protected:
/// The function for the x-coordinate
const Function * _x;
/// The function for the y-coordinate
const Function * _y;
/// The function for the z-coordinate
const Function * _z;
};
23 changes: 23 additions & 0 deletions include/spatiotemporalpaths/PiecewiseLinearSpatioTemporalPath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/

#pragma once

#include "PiecewiseLinearSpatioTemporalPathBase.h"

/**
* @brief Construct a piecewise linear spatiotemporal path from discrete times and vertices.
*/
class PiecewiseLinearSpatioTemporalPath : public PiecewiseLinearSpatioTemporalPathBase
{
public:
static InputParameters validParams();

PiecewiseLinearSpatioTemporalPath(const InputParameters & params);
};
Loading