76 void load(
int argc,
char * argv[]);
83 appParamsManager(
"multicomponent_flow",
"0.1"),
85 dx(0.0005,
"dx",
"space step"),
86 dt(1.,
"dt",
"time step"),
87 tSimulation(2e-3,
"simulation_time",
"simulation time"),
88 tOutput(1e-4,
"output_interval",
"output interval"),
89 nu(4e-8/1.6,
"nu",
"viscosity"),
90 tubeL(0.25,
"tubeL",
"tube's length"),
91 tubeD(0.05,
"tubeD",
"tube's diameter"),
92 pumpL(0.025,
"pumpL",
"pump's length"),
93 pumpD(0.03,
"pumpD",
"pump's diameter"),
94 component1InVel(0.16,
"component1_in_velocity",
"flow velocity in the component1 input"),
95 component2InVel(0.08,
"component2_in_velocity",
"flow velocity in the component2 input"),
96 component3InVel(0.1,
"component3_in_velocity",
"flow velocity in the component3 input")
117 void Parameters::init()
135 orientation[1] = 1.0;
136 orientation[2] = 0.0;
137 center[2] = params.
pumpD.
v() * 1.5;
139 orientation, center);
145 int main(
int argc,
char *argv[])
148 params.
load(argc, argv);
150 cout <<
"Data initialization..." << endl;
154 auto mcfMapMem(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
157 auto component1Frac(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
159 auto component3Frac(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
163 cout <<
"Finished" << endl;
165 cout <<
"Numerics initialization..." << endl;
177 auto flowVel(lbgk->getVelocity());
179 flowVel, templ,
true));
180 nmcomponent1->init();
183 nmcomponent3->init();
185 std::vector<asl::SPNumMethod> bc;
186 std::vector<asl::SPNumMethod> bcV;
187 std::vector<asl::SPNumMethod> bcDif;
215 cout <<
"Finished" << endl;
216 cout <<
"Computing..." << endl;
221 writer.
addScalars(
"component1", *component1Frac);
222 writer.
addScalars(
"component3", *component3Frac);
233 for (
unsigned int i(1); i < 10001; ++i)
237 nmcomponent1->execute();
238 nmcomponent3->execute();
244 cout << i <<
"/10000; time left (estimated): " << timer.
estimatedRemainder(
double(i)/10000.) << endl;
252 cout <<
"Finished" << endl;
254 cout <<
"Computation statistic:" << endl;
255 cout <<
"Real Time = " << timer.
realTime() <<
"; Processor Time = " asl::Parameter< double > dt
const double estimatedRemainder(double completeness)
Returns estimated time till finishing current task based on its current completeness [0....
asl::Parameter< double > component1InVel
const double realTime() const
std::shared_ptr< DistanceFunction > SPDistanceFunction
const double processorTime() const
asl::ApplicationParametersManager appParamsManager
asl::Parameter< double > nu
Numerical method for fluid flow.
SPDistanceFunction normalize(SPDistanceFunction a, double dx)
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
void addVector(std::string name, AbstractData &data)
int main(int argc, char *argv[])
asl::Parameter< double > tubeL
asl::Parameter< double > pumpD
void initAll(std::vector< T * > &v)
SPBCond generateBCConstantPressureVelocity(SPLBGK nm, double p, AVec<> v, const std::vector< SlicesNames > &sl)
SPDistanceFunction generateDFCylinderInf(double r, const AVec< double > &l, const AVec< double > &c)
generates infinite cylinder
asl::SPDistanceFunction generateMixer(asl::Block &block, Parameters ¶ms)
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
std::shared_ptr< LBGK > SPLBGK
const VectorTemplate & d3q15()
Vector template.
SPFDAdvectionDiffusion generateFDAdvectionDiffusion(SPDataWithGhostNodesACLData c, double diffustionCoeff, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
asl::Parameter< double > tSimulation
acl::VectorOfElements dx(const TemplateVE &a)
differential operator
asl::Parameter< double > tOutput
void load(int argc, char *argv[])
asl::Parameter< double > pumpL
void initData(SPAbstractData d, double a)
asl::UValue< double > nuNum
SPBCond generateBCConstantGradient(SPAbstractDataWithGhostNodes d, double v, const VectorTemplate *const t, const std::vector< SlicesNames > &sl)
Bondary condition that makes fixed gradient.
void executeAll(std::vector< T * > &v)
void addScalars(std::string name, AbstractData &data)
SPBCond generateBCConstantPressure(SPLBGK nm, double p, const std::vector< SlicesNames > &sl)
asl::Parameter< double > dx
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
asl::Parameter< double > tubeD
SPBCond generateBCConstantValue(SPAbstractDataWithGhostNodes d, double v, const std::vector< SlicesNames > &sl)
Bondary condition that puts fixed value in each point.
asl::Parameter< double > component3InVel
void load(int argc, char *argv[])
const double processorLoad() const
SPDistanceFunction generateDFInBlock(const Block &b, unsigned int nG)
generates map corresponding to external (ghost) part of the block
asl::Parameter< double > component2InVel
SPNumMethod generateBCNoSlipVel(SPLBGK nmU, SPAbstractDataWithGhostNodes map)
for velocity field
contains different kernels for preprocessing and posprocessing of data used by LBGK
SPBCond generateBCNoSlip(SPLBGK nm, const std::vector< SlicesNames > &sl)