-
Notifications
You must be signed in to change notification settings - Fork 10
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
Introduce HeatSources #282
base: master
Are you sure you want to change the base?
Changes from all commits
8728e74
7db8d9a
9e31ea3
5fdff90
cf6263f
4ec8fd0
432c229
9e520b7
fce7f5c
9193862
7b88824
ac35083
69394d1
0025d0f
b467051
583ab35
aef6051
3358d7f
647ee6f
76ff0bf
a788186
87efdf7
dea04e4
af4f181
a95bcb3
02a7600
ab3a2d5
24601c6
044ad9f
a01cbc5
6f13c95
1f5f784
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ | |
#ifndef CUBE_HEAT_SOURCE_HH | ||
#define CUBE_HEAT_SOURCE_HH | ||
|
||
#include <HeatSource.hh> | ||
#include <BeamHeatSourceProperties.hh> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no beam here. It's just a static heat source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line should be removed and the copyright date updated. |
||
|
||
#include <deal.II/base/point.h> | ||
|
||
namespace adamantine | ||
{ | ||
|
@@ -17,7 +19,7 @@ namespace adamantine | |
* used for verification purpose. | ||
*/ | ||
template <int dim> | ||
class CubeHeatSource final : public HeatSource<dim> | ||
class CubeHeatSource | ||
{ | ||
public: | ||
/** | ||
|
@@ -38,18 +40,17 @@ public: | |
/** | ||
* Set the time variable. | ||
*/ | ||
void update_time(double time) final; | ||
void update_time(double time); | ||
|
||
/** | ||
* Return the value of the source for a given point and time. | ||
*/ | ||
double value(dealii::Point<dim> const &point, | ||
double const /*height*/) const final; | ||
double value(dealii::Point<dim> const &point, double const /*height*/) const; | ||
/** | ||
* Compute the current height of the where the heat source meets the material | ||
* (i.e. the current scan path height). | ||
*/ | ||
double get_current_height(double const time) const final; | ||
double get_current_height(double const time) const; | ||
|
||
private: | ||
bool _source_on = false; | ||
|
@@ -58,7 +59,9 @@ private: | |
double _value; | ||
dealii::Point<dim> _min_point; | ||
dealii::Point<dim> _max_point; | ||
double _alpha; | ||
}; | ||
|
||
} // namespace adamantine | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,24 +9,29 @@ | |
#include <instantiation.hh> | ||
#include <types.hh> | ||
|
||
#include <deal.II/base/memory_space.h> | ||
|
||
namespace adamantine | ||
{ | ||
|
||
template <int dim> | ||
ElectronBeamHeatSource<dim>::ElectronBeamHeatSource( | ||
boost::property_tree::ptree const &database) | ||
: HeatSource<dim>(database) | ||
: _beam(database), | ||
_scan_path(database.get<std::string>("scan_path_file"), | ||
database.get<std::string>("scan_path_file_format")) | ||
{ | ||
} | ||
|
||
template <int dim> | ||
void ElectronBeamHeatSource<dim>::update_time(double time) | ||
{ | ||
static const double log_01 = std::log(0.1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the point of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
_beam_center = this->_scan_path.value(time); | ||
double segment_power_modifier = this->_scan_path.get_power_modifier(time); | ||
_alpha = | ||
-this->_beam.absorption_efficiency * this->_beam.max_power * | ||
segment_power_modifier * _log_01 / | ||
segment_power_modifier * log_01 / | ||
(dealii::numbers::PI * this->_beam.radius_squared * this->_beam.depth); | ||
} | ||
|
||
|
@@ -52,9 +57,11 @@ double ElectronBeamHeatSource<dim>::value(dealii::Point<dim> const &point, | |
std::pow(point[axis<dim>::y] - _beam_center[axis<dim>::y], 2); | ||
} | ||
|
||
static const double log_01 = std::log(0.1); | ||
|
||
// Electron beam heat source equation | ||
double heat_source = | ||
_alpha * std::exp(_log_01 * xpy_squared / this->_beam.radius_squared) * | ||
_alpha * std::exp(log_01 * xpy_squared / this->_beam.radius_squared) * | ||
distribution_z; | ||
|
||
return heat_source; | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,19 +8,20 @@ | |||||
#ifndef ELECTRON_BEAM_HEAT_SOURCE_HH | ||||||
#define ELECTRON_BEAM_HEAT_SOURCE_HH | ||||||
|
||||||
#include <HeatSource.hh> | ||||||
#include <BeamHeatSourceProperties.hh> | ||||||
#include <ScanPath.hh> | ||||||
|
||||||
#include <limits> | ||||||
|
||||||
namespace adamantine | ||||||
{ | ||||||
/** | ||||||
* A derived class from HeatSource for a model of an electron beam heat source. | ||||||
* A model of an electron beam heat source. | ||||||
* The form of the heat source model is taken from the following reference: | ||||||
* Raghavan et al, Acta Materilia, 112, 2016, pp 303-314. | ||||||
*/ | ||||||
template <int dim> | ||||||
class ElectronBeamHeatSource final : public HeatSource<dim> | ||||||
class ElectronBeamHeatSource | ||||||
{ | ||||||
public: | ||||||
/** | ||||||
|
@@ -38,20 +39,71 @@ public: | |||||
/** | ||||||
* Set the time variable. | ||||||
*/ | ||||||
void update_time(double time) final; | ||||||
void update_time(double time); | ||||||
|
||||||
/** | ||||||
* Returns the value of an electron beam heat source at a specified point and | ||||||
* time. | ||||||
*/ | ||||||
double value(dealii::Point<dim> const &point, | ||||||
double const height) const final; | ||||||
double value(dealii::Point<dim> const &point, double const height) const; | ||||||
|
||||||
/** | ||||||
* Return the scan path. | ||||||
*/ | ||||||
ScanPath &get_scan_path(); | ||||||
|
||||||
void set_scan_path(ScanPath const scan_path) { _scan_path = scan_path; } | ||||||
|
||||||
/** | ||||||
* Compute the current height of the where the heat source meets the material | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* (i.e. the current scan path height). | ||||||
*/ | ||||||
double get_current_height(double const time) const; | ||||||
|
||||||
/** | ||||||
* (Re)set the BeamHeatSourceProperties member variable, necessary if the | ||||||
* beam parameters vary in time (e.g. due to data assimilation). | ||||||
*/ | ||||||
void set_beam_properties(boost::property_tree::ptree const &database); | ||||||
|
||||||
/** | ||||||
* Return the beam properties. | ||||||
*/ | ||||||
BeamHeatSourceProperties const &get_beam_properties() const; | ||||||
|
||||||
private: | ||||||
dealii::Point<3> _beam_center; | ||||||
double _alpha = std::numeric_limits<double>::signaling_NaN(); | ||||||
double const _log_01 = std::log(0.1); | ||||||
BeamHeatSourceProperties _beam; | ||||||
ScanPath _scan_path; | ||||||
}; | ||||||
|
||||||
template <int dim> | ||||||
ScanPath &ElectronBeamHeatSource<dim>::get_scan_path() | ||||||
{ | ||||||
return _scan_path; | ||||||
} | ||||||
|
||||||
template <int dim> | ||||||
double ElectronBeamHeatSource<dim>::get_current_height(double const time) const | ||||||
{ | ||||||
return _scan_path.value(time)[2]; | ||||||
} | ||||||
|
||||||
template <int dim> | ||||||
void ElectronBeamHeatSource<dim>::set_beam_properties( | ||||||
boost::property_tree::ptree const &database) | ||||||
{ | ||||||
_beam.set_from_database(database); | ||||||
} | ||||||
Rombur marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
template <int dim> | ||||||
BeamHeatSourceProperties const & | ||||||
ElectronBeamHeatSource<dim>::get_beam_properties() const | ||||||
{ | ||||||
return _beam; | ||||||
} | ||||||
|
||||||
} // namespace adamantine | ||||||
|
||||||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the copyright date to
2024