Skip to content
Snippets Groups Projects
Commit 1a13cd27 authored by sergio's avatar sergio Committed by Andrew Heather
Browse files

ENH: Adding new Gaussian power profile for laser

parent 33894bf8
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ Foam::radiation::laserDTRM::powerDistNames_ ...@@ -63,6 +63,7 @@ Foam::radiation::laserDTRM::powerDistNames_
{ powerDistributionMode::pdGaussian, "Gaussian" }, { powerDistributionMode::pdGaussian, "Gaussian" },
{ powerDistributionMode::pdManual, "manual" }, { powerDistributionMode::pdManual, "manual" },
{ powerDistributionMode::pdUniform, "uniform" }, { powerDistributionMode::pdUniform, "uniform" },
{ powerDistributionMode::pdGaussianPeak, "GaussianPeak" },
}; };
...@@ -74,6 +75,11 @@ Foam::scalar Foam::radiation::laserDTRM::calculateIp(scalar r, scalar theta) ...@@ -74,6 +75,11 @@ Foam::scalar Foam::radiation::laserDTRM::calculateIp(scalar r, scalar theta)
const scalar power = laserPower_->value(t); const scalar power = laserPower_->value(t);
switch (mode_) switch (mode_)
{ {
case pdGaussianPeak:
{
return I0_*exp(-2.0*sqr(r)/sqr(sigma_));
break;
}
case pdGaussian: case pdGaussian:
{ {
scalar I0 = power/(mathematical::twoPi*sqr(sigma_)); scalar I0 = power/(mathematical::twoPi*sqr(sigma_));
...@@ -196,6 +202,12 @@ void Foam::radiation::laserDTRM::initialise() ...@@ -196,6 +202,12 @@ void Foam::radiation::laserDTRM::initialise()
switch (mode_) switch (mode_)
{ {
case pdGaussianPeak:
{
I0_ = get<scalar>("I0");
sigma_ = get<scalar>("sigma");
break;
}
case pdGaussian: case pdGaussian:
{ {
sigma_ = get<scalar>("sigma"); sigma_ = get<scalar>("sigma");
...@@ -346,6 +358,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T) ...@@ -346,6 +358,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
), ),
sigma_(0), sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)), laserPower_(Function1<scalar>::New("laserPower", *this)),
powerDistribution_(), powerDistribution_(),
...@@ -442,6 +455,7 @@ Foam::radiation::laserDTRM::laserDTRM ...@@ -442,6 +455,7 @@ Foam::radiation::laserDTRM::laserDTRM
), ),
sigma_(0), sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)), laserPower_(Function1<scalar>::New("laserPower", *this)),
powerDistribution_(), powerDistribution_(),
......
...@@ -87,7 +87,8 @@ public: ...@@ -87,7 +87,8 @@ public:
{ {
pdGaussian, pdGaussian,
pdManual, pdManual,
pdUniform pdUniform,
pdGaussianPeak
}; };
...@@ -153,6 +154,9 @@ private: ...@@ -153,6 +154,9 @@ private:
//- Sigma deviation //- Sigma deviation
scalar sigma_; scalar sigma_;
//- Peak flux for GaussianPeak mode
scalar I0_;
//- Power //- Power
autoPtr<Function1<scalar>> laserPower_; autoPtr<Function1<scalar>> laserPower_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment