ASL
0.1.7
Advanced Simulation Library
|
Go to the documentation of this file.
79 void load(
int argc,
char * argv[]);
87 appParamsManager(
"multiphase_flow",
"0.1"),
89 dx(0.002,
"dx",
"space step"),
90 dt(1.,
"dt",
"time step"),
91 tSimulation(2e-3,
"simulation_time",
"simulation time"),
92 tOutput(1e-4,
"output_interval",
"output interval"),
93 nu(4e-8,
"nu",
"viscosity"),
94 tubeL(0.5,
"tubeL",
"tube's length"),
95 tubeD(0.05,
"tubeD",
"tube's diameter"),
96 pumpL(0.025,
"pumpL",
"pump's length"),
97 pumpD(0.03,
"pumpD",
"pump's diameter"),
98 oilInVel(0.02,
"oil_in_velocity",
"flow velocity in the oil input"),
99 waterInVel(0.04,
"water_in_velocity",
"flow velocity in the water input"),
100 gasInVel(0.03,
"gas_in_velocity",
"flow velocity in the gas input")
128 void Parameters::init()
145 orientation[1] = 1.0;
146 orientation[2] = 0.0;
147 center[2]=params.
pumpD.
v() * 1.5;
153 int main(
int argc,
char *argv[])
156 params.
load(argc, argv);
158 std::cout <<
"Data initialization...";
162 auto mpfMapMem(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
165 auto waterFrac(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
168 std::cout <<
"Finished" << endl;
170 std::cout <<
"Numerics initialization...";
182 auto flowVel(lbgk->getVelocity());
186 std::vector<asl::SPNumMethod> bc;
187 std::vector<asl::SPNumMethod> bcV;
188 std::vector<asl::SPNumMethod> bcDif;
208 std::cout <<
"Finished" << endl;
209 std::cout <<
"Computing..." << endl;
214 writer.addScalars(
"water", *waterFrac);
215 writer.addScalars(
"rho", *lbgk->getRho());
216 writer.addVector(
"v", *flowVel);
225 for (
unsigned int i(1); i < 2001; ++i)
235 cout << i <<
"/2000; time left (estimated): " << timer.
estimatedRemainder(
double(i)/2000.) << endl;
243 cout <<
"Finished" << endl;
245 cout <<
"Computation statistic:" << endl;
246 cout <<
"Real Time = " << timer.
realTime() <<
"; Processor Time = "
SPDistanceFunction generateDFInBlock(const Block &b, unsigned int nG)
generates map corresponding to external (ghost) part of the block
SPDistanceFunction generateDFCylinderInf(double r, const AVec< double > &l, const AVec< double > &c)
generates infinite cylinder
const double processorLoad() const
SPFDMultiPhase generateFDMultiPhase(SPDataWithGhostNodesACLData c, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
SPBCond generateBCConstantValue(SPAbstractDataWithGhostNodes d, double v, const std::vector< SlicesNames > &sl)
Bondary condition that puts fixed value in each point.
Numerical method for fluid flow.
asl::ApplicationParametersManager appParamsManager
SPNumMethod generateBCNoSlipVel(SPLBGK nmU, SPAbstractDataWithGhostNodes map)
asl::Parameter< double > waterInVel
const VectorTemplate & d3q15()
Vector template.
SPBCond generateBCConstantPressureVelocity(SPLBGK nm, double p, AVec<> v, const std::vector< SlicesNames > &sl)
asl::Parameter< double > pumpD
asl::UValue< double > Param
acl::VectorOfElements dx(const TemplateVE &a)
differential operator
void load(int argc, char *argv[])
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
const double estimatedRemainder(double completeness)
Returns estimated time till finishing current task based on its current completeness [0....
void addScalars(std::string name, AbstractData &data)
asl::Parameter< double > tubeL
std::shared_ptr< LBGK > SPLBGK
SPBCond generateBCNoSlip(SPLBGK nm, const std::vector< SlicesNames > &sl)
asl::Parameter< double > tOutput
void initAll(std::vector< T * > &v)
void load(int argc, char *argv[])
contains different kernels for preprocessing and posprocessing of data used by LBGK
void initData(SPAbstractData d, double a)
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
asl::UValue< double > nuNum
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
asl::Parameter< double > tSimulation
asl::Parameter< double > oilInVel
asl::Parameter< double > gasInVel
asl::SPDistanceFunction generateMixer(asl::Block &block, Parameters ¶ms)
asl::Parameter< double > tubeD
asl::Parameter< double > pumpL
const double realTime() const
std::shared_ptr< DistanceFunction > SPDistanceFunction
void executeAll(std::vector< T * > &v)
const double processorTime() const
asl::Parameter< double > dx
int main(int argc, char *argv[])
SPBCond generateBCConstantPressure(SPLBGK nm, double p, const std::vector< SlicesNames > &sl)
SPBCond generateBCConstantGradient(SPAbstractDataWithGhostNodes d, double v, const VectorTemplate *const t, const std::vector< SlicesNames > &sl)
Bondary condition that makes fixed gradient.
asl::Parameter< double > nu
SPDistanceFunction normalize(SPDistanceFunction a, double dx)