#include <utilities/aslParametersManager.h>
#include <math/aslTemplates.h>
#include <aslGeomInc.h>
#include <aslDataInc.h>
#include <acl/aclGenerators.h>
#include <writers/aslVTKFormatWriters.h>
#include <num/aslLBGK.h>
#include <num/aslLBGKBC.h>
#include <utilities/aslTimer.h>
#include <num/aslFDAdvectionDiffusion.h>
#include <num/aslBasicBC.h>
{
private:
void init();
public:
void load(
int argc,
char * argv[]);
};
appParamsManager("multicomponent_flow", "0.1"),
size(3),
dx(0.0005, "dx", "space step"),
dt(1., "dt", "time step"),
tSimulation(2e-3, "simulation_time", "simulation time"),
tOutput(1e-4, "output_interval", "output interval"),
nu(4e-8/1.6, "nu", "viscosity"),
tubeL(0.25, "tubeL", "tube's length"),
tubeD(0.05, "tubeD", "tube's diameter"),
pumpL(0.025, "pumpL", "pump's length"),
pumpD(0.03, "pumpD", "pump's diameter"),
component1InVel(0.16, "component1_in_velocity", "flow velocity in the component1 input"),
component2InVel(0.08, "component2_in_velocity", "flow velocity in the component2 input"),
component3InVel(0.1, "component3_in_velocity", "flow velocity in the component3 input")
{
}
{
init();
}
{
}
void Parameters::init()
{
}
{
center);
orientation[1] = 1.0;
orientation[2] = 0.0;
center[2] = params.
pumpD.
v() * 1.5;
orientation, center);
}
int main(
int argc,
char *argv[])
{
cout << "Data initialization..." << endl;
cout << "Finished" << endl;
cout << "Numerics initialization..." << endl;
templ));
lbgk->init();
auto flowVel(lbgk->getVelocity());
flowVel, templ, true));
nmcomponent1->init();
flowVel, templ));
nmcomponent3->init();
std::vector<asl::SPNumMethod> bc;
std::vector<asl::SPNumMethod> bcV;
std::vector<asl::SPNumMethod> bcDif;
{asl::Z0}));
{asl::YE}));
{asl::Y0}));
cout << "Finished" << endl;
cout << "Computing..." << endl;
writer.addScalars("map", *mcfMapMem);
writer.addScalars("component1", *component1Frac);
writer.addScalars("component3", *component3Frac);
writer.addScalars("rho", *lbgk->getRho());
writer.addVector("v", *flowVel);
writer.write();
for (unsigned int i(1); i < 10001; ++i)
{
lbgk->execute();
nmcomponent1->execute();
nmcomponent3->execute();
if (!(i%100))
{
cout << i <<
"/10000; time left (estimated): " << timer.
estimatedRemainder(
double(i)/10000.) << endl;
writer.write();
}
}
cout << "Finished" << endl;
cout << "Computation statistic:" << endl;
cout <<
"Real Time = " << timer.
realTime() <<
"; Processor Time = "
return 0;
}
asl::Parameter< double > pumpD
asl::Parameter< double > tubeL
asl::Parameter< double > component1InVel
asl::Parameter< double > tubeD
asl::Parameter< double > component3InVel
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.
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.
SPBCond generateBCConstantGradient(SPAbstractDataWithGhostNodes d, double v, const VectorTemplate *const t, const std::vector< SlicesNames > &sl)
Bondary condition that makes fixed gradient <>
SPBCond generateBCConstantValue(SPAbstractDataWithGhostNodes d, double v, const std::vector< SlicesNames > &sl)
Bondary condition that puts fixed value in each point.
SPDistanceFunction generateDFInBlock(const Block &b, unsigned int nG)
generates map corresponding to external (ghost) part of the block
SPDistanceFunction normalize(SPDistanceFunction a, double dx)
SPDistanceFunction generateDFCylinderInf(double r, const AVec< double > &l, const AVec< double > &c)
generates infinite cylinder
std::shared_ptr< DistanceFunction > SPDistanceFunction
SPFDAdvectionDiffusion generateFDAdvectionDiffusion(SPDataWithGhostNodesACLData c, double diffustionCoeff, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
const VectorTemplate & d3q15()
Vector template.
SPBCond generateBCConstantPressure(SPLBGK nm, double p, const std::vector< SlicesNames > &sl)
SPNumMethod generateBCNoSlipVel(SPLBGK nmU, SPAbstractDataWithGhostNodes map)
SPBCond generateBCConstantPressureVelocity(SPLBGK nm, double p, AVec<> v, const std::vector< SlicesNames > &sl)
SPBCond generateBCNoSlip(SPLBGK nm, const std::vector< SlicesNames > &sl)
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
asl::SPDistanceFunction generateMixer(asl::Block &block, Parameters ¶ms)
void initAll(std::vector< T * > &v)
std::shared_ptr< LBGK > SPLBGK
void initData(SPAbstractData d, double a)
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
void executeAll(std::vector< T * > &v)