Skip to content
Snippets Groups Projects
Commit 274eeae3 authored by Hussein Alihussein's avatar Hussein Alihussein
Browse files

clean BC

parent 58563614
No related branches found
No related tags found
2 merge requests!332Add TPMSRow Application.,!329Develop temp
...@@ -26,15 +26,15 @@ void run(string configname) ...@@ -26,15 +26,15 @@ void run(string configname)
double dx = config.getValue<double>("dx"); double dx = config.getValue<double>("dx");
double UnitEdgeLength = config.getValue<double>("UnitEdgeLength"); double UnitEdgeLength = config.getValue<double>("UnitEdgeLength");
double Re = config.getValue<double>("Re"); double Re = config.getValue<double>("Re");
double Re0 = config.getValue<double>("Re0"); //double Re0 = config.getValue<double>("Re0");
//double rhoIn = config.getValue<double>("rhoIn"); //double rhoIn = config.getValue<double>("rhoIn");
//string geometry = config.getValue<string>("geometry"); //string geometry = config.getValue<string>("geometry");
vector<double> length = config.getVector<double>("length"); vector<double> length = config.getVector<double>("length");
//vector<double> FunnelL = config.getVector<double>("FunnelL"); //vector<double> FunnelL = config.getVector<double>("FunnelL");
//vector<double> FunnelOrigin = config.getVector<double>("FunnelOrigin"); //vector<double> FunnelOrigin = config.getVector<double>("FunnelOrigin");
double timeAvStart = config.getValue<double>("timeAvStart"); //double timeAvStart = config.getValue<double>("timeAvStart");
double timeAvStop = config.getValue<double>("timeAvStop"); //double timeAvStop = config.getValue<double>("timeAvStop");
vector<double> TPMSL = config.getVector<double>("TPMSL"); vector<double> TPMSL = config.getVector<double>("TPMSL");
vector<double> TPMSOrigin = config.getVector<double>("TPMSOrigin"); vector<double> TPMSOrigin = config.getVector<double>("TPMSOrigin");
...@@ -456,27 +456,27 @@ void run(string configname) ...@@ -456,27 +456,27 @@ void run(string configname)
SPtr<GbPoint3D> pointOne(new GbPoint3D(-0.00494999997317791,0.008, 0.0099)); SPtr<GbPoint3D> pointOne(new GbPoint3D(-0.00494999997317791,0.008, 0.0099));
SPtr<GbPoint3D> pointTwo(new GbPoint3D(0.14994999766349792, 0.008, 0.0099)); SPtr<GbPoint3D> pointTwo(new GbPoint3D(0.14994999766349792, 0.008, 0.0099));
SPtr<GbLine3D> line(new GbLine3D(pointOne,pointTwo)); SPtr<GbLine3D> line(new GbLine3D(pointOne.get(),pointTwo.get()));
SPtr<UbScheduler> linSch(new UbScheduler(outTime/20,outTime/2/*,beginTime,endTime*/)); SPtr<UbScheduler> linSch(new UbScheduler(outTime/20,outTime/2/*,beginTime,endTime*/));
SPtr<SimulationObserver> lp(new LineTimeSeriesSimulationObserver(grid, linSch, pathname, WbWriterVtkXmlBinary::getInstance(), line,refineLevel, comm)); SPtr<SimulationObserver> lp(new LineTimeSeriesSimulationObserver(grid, linSch, pathname + "line", line,refineLevel, comm));
SPtr<UbScheduler> visSch(new UbScheduler(outTime/*,beginTime,endTime*/)); SPtr<UbScheduler> visSch(new UbScheduler(outTime/*,beginTime,endTime*/));
SPtr<SimulationObserver> pp(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, comm)); SPtr<SimulationObserver> pp(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, comm));
SPtr<UbScheduler> tavSch(new UbScheduler(100, timeAvStart, timeAvStop)); //SPtr<UbScheduler> tavSch(new UbScheduler(100, timeAvStart, timeAvStop));
SPtr<TimeAveragedValuesSimulationObserver> tav(new TimeAveragedValuesSimulationObserver(grid, pathname, WbWriterVtkXmlBinary::getInstance(), tavSch, comm, //SPtr<TimeAveragedValuesSimulationObserver> tav(new TimeAveragedValuesSimulationObserver(grid, pathname, WbWriterVtkXmlBinary::getInstance(), tavSch, comm,
TimeAveragedValuesSimulationObserver::Density | TimeAveragedValuesSimulationObserver::Velocity | TimeAveragedValuesSimulationObserver::Fluctuations)); //TimeAveragedValuesSimulationObserver::Density | TimeAveragedValuesSimulationObserver::Velocity | TimeAveragedValuesSimulationObserver::Fluctuations));
tav->setWithGhostLayer(true); //tav->setWithGhostLayer(true);
SPtr<UbScheduler> nuSch(new UbScheduler(100, 0, endTime / 2)); //SPtr<UbScheduler> nuSch(new UbScheduler(100, 0, endTime / 2));
mu::Parser fnu; //mu::Parser fnu;
fnu.SetExpr("(L*u/T)*(((T-2*t)/Re0)+(2*t/Re))"); //fnu.SetExpr("(L*u/T)*(((T-2*t)/Re0)+(2*t/Re))");
fnu.DefineConst("Re0", Re0); //fnu.DefineConst("Re0", Re0);
fnu.DefineConst("Re", Re); //fnu.DefineConst("Re", Re);
fnu.DefineConst("T", endTime); //fnu.DefineConst("T", endTime);
fnu.DefineConst("L", (UnitEdgeLength / dx)); //fnu.DefineConst("L", (UnitEdgeLength / dx));
fnu.DefineConst("u", vx); //fnu.DefineConst("u", vx);
SPtr<SimulationObserver> nupr(new DecreaseViscositySimulationObserver(grid, nuSch, &fnu, comm)); //SPtr<SimulationObserver> nupr(new DecreaseViscositySimulationObserver(grid, nuSch, &fnu, comm));
SPtr<UbScheduler> nupsSch(new UbScheduler(100, 100, 100000000)); SPtr<UbScheduler> nupsSch(new UbScheduler(100, 100, 100000000));
SPtr<SimulationObserver> npr(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm)); SPtr<SimulationObserver> npr(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm));
...@@ -490,7 +490,7 @@ void run(string configname) ...@@ -490,7 +490,7 @@ void run(string configname)
calculator->addSimulationObserver(npr); calculator->addSimulationObserver(npr);
calculator->addSimulationObserver(pp); calculator->addSimulationObserver(pp);
calculator->addSimulationObserver(migSimulationObserver); calculator->addSimulationObserver(migSimulationObserver);
calculator->addSimulationObserver(tav); //calculator->addSimulationObserver(tav);
if (myid == 0) if (myid == 0)
UBLOG(logINFO, "Simulation-start"); UBLOG(logINFO, "Simulation-start");
......
...@@ -42,20 +42,19 @@ NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy() ...@@ -42,20 +42,19 @@ NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy()
BCStrategy::preCollision = true; BCStrategy::preCollision = true;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy(LBMReal velocity, LBMReal relaxationRate) NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy(real velocity, real relaxationRate)
: BCStrategy(), BCVeloWeight(relaxationRate), velocity(velocity)
{ {
BCStrategy::type = BCStrategy::NonReflectingInflowBCStrategy; BCStrategy::type = BCStrategy::NonReflectingInflowBCStrategy;
BCStrategy::preCollision = true; BCStrategy::preCollision = true;
this->BCVeloWeight=relaxationRate;
this->velocity=velocity;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
NonReflectingInflowBCStrategy::~NonReflectingInflowBCStrategy() = default; NonReflectingInflowBCStrategy::~NonReflectingInflowBCStrategy() = default;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
SPtr<BCStrategy> NonReflectingInflowBCStrategy::clone() SPtr<BCStrategy> NonReflectingInflowBCStrategy::clone()
{ {
SPtr<BCStrategy> bc(new NonReflectingInflowBCStrategy()); SPtr<BCStrategy> bc(new NonReflectingInflowBCStrategy(velocity,BCVeloWeight));
return bc; return bc;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -108,7 +107,7 @@ void NonReflectingInflowBCStrategy::applyBC() ...@@ -108,7 +107,7 @@ void NonReflectingInflowBCStrategy::applyBC()
calcMacrosFct(f, rho, vx1, vx2, vx3); calcMacrosFct(f, rho, vx1, vx2, vx3);
//vx1 = 0.; //vx1 = 0.;
//LBMReal BCVeloWeight = c1o2; //LBMReal BCVeloWeight = c1o2;
LBMReal BCVeloWeight =this->BCVeloWeight; //LBMReal BCVeloWeight =this->BCVeloWeight;
// LBMReal velocity = 0.004814077025232405; // LBMReal velocity = 0.004814077025232405;
// LBMReal velocity = 0.00057735; // LBMReal velocity = 0.00057735;
//LBMReal velocity = 0.04; //LBMReal velocity = 0.04;
...@@ -116,7 +115,7 @@ void NonReflectingInflowBCStrategy::applyBC() ...@@ -116,7 +115,7 @@ void NonReflectingInflowBCStrategy::applyBC()
// LBMReal velocity = 1./112.; // LBMReal velocity = 1./112.;
// LBMReal velocity = 1./126.; // LBMReal velocity = 1./126.;
//LBMReal velocity = c1o100/2; //LBMReal velocity = c1o100/2;
LBMReal velocity = this->velocity; // LBMReal velocity = this->velocity;
// LBMReal velocity = 0.005; // LBMReal velocity = 0.005;
//LBMReal delf =(-velocity+vx1)*0.5 ; //LBMReal delf =(-velocity+vx1)*0.5 ;
LBMReal delf; LBMReal delf;
......
...@@ -42,7 +42,7 @@ class NonReflectingInflowBCStrategy : public BCStrategy ...@@ -42,7 +42,7 @@ class NonReflectingInflowBCStrategy : public BCStrategy
{ {
public: public:
NonReflectingInflowBCStrategy(); NonReflectingInflowBCStrategy();
NonReflectingInflowBCStrategy(LBMReal velocity, LBMReal relaxationRate); NonReflectingInflowBCStrategy(real velocity, real relaxationRate);
~NonReflectingInflowBCStrategy() override; ~NonReflectingInflowBCStrategy() override;
SPtr<BCStrategy> clone() override; SPtr<BCStrategy> clone() override;
void addDistributions(SPtr<DistributionArray3D> distributions) override; void addDistributions(SPtr<DistributionArray3D> distributions) override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment