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 = "
const double estimatedRemainder(double completeness)
Returns estimated time till finishing current task based on its current completeness [0....
SPFDMultiPhase generateFDMultiPhase(SPDataWithGhostNodesACLData c, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
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.
asl::Parameter< double > waterInVel
SPDistanceFunction normalize(SPDistanceFunction a, double dx)
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
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
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
std::shared_ptr< LBGK > SPLBGK
const VectorTemplate & d3q15()
Vector template.
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::SPDistanceFunction generateMixer(asl::Block &block, Parameters ¶ms)
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)
asl::Parameter< double > oilInVel
void addScalars(std::string name, AbstractData &data)
SPBCond generateBCConstantPressure(SPLBGK nm, double p, const std::vector< SlicesNames > &sl)
asl::Parameter< double > gasInVel
asl::Parameter< double > dx
asl::UValue< double > Param
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.
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
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)