Skip to content

Commit

Permalink
Fixed stlFile endless loop
Browse files Browse the repository at this point in the history
  • Loading branch information
micheltakken committed Jul 10, 2024
1 parent 6a54db9 commit e2b0f99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 1 addition & 10 deletions src/simulation/simulators/essContinuous.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,7 @@ namespace sim {
int maxIter = 1e7; ///< Maximum total iterations.
int theta = 10; ///< Number of OLB iterations per communication iteration.

std::string vtkFolder = "./tmp/"; ///< Folder in which vtk files will be saved.
std::string name; ///< Name of the module.
std::string stlFile; ///< The STL file of the CFD domain.

bool initialized = false; ///< Is the module initialized?
bool isConverged = false; ///< Has the module converged?

std::unordered_map<int, std::shared_ptr<arch::Node<T>>> allNodes; ///< Fully connected graph as network for the initial approximation.
std::unordered_map<int, arch::Opening<T>> moduleOpenings; ///< Map of openings.
std::unordered_map<int, bool> groundNodes; ///< Map of nodes that communicate the pressure to the 1D solver.

T charPhysLength; ///< Characteristic physical length (= width, usually).
T charPhysVelocity; ///< Characteristic physical velocity (expected maximal velocity).
Expand Down Expand Up @@ -134,7 +125,7 @@ namespace sim {
* @returns Ground nodes.
*/
std::unordered_map<int, bool> getGroundNodes() {
return groundNodes;
return this->groundNodes;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/simulation/simulators/essContinuous.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace sim{
epsilon(epsilon_), relaxationTime(relaxationTime_)
{
this->cfdModule->setModuleTypeEssLbm();
allNodes = cfdModule_->getNodes();
}

template<typename T>
Expand All @@ -37,11 +36,12 @@ namespace sim{
void essLbmSimulator<T>::lbmInit(T dynViscosity, T density)
{

std::string work_dir = "/home/alexander.stadik/ALSIM/Automate/mmft-hybrid-simulator/build";
std::string work_dir = "/home/michel/Git/mmft-hybrid-simulator/build/";
const auto& allNodes = this->moduleNetwork->getNodes();
std::unordered_map<int, ess::BoundaryNode> nodes(allNodes.size());
std::unordered_map<int, ess::Opening> openings;

for(auto& op : moduleOpenings)
for(auto& op : this->moduleOpenings)
{
ess::Opening opening;
opening.width = op.second.width;
Expand All @@ -57,7 +57,7 @@ namespace sim{
nodes.try_emplace(op.first, node);
}

solver_ = std::make_shared<ess::lbmSolver>(work_dir, stlFile, openings, nodes, charPhysLength, charPhysVelocity, 1.0f / resolution, epsilon, relaxationTime, density, dynViscosity);
solver_ = std::make_shared<ess::lbmSolver>(work_dir, this->stlFile, openings, nodes, charPhysLength, charPhysVelocity, 1.0f / resolution, epsilon, relaxationTime, density, dynViscosity);
solver_->prepareLattice();

#ifdef DEBUG
Expand All @@ -78,7 +78,7 @@ namespace sim{
setPressures(pressures);

#ifdef VERBOSE
std::cout << "[essLbmModule] lbmInit " << name << "... OK" << std::endl;
std::cout << "[essLbmModule] lbmInit " << this->name << "... OK" << std::endl;
#endif
}

Expand Down

0 comments on commit e2b0f99

Please sign in to comment.