29#include <utilities/aslParametersManager.h>
30#include <math/aslTemplates.h>
31#include <aslGeomInc.h>
32#include <aslDataInc.h>
33#include <acl/aclGenerators.h>
34#include <writers/aslVTKFormatWriters.h>
35#include <num/aslLBGK.h>
36#include <num/aslLBGKBC.h>
37#include <utilities/aslTimer.h>
38#include <num/aslFDAdvectionDiffusion.h>
39#include <num/aslBasicBC.h>
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")
117void Parameters::init()
132 mixerGeometry = generateDFCylinderInf(params.
tubeD.
v() / 2., orientation,
135 orientation[1] = 1.0;
136 orientation[2] = 0.0;
137 center[2] = params.
pumpD.
v() * 1.5;
138 mixerGeometry = mixerGeometry | generateDFCylinderInf(params.
pumpD.
v() / 2.,
139 orientation, center);
145int main(
int argc,
char *argv[])
148 params.
load(argc, argv);
150 cout <<
"Data initialization..." << endl;
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;
189 bc.push_back(generateBCNoSlip(lbgk, mcfMapMem));
190 bc.push_back(generateBCConstantPressure(lbgk, 1., {
asl::ZE}));
191 bc.push_back(generateBCConstantPressureVelocity(lbgk, 1.,
194 bc.push_back(generateBCConstantPressureVelocity(lbgk, 1.,
197 bc.push_back(generateBCConstantPressureVelocity(lbgk, 1.,
201 bcDif.push_back(generateBCNoSlipVel(lbgk, mcfMapMem));
202 bc.push_back(generateBCConstantGradient(component1Frac, 0., mcfMapMem, templ));
203 bc.push_back(generateBCConstantGradient(component3Frac, 0., mcfMapMem, templ));
204 bc.push_back(generateBCConstantValue(component1Frac, 1., {
asl::YE}));
207 bc.push_back(generateBCConstantValue(component3Frac, 1., {
asl::Y0}));
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 > pumpD
asl::Parameter< double > tubeL
asl::Parameter< double > component1InVel
asl::Parameter< double > tubeD
asl::Parameter< double > component3InVel
asl::Parameter< double > dt
asl::Parameter< double > tOutput
asl::Parameter< double > pumpL
asl::UValue< double > nuNum
asl::Parameter< double > tSimulation
asl::Parameter< double > nu
asl::Parameter< double > dx
asl::ApplicationParametersManager appParamsManager
asl::Parameter< double > component2InVel
void load(int argc, char *argv[])
void load(int argc, char *argv[])
Numerical method for fluid flow.
contains different kernels for preprocessing and posprocessing of data used by LBGK
const double realTime() const
const double processorTime() const
const double processorLoad() const
const double estimatedRemainder(double completeness)
Returns estimated time till finishing current task based on its current completeness [0....
Updatable value. This class stores value and its TimeStamp.
void addVector(std::string name, AbstractData &data)
void addScalars(std::string name, AbstractData &data)
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
SPDistanceFunction generateDFInBlock(const Block &b, unsigned int nG)
generates map corresponding to external (ghost) part of the block
SPDistanceFunction normalize(SPDistanceFunction a, double dx)
std::shared_ptr< DistanceFunction > SPDistanceFunction
SPFDAdvectionDiffusion generateFDAdvectionDiffusion(SPDataWithGhostNodesACLData c, double diffustionCoeff, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
const VectorTemplate & d3q15()
Vector template.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
asl::SPDistanceFunction generateMixer(asl::Block &block, Parameters ¶ms)
std::shared_ptr< LBGK > SPLBGK
void initData(SPAbstractData d, double a)
std::shared_ptr< LBGKUtilities > SPLBGKUtilities