Skip to content

Commit

Permalink
Add units
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Feb 3, 2025
1 parent f128aa5 commit 4ac7ab2
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 50 deletions.
30 changes: 16 additions & 14 deletions examples/holeEtching/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,34 @@

# all length units are in micrometers (um)
# Domain
gridDelta=4.0 # um
xExtent=100.0 # um
yExtent=100.0 # um
lengthUnit=um
gridDelta=0.03 # um
xExtent=1.0 # um
yExtent=1.0 # um

# Geometry
holeRadius=20.0 # um
maskHeight=65.0 # um
taperAngle=1.5 # degree
holeRadius=0.175 # um
maskHeight=1.2 # um
taperAngle=1.193 # degree

# Process parameters
processTime=50 # seconds
processTime=3
timeUnit=min

# all flux values are units 1e15 / cm²
ionFlux=10.
etchantFlux=500.
oxygenFlux=200.
etchantFlux=3000.
oxygenFlux=1500.

ionExponent=200
meanEnergy=100 # eV
sigmaEnergy=10 # eV
A_O=3 # passivation layer yield constant
A_Si=7 # Si yield constant
A_O=2 # passivation layer yield constant
A_Si=7 # Si yield constant

etchStopDepth=-1000 # maximum etching depth
integrationScheme=EO_1
etchStopDepth=-10 # maximum etching depth
integrationScheme=EO_1

raysPerPoint=1000

outputFile=final
outputFile=final_y0p62
12 changes: 8 additions & 4 deletions examples/holeEtching/holeEtching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace ps = viennaps;

int main(int argc, char *argv[]) {
using NumericType = double;
constexpr int D = 3;
constexpr int D = 2;

ps::Logger::setLogLevel(ps::LogLevel::INTERMEDIATE);
ps::Logger::setLogLevel(ps::LogLevel::INFO);
omp_set_num_threads(16);

// Parse the parameters
Expand All @@ -35,8 +35,7 @@ int main(int argc, char *argv[]) {
.apply();

// use pre-defined model SF6O2 etching model
auto model = ps::SmartPointer<ps::SF6O2Etching<NumericType, D>>::New();
auto &modelParams = model->getParameters();
ps::SF6O2Parameters<NumericType> modelParams;
modelParams.ionFlux = params.get("ionFlux");
modelParams.etchantFlux = params.get("etchantFlux");
modelParams.oxygenFlux = params.get("oxygenFlux");
Expand All @@ -46,6 +45,11 @@ int main(int argc, char *argv[]) {
modelParams.Passivation.A_ie = params.get("A_O");
modelParams.Si.A_ie = params.get("A_Si");
modelParams.etchStopDepth = params.get("etchStopDepth");
auto model =
ps::SmartPointer<ps::SF6O2Etching<NumericType, D>>::New(modelParams);

ps::units::Length::setUnit(params.get<std::string>("lengthUnit"));
ps::units::Time::setUnit(params.get<std::string>("timeUnit"));

// process setup
ps::Process<NumericType, D> process;
Expand Down
55 changes: 31 additions & 24 deletions include/viennaps/models/psSF6O2Etching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "../psConstants.hpp"
#include "../psProcessModel.hpp"
#include "../psSurfaceModel.hpp"
#include "../psUnits.hpp"
#include "../psVelocityField.hpp"

namespace viennaps {
Expand Down Expand Up @@ -142,16 +143,22 @@ class SF6O2SurfaceModel : public SurfaceModel<NumericType> {
eCoverage->at(i) * ionEnhancedFlux->at(i) * params.ionFlux;
const auto chemicalRate = params.Si.k_sigma * eCoverage->at(i) / 4.;

// The etch rate is calculated in nm/s
const double unitConversion =
units::Time::getInstance().convertSecond() /
units::Length::getInstance().convertNanometer();

if (MaterialMap::isMaterial(materialIds[i], Material::Mask)) {
etchRate[i] = -(1 / params.Mask.rho) * sputterRate;
etchRate[i] = -(1 / params.Mask.rho) * sputterRate * unitConversion;
if (Logger::getLogLevel() > 3) {
spRate->at(i) = sputterRate;
ieRate->at(i) = 0.;
chRate->at(i) = 0.;
}
} else {
etchRate[i] = -(1 / params.Si.rho) * (chemicalRate + sputterRate +
ionEnhancedRate); // in um / s
etchRate[i] = -(1 / params.Si.rho) *
(chemicalRate + sputterRate + ionEnhancedRate) *
unitConversion;
if (Logger::getLogLevel() > 3) {
spRate->at(i) = sputterRate;
ieRate->at(i) = ionEnhancedRate;
Expand Down Expand Up @@ -271,19 +278,19 @@ class SF6O2Ion
Eth_sp = params.Mask.Eth_sp;
}

NumericType f_sp_theta =
std::max((1 + B_sp * (1 - cosTheta * cosTheta)) *
std::cos(angle / params.Si.theta_g_sp * M_PI_2),
0.);
NumericType f_ie_theta =
std::max((1 + params.Si.B_ie * (1 - cosTheta * cosTheta)) *
std::cos(angle / params.Si.theta_g_ie * M_PI_2),
0.);
// NumericType f_sp_theta = 1.;
// NumericType f_ie_theta = 1.;
// if (cosTheta < 0.5) {
// f_ie_theta = std::max(3 - 6 * angle / M_PI, 0.);
// }
// NumericType f_sp_theta =
// std::max((1 + B_sp * (1 - cosTheta * cosTheta)) *
// std::cos(angle / params.Si.theta_g_sp * M_PI_2),
// 0.);
// NumericType f_ie_theta =
// std::max((1 + params.Si.B_ie * (1 - cosTheta * cosTheta)) *
// std::cos(angle / params.Si.theta_g_ie * M_PI_2),
// 0.);
NumericType f_sp_theta = 1.;
NumericType f_ie_theta = 1.;
if (cosTheta < 0.5) {
f_ie_theta = std::max(3 - 6 * angle / M_PI, 0.);
}

const double sqrtE = std::sqrt(E);
NumericType Y_sp =
Expand Down Expand Up @@ -339,14 +346,14 @@ class SF6O2Ion
NewEnergy = normalDist(Rng);
} while (NewEnergy > E || NewEnergy < 0.);

// NumericType sticking = 0.;
NumericType sticking = 1.;
if (incAngle > params.Ions.thetaRMin) {
sticking =
1. - std::min((incAngle - params.Ions.thetaRMin) /
(params.Ions.thetaRMax - params.Ions.thetaRMin),
NumericType(1.));
}
NumericType sticking = 0.;
// NumericType sticking = 1.;
// if (incAngle > params.Ions.thetaRMin) {
// sticking =
// 1. - std::min((incAngle - params.Ions.thetaRMin) /
// (params.Ions.thetaRMax - params.Ions.thetaRMin),
// NumericType(1.));
// }

// Set the flag to stop tracing if the energy is below the threshold
if (NewEnergy > params.Si.Eth_ie) {
Expand Down
4 changes: 3 additions & 1 deletion include/viennaps/psProcess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "psProcessModel.hpp"
#include "psTranslationField.hpp"
#include "psUnits.hpp"
#include "psUtils.hpp"

#include <lsAdvect.hpp>
Expand Down Expand Up @@ -677,7 +678,8 @@ template <typename NumericType, int D> class Process {
std::stringstream stream;
stream << std::fixed << std::setprecision(4)
<< "Process time: " << processDuration - remainingTime << " / "
<< processDuration;
<< processDuration << " "
<< units::Time::getInstance().toStringShort();
Logger::getInstance().addInfo(stream.str()).print();
}
}
Expand Down
Loading

0 comments on commit 4ac7ab2

Please sign in to comment.