-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added redeposition model and example (#35)
* First version of redeposition model * Seperate psMakeStack file * Added config file and animation * Added description and check gif * Added coordinates in calculateVelocities function * Fixed typos and removed intermediate meshes in visualization mesh
- Loading branch information
Showing
22 changed files
with
735 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.4) | ||
|
||
project("Redeposition") | ||
|
||
add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${VIENNAPS_INCLUDE_DIRS}) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE ${VIENNAPS_LIBRARIES}) | ||
configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) | ||
|
||
add_dependencies(buildExamples ${PROJECT_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
|
||
#include <psUtils.hpp> | ||
|
||
template <typename T> struct Parameters { | ||
// Domain | ||
T gridDelta = 0.2; | ||
T xExtent = 10.0; | ||
|
||
// Geometry | ||
int numLayers = 26; | ||
T layerHeight = 2; | ||
T substrateHeight = 4; | ||
T holeRadius = 2; | ||
|
||
// Process | ||
T diffusionCoefficient = 10.; // diffusion cofficient | ||
T sink = 0.001; // sink strength | ||
// convection velocity in the scallops towards the center | ||
T scallopStreamVelocity = 10.; | ||
// convection velocity in the center towards the sink on the top | ||
T holeStreamVelocity = 10.; | ||
|
||
Parameters() {} | ||
|
||
void fromMap(std::unordered_map<std::string, std::string> &m) { | ||
psUtils::AssignItems( // | ||
m, // | ||
psUtils::Item{"gridDelta", gridDelta}, // | ||
psUtils::Item{"xExtent", xExtent}, // | ||
psUtils::Item{"numLayers", numLayers}, // | ||
psUtils::Item{"layerHeight", layerHeight}, // | ||
psUtils::Item{"substrateHeight", substrateHeight}, // | ||
psUtils::Item{"holeRadius", holeRadius}, // | ||
psUtils::Item{"diffusionCoefficient", diffusionCoefficient}, // | ||
psUtils::Item{"sink", sink}, // | ||
psUtils::Item{"scallopStreamVelocity", scallopStreamVelocity}, // | ||
psUtils::Item{"holeStreamVelocity", holeStreamVelocity} // | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#include <csDenseCellSet.hpp> | ||
#include <csTracing.hpp> | ||
|
||
#include <psMakeStack.hpp> | ||
#include <psProcess.hpp> | ||
#include <psProcessModel.hpp> | ||
#include <psWriteVisualizationMesh.hpp> | ||
|
||
#include <StackRedeposition.hpp> | ||
|
||
#include "Parameters.hpp" | ||
|
||
int main(int argc, char **argv) { | ||
using NumericType = double; | ||
|
||
omp_set_num_threads(12); | ||
// Attention: | ||
// This model/example currently only works in 2D mode | ||
constexpr int D = 2; | ||
|
||
Parameters<NumericType> params; | ||
if (argc > 1) { | ||
auto config = psUtils::readConfigFile(argv[1]); | ||
if (config.empty()) { | ||
std::cerr << "Empty config provided" << std::endl; | ||
return -1; | ||
} | ||
params.fromMap(config); | ||
} | ||
|
||
auto domain = psSmartPointer<psDomain<NumericType, D>>::New(); | ||
psMakeStack<NumericType, D> builder( | ||
domain, params.gridDelta, params.xExtent, 0., params.numLayers, | ||
params.layerHeight, params.substrateHeight, params.holeRadius, false); | ||
builder.apply(); | ||
// copy top layer for deposition | ||
auto depoLayer = psSmartPointer<lsDomain<NumericType, D>>::New( | ||
domain->getLevelSets()->back()); | ||
domain->insertNextLevelSet(depoLayer); | ||
domain->generateCellSet(2., true /* true means cell set above surface */); | ||
auto &cellSet = domain->getCellSet(); | ||
cellSet->writeVTU("initial.vtu"); | ||
// we need neighborhood information for solving the | ||
// convection-diffusion equation on the cell set | ||
cellSet->buildNeighborhood(); | ||
|
||
// The redeposition model captures byproducts from the selective etching | ||
// process in the cell set. The byproducts are then distributed by solving a | ||
// convection-diffusion equation on the cell set. | ||
auto redepoModel = psSmartPointer<RedepositionDynamics<NumericType, D>>::New( | ||
domain, params.diffusionCoefficient, params.sink, | ||
params.scallopStreamVelocity, params.holeStreamVelocity, | ||
builder.getTopLayer(), builder.getHeight(), builder.getHoleRadius()); | ||
auto velField = psSmartPointer<psDefaultVelocityField<NumericType>>::New(); | ||
auto etchSurfModel = | ||
psSmartPointer<SelectiveEtchingSurfaceModel<NumericType>>::New(); | ||
auto depoSurfModel = | ||
psSmartPointer<RedepositionSurfaceModel<NumericType, D>>::New( | ||
cellSet, 1., builder.getHeight(), builder.getTopLayer()); | ||
|
||
// run the selective etching process | ||
{ | ||
auto etchModel = psSmartPointer<psProcessModel<NumericType, D>>::New(); | ||
etchModel->setSurfaceModel(etchSurfModel); | ||
etchModel->setVelocityField(velField); | ||
etchModel->setAdvectionCallback(redepoModel); | ||
etchModel->setProcessName("SelectiveEtching"); | ||
|
||
psProcess<NumericType, D> processEtch; | ||
processEtch.setDomain(domain); | ||
processEtch.setProcessModel(etchModel); | ||
processEtch.setProcessDuration(50.); | ||
|
||
processEtch.apply(); | ||
} | ||
|
||
// run the redeposition based on the captured byproducts | ||
{ | ||
auto depoModel = psSmartPointer<psProcessModel<NumericType, D>>::New(); | ||
depoModel->setSurfaceModel(depoSurfModel); | ||
depoModel->setVelocityField(velField); | ||
depoModel->setProcessName("Redeposition"); | ||
|
||
psProcess<NumericType, D> processRedepo; | ||
processRedepo.setDomain(domain); | ||
processRedepo.setProcessModel(depoModel); | ||
processRedepo.setProcessDuration(0.2); | ||
|
||
processRedepo.apply(); | ||
cellSet->updateMaterials(); | ||
cellSet->writeVTU("RedepositionCellSet.vtu"); | ||
} | ||
|
||
psWriteVisualizationMesh<NumericType, D>(domain, "FinalStack").apply(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Config file for a redeposition example process | ||
# Domain | ||
gridDelta=0.1 | ||
xExtent=10.0 | ||
|
||
# Geometry | ||
int numLayers=26 | ||
layerHeight=2 | ||
substrateHeight=4 | ||
holeRadius=2 | ||
|
||
# Process | ||
diffusionCoefficient=10. | ||
sink=0.001 | ||
scallopStreamVelocity=2. | ||
holeStreamVelocity=2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.