diff --git a/apps/cpu/CouetteFlow/cflow.cpp b/apps/cpu/CouetteFlow/cflow.cpp index 874b8e17aad431799acc0b13412fa025e6254077..2ac32915a9348021acb2ff6e5ee70b24a8dedeb6 100644 --- a/apps/cpu/CouetteFlow/cflow.cpp +++ b/apps/cpu/CouetteFlow/cflow.cpp @@ -100,7 +100,7 @@ void bflow(string configname) double c = 10; // 1.0 / 6.0; double mu0 = 1e-4; - SPtr<Thixotropy> thix = Thixotropy::getInstance(); + SPtr<Rheology> thix = Rheology::getInstance(); //Herschel-Bulkley thix->setPowerIndex(n); thix->setViscosityParameter(k); @@ -111,9 +111,9 @@ void bflow(string configname) thix->setMu0(mu0); SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm())); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new PowellEyringModelNoSlipBCAlgorithm())); - noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyPowellEyringModelNoSlipBCAlgorithm())); + noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm())); //BS visitor BoundaryConditionsBlockVisitor bcVisitor; @@ -124,7 +124,7 @@ void bflow(string configname) //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new PowellEyringModelLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new HerschelBulkleyModelLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyK17LBMKernel()); - SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new BinghamModelLBMKernel()); + SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyBinghamModelLBMKernel()); kernel->setForcingX1(forcing); kernel->setWithForcing(true); kernel->setBCProcessor(bcProc); diff --git a/apps/cpu/HerschelBulkleyModel/hbflow.cpp b/apps/cpu/HerschelBulkleyModel/hbflow.cpp index 7371c782edcacae5d4db566a37248c40c0eb2853..6de995e2af0510fcc19f985a1eb43214b1748090 100644 --- a/apps/cpu/HerschelBulkleyModel/hbflow.cpp +++ b/apps/cpu/HerschelBulkleyModel/hbflow.cpp @@ -120,7 +120,7 @@ void bflow(string configname) double c = 10; // 1.0 / 6.0; double mu0 = 1e-4; - SPtr<Thixotropy> thix = Thixotropy::getInstance(); + SPtr<Rheology> thix = Rheology::getInstance(); //Herschel-Bulkley thix->setPowerIndex(n); thix->setViscosityParameter(k); @@ -131,9 +131,9 @@ void bflow(string configname) thix->setMu0(mu0); SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm())); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new PowellEyringModelNoSlipBCAlgorithm())); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyPowellEyringModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm())); //BS visitor BoundaryConditionsBlockVisitor bcVisitor; diff --git a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp index 3b6ddb814140f1b0e756deef1443577fa79aaf68..f4b50325da703381b9c09b36c18741f7f1c04cc5 100644 --- a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp +++ b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp @@ -94,7 +94,7 @@ void bflow(string configname) double omegaMin = 1.0e-8; - SPtr<Thixotropy> thix = Thixotropy::getInstance(); + SPtr<Rheology> thix = Rheology::getInstance(); thix->setPowerIndex(n); thix->setViscosityParameter(k); thix->setYieldStress(tau0); @@ -102,8 +102,8 @@ void bflow(string configname) SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm())); - noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm())); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm())); + noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm())); SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter()); slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleSlipBCAlgorithm())); diff --git a/apps/cpu/rheometer/rheometer.cpp b/apps/cpu/rheometer/rheometer.cpp index 7ab66c19addd54f8d77b9f90e6f420df4382b4a6..950e6e517562462d1616040d6f8f1b06d2577f54 100644 --- a/apps/cpu/rheometer/rheometer.cpp +++ b/apps/cpu/rheometer/rheometer.cpp @@ -125,7 +125,7 @@ void bflow(string configname) //double omegaMin = 1.0e-8; - SPtr<Thixotropy> thix = Thixotropy::getInstance(); + SPtr<Rheology> thix = Rheology::getInstance(); //thix->setPowerIndex(n); //thix->setViscosityParameter(k); thix->setYieldStress(tau0); @@ -133,8 +133,8 @@ void bflow(string configname) SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm())); - //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm())); - noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm())); + //noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm())); + noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm())); //SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter()); //slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleSlipBCAlgorithm())); @@ -159,7 +159,7 @@ void bflow(string configname) //velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityBCAlgorithm())); //velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleVelocityBCAlgorithm())); //velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityWithDensityBCAlgorithm())); - velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelVelocityBCAlgorithm())); + velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelVelocityBCAlgorithm())); //SPtr<BCAdapter> densityBCAdapter(new DensityBCAdapter()); //densityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm())); diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index fd9eefa1bf2ecb2fe025047e08eb8d8f56e791a8..2db82f26869de24a7145a2bb3ec6c86e9b38c058 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -121,18 +121,18 @@ #include <BoundaryConditions/VelocityBCAdapter.h> #include <BoundaryConditions/VelocityBCAlgorithm.h> #include <BoundaryConditions/VelocityWithDensityBCAlgorithm.h> -#include <BoundaryConditions/DensityAndThixotropyBCAlgorithm.h> -#include <BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.h> -#include <BoundaryConditions/VelocityAndThixotropyBCAlgorithm.h> -#include <BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.h> -#include <BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.h> -#include <BoundaryConditions/SimpleVelocityBCAlgorithm.h> +#include <BoundaryConditions/ThixotropyDensityBCAlgorithm.h> #include <BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h> -#include <BoundaryConditions/BinghamModelNoSlipBCAlgorithm.h> -#include <BoundaryConditions/HerschelBulkleyModelNoSlipBCAlgorithm.h> +#include <BoundaryConditions/ThixotropyVelocityBCAlgorithm.h> +#include <BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.h> +#include <BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.h> +#include <BoundaryConditions/SimpleVelocityBCAlgorithm.h> +#include <BoundaryConditions/RheologyNoSlipBCAlgorithm.h> +#include <BoundaryConditions/RheologyBinghamModelNoSlipBCAlgorithm.h> +#include <BoundaryConditions/RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h> #include <BoundaryConditions/SimpleSlipBCAlgorithm.h> -#include <BoundaryConditions/PowellEyringModelNoSlipBCAlgorithm.h> -#include <BoundaryConditions/BinghamModelVelocityBCAlgorithm.h> +#include <BoundaryConditions/RheologyPowellEyringModelNoSlipBCAlgorithm.h> +#include <BoundaryConditions/RheologyBinghamModelVelocityBCAlgorithm.h> #include <BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h> #include <BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.h> #include <BoundaryConditions/MultiphaseVelocityBCAdapter.h> @@ -230,13 +230,14 @@ #include <LBM/ThixotropyLBMKernel.h> #include <LBM/ThixotropyExpLBMKernel.h> #include <LBM/CumulantLBMKernel.h> -#include <LBM/ThixotropyModelLBMKernel.h> -#include <LBM/ThixotropyModelLBMKernel2.h> -#include <LBM/BinghamModelLBMKernel.h> -#include <LBM/HerschelBulkleyModelLBMKernel.h> -#include <LBM/ThixotropyInterpolationProcessor.h> +//#include <LBM/RheologyModelLBMKernel.h> +//#include <LBM/RheologyModelLBMKernel2.h> +#include <LBM/RheologyBinghamModelLBMKernel.h> +#include <LBM/RheologyHerschelBulkleyModelLBMKernel.h> +#include <LBM/RheologyInterpolationProcessor.h> +#include <LBM/Rheology.h> #include <LBM/RheologyK17LBMKernel.h> -#include <LBM/PowellEyringModelLBMKernel.h> +#include <LBM/RheologyPowellEyringModelLBMKernel.h> #include <LBM/MultiphaseCumulantLBMKernel.h> diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h index 3bbc01cd9c488970df865f420b84a76d21c6ac9a..3547b880af539bc9b12a62a6f245ab38caaac64d 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h @@ -56,17 +56,17 @@ public: static const char ThinWallNoSlipBCAlgorithm = 6; static const char VelocityWithDensityBCAlgorithm = 7; static const char NonReflectingOutflowBCAlgorithm = 8; - static const char VelocityAndThixotropyBCAlgorithm = 9; - static const char DensityAndThixotropyBCAlgorithm = 10; - static const char NoSlipAndThixotropyBCAlgorithm = 11; - static const char NonReflectingOutflowAndThixotropyBCAlgorithm = 12; - static const char VelocityWithDensityAndThixotropyBCAlgorithm = 13; - static const char BinghamModelNoSlipBCAlgorithm = 14; - static const char HerschelBulkleyModelNoSlipBCAlgorithm = 15; + static const char ThixotropyVelocityBCAlgorithm = 9; + static const char ThixotropyDensityBCAlgorithm = 10; + static const char ThixotropyNoSlipBCAlgorithm = 11; + static const char ThixotropyNonReflectingOutflowBCAlgorithm = 12; + static const char ThixotropyVelocityWithDensityBCAlgorithm = 13; + static const char RheologyBinghamModelNoSlipBCAlgorithm = 14; + static const char RheologyHerschelBulkleyModelNoSlipBCAlgorithm = 15; static const char SimpleVelocityBCAlgorithm = 16; static const char SimpleSlipBCAlgorithm = 17; - static const char PowellEyringModelNoSlipBCAlgorithm = 18; - static const char BinghamModelVelocityBCAlgorithm = 19; + static const char RheologyPowellEyringModelNoSlipBCAlgorithm = 18; + static const char RheologyBinghamModelVelocityBCAlgorithm = 19; static const char MultiphaseNoSlipBCAlgorithm = 20; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/HerschelBulkleyModelNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/HerschelBulkleyModelNoSlipBCAlgorithm.h deleted file mode 100644 index 46bfbd19310d8d4d710581fdde212461c922b5f1..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/HerschelBulkleyModelNoSlipBCAlgorithm.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef HerschelBulkleyModelNoSlipBCAlgorithm_h__ -#define HerschelBulkleyModelNoSlipBCAlgorithm_h__ - -#include "ThixotropyNoSlipBCAlgorithm.h" -#include "Thixotropy.h" - -class HerschelBulkleyModelNoSlipBCAlgorithm : public ThixotropyNoSlipBCAlgorithm -{ -public: - HerschelBulkleyModelNoSlipBCAlgorithm() - { - BCAlgorithm::type = BCAlgorithm::HerschelBulkleyModelNoSlipBCAlgorithm; - BCAlgorithm::preCollision = true; - } - ~HerschelBulkleyModelNoSlipBCAlgorithm() {} - SPtr<BCAlgorithm> clone() override - { - SPtr<BCAlgorithm> bc(new HerschelBulkleyModelNoSlipBCAlgorithm()); - return bc; - } -protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override - { - return Thixotropy::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); - } -}; -#endif // HerschelBulkleyModelNoSlipBCAlgorithm_h__ \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.cpp deleted file mode 100644 index cfed98d784cb70c647c9dcf45270174e29f99139..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "NoSlipAndThixotropyBCAlgorithm.h" -#include "DistributionArray3D.h" -#include "BoundaryConditions.h" - -NoSlipAndThixotropyBCAlgorithm::NoSlipAndThixotropyBCAlgorithm() -{ - BCAlgorithm::type = BCAlgorithm::NoSlipAndThixotropyBCAlgorithm; - BCAlgorithm::preCollision = false; - BCAlgorithm::thixotropy = true; - -} -////////////////////////////////////////////////////////////////////////// -NoSlipAndThixotropyBCAlgorithm::~NoSlipAndThixotropyBCAlgorithm() -{ - -} -////////////////////////////////////////////////////////////////////////// -SPtr<BCAlgorithm> NoSlipAndThixotropyBCAlgorithm::clone() -{ - SPtr<BCAlgorithm> bc(new NoSlipAndThixotropyBCAlgorithm()); - return bc; -} -////////////////////////////////////////////////////////////////////////// -void NoSlipAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) -{ - this->distributions = distributions; -} -////////////////////////////////////////////////////////////////////////// -//void NoSlipAndThixotropyBCAlgorithm::addDistributionsF(SPtr<DistributionArray3D> distributions) -//{ -// this->distributionsf = distributions; -//} -////////////////////////////////////////////////////////////////////////// -void NoSlipAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) -{ - this->distributionsH = distributions; -} -////////////////////////////////////////////////////////////////////////// -void NoSlipAndThixotropyBCAlgorithm::applyBC() -{ - LBMReal f[D3Q27System::ENDF + 1]; - LBMReal feq[D3Q27System::ENDF + 1]; - LBMReal h[D3Q27System::ENDF + 1]; - LBMReal heq[D3Q27System::ENDF + 1]; - distributions->getDistributionInv(f, x1, x2, x3); - distributionsH->getDistributionInv(h, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3;//, concentration, fl1, fl2, fl3, m100; - calcMacrosFct(f, rho, vx1, vx2, vx3); - calcFeqFct(feq, rho, vx1, vx2, vx3); - - //calcDiffusionMacrosFctPost(h, concentration, fl1, fl2, fl3, m100, collFactor); - LBMReal lambda = D3Q27System::getDensity(h); - D3Q27System::calcCompFeq(heq, lambda, 0., 0., 0.); - - for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) - { - if (bcPtr->hasNoSlipBoundaryFlag(fdir)) - { - //quadratic bounce back - const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal q = bcPtr->getQ(invDir); - LBMReal fReturnf = ((1.0 - q) / (1.0 + q))*((f[invDir] - feq[invDir]) / (1.0 - collFactor) + feq[invDir]) + ((q / (1.0 + q))*(f[invDir] + f[fdir])); - LBMReal fReturnh = ((1.0 - q) / (1.0 + q))*((h[invDir] - heq[invDir]) / (1.0 - collFactor) + heq[invDir]) + ((q / (1.0 + q))*(h[invDir] + h[fdir])); - - distributions->setDistributionForDirection(fReturnf, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir); - distributionsH->setDistributionForDirection(fReturnh, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir); - - } - } -} diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.h deleted file mode 100644 index a7225e39392efaf5ef7ebb2831ebaa515fa3dcee..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef NoSlipAndThixotropyBCAlgorithm_h__ -#define NoSlipAndThixotropyBCAlgorithm_h__ - -#include "BCAlgorithm.h" - -class NoSlipAndThixotropyBCAlgorithm : public BCAlgorithm -{ -public: - NoSlipAndThixotropyBCAlgorithm(); - virtual ~NoSlipAndThixotropyBCAlgorithm(); - SPtr<BCAlgorithm> clone(); - void addDistributions(SPtr<DistributionArray3D> distributions); - //void addDistributionsF(DistributionArray3DPtr distributions); - void addDistributionsH(SPtr<DistributionArray3D> distributions); - void applyBC(); -protected: - SPtr<DistributionArray3D> distributionsH; -private: - -}; -#endif // NoSlipAndThixotropyBCAlgorithm_h__ - diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.h deleted file mode 100644 index 8c096a5e522a2cf2a47d9944b16154c186dea9ca..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef NonReflectingOutflowAndThixotropyBCAlgorithm_h__ -#define NonReflectingOutflowAndThixotropyBCAlgorithm_h__ - -#include "BCAlgorithm.h" - - -class NonReflectingOutflowAndThixotropyBCAlgorithm : public BCAlgorithm -{ -public: - NonReflectingOutflowAndThixotropyBCAlgorithm(); - virtual ~NonReflectingOutflowAndThixotropyBCAlgorithm(); - SPtr<BCAlgorithm> clone(); - void addDistributions(SPtr<DistributionArray3D> distributions); - //void addDistributionsF(SPtr<DistributionArray3D> distributions); - void addDistributionsH(SPtr<DistributionArray3D> distributions); - void applyBC(); - //void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } - //LBMReal getLambdaBC() { return this->lambdaBC; } -protected: - SPtr<DistributionArray3D> distributionsH; -private: - //LBMReal lambdaBC; -}; -#endif // NonReflectingOutflowAndThixotropyBCAlgorithm_h__ - diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/PowellEyringModelNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/PowellEyringModelNoSlipBCAlgorithm.h deleted file mode 100644 index f94266be4d87b33fc5858e1f48263d3cdbc082c5..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/PowellEyringModelNoSlipBCAlgorithm.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef PowellEyringModelNoSlipBCAlgorithm_h__ -#define PowellEyringModelNoSlipBCAlgorithm_h__ - -#include "ThixotropyNoSlipBCAlgorithm.h" -#include "Thixotropy.h" - -class PowellEyringModelNoSlipBCAlgorithm : public ThixotropyNoSlipBCAlgorithm -{ -public: - PowellEyringModelNoSlipBCAlgorithm() - { - BCAlgorithm::type = BCAlgorithm::PowellEyringModelNoSlipBCAlgorithm; - BCAlgorithm::preCollision = true; - } - ~PowellEyringModelNoSlipBCAlgorithm() {} - SPtr<BCAlgorithm> clone() override - { - SPtr<BCAlgorithm> bc(new PowellEyringModelNoSlipBCAlgorithm()); - return bc; - } -protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override - { - return Thixotropy::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); - } -}; -#endif // PowellEyringModelNoSlipBCAlgorithm_h__ \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.cpp deleted file mode 100644 index 4ea802eb4f798526b822fc69c3b9111207973cc8..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "RheologicalVelocityBCAlgorithm.h" -#include "DistributionArray3D.h" -#include "BoundaryConditions.h" - -RheologicalVelocityBCAlgorithm::RheologicalVelocityBCAlgorithm() -{ - //BCAlgorithm::type = BCAlgorithm::RheologicalVelocityBCAlgorithm; - //BCAlgorithm::preCollision = false; -} -////////////////////////////////////////////////////////////////////////// -RheologicalVelocityBCAlgorithm::~RheologicalVelocityBCAlgorithm() -{ -} -////////////////////////////////////////////////////////////////////////// -void RheologicalVelocityBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) -{ - this->distributions = distributions; -} -////////////////////////////////////////////////////////////////////////// -void RheologicalVelocityBCAlgorithm::applyBC() -{ - LBMReal f[D3Q27System::ENDF+1]; - LBMReal feq[D3Q27System::ENDF+1]; - distributions->getDistributionInv(f, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3, drho; - calcMacrosFct(f, drho, vx1, vx2, vx3); - calcFeqFct(feq, drho, vx1, vx2, vx3); - - LBMReal shearRate = D3Q27System::getShearRate(f, collFactor); - LBMReal collFactorF = getThyxotropyCollFactor(collFactor, shearRate, drho); - - rho = 1.0+drho*compressibleFactor; - - for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) - { - if (bcPtr->hasVelocityBoundaryFlag(fdir)) - { - const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal q = bcPtr->getQ(invDir);// m+m q=0 stabiler - LBMReal velocity = bcPtr->getBoundaryVelocity(invDir); - LBMReal fReturn = ((1.0-q)/(1.0+q))*((f[invDir]-feq[invDir])/(1.0-collFactorF)+feq[invDir])+((q*(f[invDir]+f[fdir])-velocity*rho)/(1.0+q)); - distributions->setDistributionForDirection(fReturn, x1+D3Q27System::DX1[invDir], x2+D3Q27System::DX2[invDir], x3+D3Q27System::DX3[invDir], fdir); - } - } - -} - diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.h deleted file mode 100644 index 179bf57c3450f0cdaf77a9985fd31c7f1f28f9a6..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologicalVelocityBCAlgorithm.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RheologicalVelocityBCAlgorithm_h__ -#define RheologicalVelocityBCAlgorithm_h__ - -#include "BCAlgorithm.h" -#include <PointerDefinitions.h> - -class DistributionArray3D; - -class RheologicalVelocityBCAlgorithm : public BCAlgorithm -{ -public: - RheologicalVelocityBCAlgorithm(); - ~RheologicalVelocityBCAlgorithm(); - virtual SPtr<BCAlgorithm> clone() override { UB_THROW(UbException("LBMReal clone() - belongs in the derived class")); } - void addDistributions(SPtr<DistributionArray3D> distributions) override; - void applyBC() override; -protected: - virtual LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const = 0; // { UB_THROW(UbException("LBMReal getThyxotropyCollFactor() - belongs in the derived class")); } -}; - -#endif // VelocityBoundaryCondition_h__ - diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelNoSlipBCAlgorithm.h similarity index 76% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelNoSlipBCAlgorithm.h rename to src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelNoSlipBCAlgorithm.h index baeac4b00ad2fd94d9cd9debfa9cf9fcba34a228..d4a99846b6da226bf8d1d09e66763db61a90d2b0 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelNoSlipBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelNoSlipBCAlgorithm.h @@ -26,35 +26,35 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file BinghamModelNoSlipBCAlgorithm.h +//! \file RheologyBinghamModelNoSlipBCAlgorithm.h //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= -#ifndef BinghamModelNoSlipBCAlgorithm_h__ -#define BinghamModelNoSlipBCAlgorithm_h__ +#ifndef RheologyBinghamModelNoSlipBCAlgorithm_h__ +#define RheologyBinghamModelNoSlipBCAlgorithm_h__ -#include "ThixotropyNoSlipBCAlgorithm.h" -#include "Thixotropy.h" +#include "RheologyNoSlipBCAlgorithm.h" +#include "Rheology.h" -class BinghamModelNoSlipBCAlgorithm : public ThixotropyNoSlipBCAlgorithm +class RheologyBinghamModelNoSlipBCAlgorithm : public RheologyNoSlipBCAlgorithm { public: - BinghamModelNoSlipBCAlgorithm() + RheologyBinghamModelNoSlipBCAlgorithm() { - BCAlgorithm::type = BCAlgorithm::BinghamModelNoSlipBCAlgorithm; + BCAlgorithm::type = BCAlgorithm::RheologyBinghamModelNoSlipBCAlgorithm; BCAlgorithm::preCollision = true; } - ~BinghamModelNoSlipBCAlgorithm() {} + ~RheologyBinghamModelNoSlipBCAlgorithm() {} SPtr<BCAlgorithm> clone() override { - SPtr<BCAlgorithm> bc(new BinghamModelNoSlipBCAlgorithm()); + SPtr<BCAlgorithm> bc(new RheologyBinghamModelNoSlipBCAlgorithm()); return bc; } protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override { - return Thixotropy::getBinghamCollFactor(omegaInf, shearRate, drho); + return Rheology::getBinghamCollFactor(omegaInf, shearRate, drho); } }; #endif // BinghamModelNoSlipBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelVelocityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelVelocityBCAlgorithm.h similarity index 79% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelVelocityBCAlgorithm.h rename to src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelVelocityBCAlgorithm.h index 9dfaef4bcfb452cebb13d22c074d0cae09be99af..263119401c1d2c437e8ae3962edd33bfcd3b554c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BinghamModelVelocityBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyBinghamModelVelocityBCAlgorithm.h @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file BinghamModelVelocityBCAlgorithm.h +//! \file RheologyBinghamModelVelocityBCAlgorithm.h //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= @@ -34,27 +34,27 @@ #ifndef BinghamModelVelocityBCAlgorithm_h__ #define BinghamModelVelocityBCAlgorithm_h__ -#include "RheologicalVelocityBCAlgorithm.h" -#include "Thixotropy.h" +#include "RheologyVelocityBCAlgorithm.h" +#include "Rheology.h" -class BinghamModelVelocityBCAlgorithm : public RheologicalVelocityBCAlgorithm +class RheologyBinghamModelVelocityBCAlgorithm : public RheologyVelocityBCAlgorithm { public: - BinghamModelVelocityBCAlgorithm() + RheologyBinghamModelVelocityBCAlgorithm() { - BCAlgorithm::type = BCAlgorithm::BinghamModelVelocityBCAlgorithm; + BCAlgorithm::type = BCAlgorithm::RheologyBinghamModelVelocityBCAlgorithm; BCAlgorithm::preCollision = false; } - ~BinghamModelVelocityBCAlgorithm() {} + ~RheologyBinghamModelVelocityBCAlgorithm() {} SPtr<BCAlgorithm> clone() override { - SPtr<BCAlgorithm> bc(new BinghamModelVelocityBCAlgorithm()); + SPtr<BCAlgorithm> bc(new RheologyBinghamModelVelocityBCAlgorithm()); return bc; } protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override { - return Thixotropy::getBinghamCollFactor(omegaInf, shearRate, drho); + return Rheology::getBinghamCollFactor(omegaInf, shearRate, drho); } }; #endif // BinghamModelVelocityBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..19220dbd57f9100e71dbf611cccad7fadf8fae1e --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h @@ -0,0 +1,59 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyHerschelBulkleyModelNoSlipBCAlgorithm_h__ +#define RheologyHerschelBulkleyModelNoSlipBCAlgorithm_h__ + +#include "RheologyNoSlipBCAlgorithm.h" +#include "Rheology.h" + +class RheologyHerschelBulkleyModelNoSlipBCAlgorithm : public RheologyNoSlipBCAlgorithm +{ +public: + RheologyHerschelBulkleyModelNoSlipBCAlgorithm() + { + BCAlgorithm::type = BCAlgorithm::RheologyHerschelBulkleyModelNoSlipBCAlgorithm; + BCAlgorithm::preCollision = true; + } + ~RheologyHerschelBulkleyModelNoSlipBCAlgorithm() {} + SPtr<BCAlgorithm> clone() override + { + SPtr<BCAlgorithm> bc(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()); + return bc; + } +protected: + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + { + return Rheology::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); + } +}; +#endif // RheologyHerschelBulkleyModelNoSlipBCAlgorithm_h__ \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d2ec04aac4280a141e6f3b2044c56c8eed842db --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.cpp @@ -0,0 +1,66 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyNoSlipBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#include "RheologyNoSlipBCAlgorithm.h" +#include "DistributionArray3D.h" +#include "BoundaryConditions.h" + +////////////////////////////////////////////////////////////////////////// +void RheologyNoSlipBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +{ + this->distributions = distributions; +} +////////////////////////////////////////////////////////////////////////// +void RheologyNoSlipBCAlgorithm::applyBC() +{ + LBMReal f[D3Q27System::ENDF + 1]; + LBMReal feq[D3Q27System::ENDF + 1]; + distributions->getDistribution(f, x1, x2, x3); + LBMReal rho, vx1, vx2, vx3; + calcMacrosFct(f, rho, vx1, vx2, vx3); + calcFeqFct(feq, rho, vx1, vx2, vx3); + + LBMReal shearRate = D3Q27System::getShearRate(f, collFactor); + LBMReal collFactorF = getRheologyCollFactor(collFactor, shearRate, rho); + + for (int fDir = D3Q27System::FSTARTDIR; fDir <= D3Q27System::FENDDIR; fDir++) + { + if (bcPtr->hasNoSlipBoundaryFlag(fDir)) + { + //quadratic bounce back + const int invDir = D3Q27System::INVDIR[fDir]; + LBMReal q = bcPtr->getQ(invDir); + LBMReal fReturn =(f[invDir] + q * f[fDir] + q * collFactorF * (feq[invDir] - f[invDir] + feq[fDir] - f[fDir])) / (1.0 + q); + distributions->setDistributionInvForDirection(fReturn, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], invDir); + } + } +} \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..71be7caf0787edb38877d6c3bb0f891c095ead05 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyNoSlipBCAlgorithm.h @@ -0,0 +1,52 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyNoSlipBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyNoSlipBCAlgorithm_h__ +#define RheologyNoSlipBCAlgorithm_h__ + +#include "BCAlgorithm.h" +#include <PointerDefinitions.h> + +class DistributionArray3D; + +class RheologyNoSlipBCAlgorithm : public BCAlgorithm +{ +public: + RheologyNoSlipBCAlgorithm() = default; + ~RheologyNoSlipBCAlgorithm() = default; + virtual SPtr<BCAlgorithm> clone() override { UB_THROW(UbException("LBMReal clone() - belongs in the derived class")); } + void addDistributions(SPtr<DistributionArray3D> distributions) override; + void applyBC() override; +protected: + virtual LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const = 0; // { UB_THROW(UbException("LBMReal getRheologyCollFactor() - belongs in the derived class")); } +}; +#endif // RheologyNoSlipBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyPowellEyringModelNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyPowellEyringModelNoSlipBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..49a7df6be41f37dd4dc2ac7a67f8d8645aa70c15 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyPowellEyringModelNoSlipBCAlgorithm.h @@ -0,0 +1,59 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyPowellEyringModelNoSlipBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyPowellEyringModelNoSlipBCAlgorithm_h__ +#define RheologyPowellEyringModelNoSlipBCAlgorithm_h__ + +#include "RheologyNoSlipBCAlgorithm.h" +#include "Rheology.h" + +class RheologyPowellEyringModelNoSlipBCAlgorithm : public RheologyNoSlipBCAlgorithm +{ +public: + RheologyPowellEyringModelNoSlipBCAlgorithm() + { + BCAlgorithm::type = BCAlgorithm::RheologyPowellEyringModelNoSlipBCAlgorithm; + BCAlgorithm::preCollision = true; + } + ~RheologyPowellEyringModelNoSlipBCAlgorithm() {} + SPtr<BCAlgorithm> clone() override + { + SPtr<BCAlgorithm> bc(new RheologyPowellEyringModelNoSlipBCAlgorithm()); + return bc; + } +protected: + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + { + return Rheology::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); + } +}; +#endif // RheologyPowellEyringModelNoSlipBCAlgorithm_h__ \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e2979d462d5ec1d166cac48c67c903cf280b5ff2 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.cpp @@ -0,0 +1,79 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyVelocityBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#include "RheologyVelocityBCAlgorithm.h" +#include "DistributionArray3D.h" +#include "BoundaryConditions.h" + +RheologyVelocityBCAlgorithm::RheologyVelocityBCAlgorithm() +{ + //BCAlgorithm::type = BCAlgorithm::RheologyVelocityBCAlgorithm; + //BCAlgorithm::preCollision = false; +} +////////////////////////////////////////////////////////////////////////// +RheologyVelocityBCAlgorithm::~RheologyVelocityBCAlgorithm() +{ +} +////////////////////////////////////////////////////////////////////////// +void RheologyVelocityBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +{ + this->distributions = distributions; +} +////////////////////////////////////////////////////////////////////////// +void RheologyVelocityBCAlgorithm::applyBC() +{ + LBMReal f[D3Q27System::ENDF+1]; + LBMReal feq[D3Q27System::ENDF+1]; + distributions->getDistributionInv(f, x1, x2, x3); + LBMReal rho, vx1, vx2, vx3, drho; + calcMacrosFct(f, drho, vx1, vx2, vx3); + calcFeqFct(feq, drho, vx1, vx2, vx3); + + LBMReal shearRate = D3Q27System::getShearRate(f, collFactor); + LBMReal collFactorF = getRheologyCollFactor(collFactor, shearRate, drho); + + rho = 1.0+drho*compressibleFactor; + + for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) + { + if (bcPtr->hasVelocityBoundaryFlag(fdir)) + { + const int invDir = D3Q27System::INVDIR[fdir]; + LBMReal q = bcPtr->getQ(invDir);// m+m q=0 stabiler + LBMReal velocity = bcPtr->getBoundaryVelocity(invDir); + LBMReal fReturn = ((1.0-q)/(1.0+q))*((f[invDir]-feq[invDir])/(1.0-collFactorF)+feq[invDir])+((q*(f[invDir]+f[fdir])-velocity*rho)/(1.0+q)); + distributions->setDistributionForDirection(fReturn, x1+D3Q27System::DX1[invDir], x2+D3Q27System::DX2[invDir], x3+D3Q27System::DX3[invDir], fdir); + } + } + +} + diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..fc523c4619b8f9c804b2366b671db7475495e151 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/RheologyVelocityBCAlgorithm.h @@ -0,0 +1,54 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyVelocityBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyVelocityBCAlgorithm_h__ +#define RheologyVelocityBCAlgorithm_h__ + +#include "BCAlgorithm.h" +#include <PointerDefinitions.h> + +class DistributionArray3D; + +class RheologyVelocityBCAlgorithm : public BCAlgorithm +{ +public: + RheologyVelocityBCAlgorithm(); + ~RheologyVelocityBCAlgorithm(); + virtual SPtr<BCAlgorithm> clone() override { UB_THROW(UbException("LBMReal clone() - belongs in the derived class")); } + void addDistributions(SPtr<DistributionArray3D> distributions) override; + void applyBC() override; +protected: + virtual LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const = 0; // { UB_THROW(UbException("LBMReal getRheologyCollFactor() - belongs in the derived class")); } +}; + +#endif // RheologyVelocityBCAlgorithm_h__ + diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp similarity index 84% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp rename to src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp index 905a8e3384afaca755b4f92ef21ff21395b2422b..ecfb98e67aa4c20603fd4b07e969ccb396c5e757 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp @@ -26,51 +26,51 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file DensityAndThixotropyBCAlgorithm.cpp +//! \file ThixotropyDensityBCAlgorithm.cpp //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= -#include "DensityAndThixotropyBCAlgorithm.h" +#include "ThixotropyDensityBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" -DensityAndThixotropyBCAlgorithm::DensityAndThixotropyBCAlgorithm() +ThixotropyDensityBCAlgorithm::ThixotropyDensityBCAlgorithm() { - BCAlgorithm::type = BCAlgorithm::DensityAndThixotropyBCAlgorithm; + BCAlgorithm::type = BCAlgorithm::ThixotropyDensityBCAlgorithm; BCAlgorithm::preCollision = false; BCAlgorithm::thixotropy = true; lambdaBC = 0.0; } ////////////////////////////////////////////////////////////////////////// -DensityAndThixotropyBCAlgorithm::~DensityAndThixotropyBCAlgorithm() +ThixotropyDensityBCAlgorithm::~ThixotropyDensityBCAlgorithm() { } ////////////////////////////////////////////////////////////////////////// -SPtr<BCAlgorithm> DensityAndThixotropyBCAlgorithm::clone() +SPtr<BCAlgorithm> ThixotropyDensityBCAlgorithm::clone() { - SPtr<BCAlgorithm> bc(new DensityAndThixotropyBCAlgorithm()); - dynamicPointerCast<DensityAndThixotropyBCAlgorithm>(bc)->setLambdaBC(lambdaBC); + SPtr<BCAlgorithm> bc(new ThixotropyDensityBCAlgorithm()); + dynamicPointerCast<ThixotropyDensityBCAlgorithm>(bc)->setLambdaBC(lambdaBC); return bc; } ////////////////////////////////////////////////////////////////////////// -void DensityAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +void ThixotropyDensityBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) { this->distributions = distributions; } ////////////////////////////////////////////////////////////////////////// -//void DensityAndThixotropyBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) +//void ThixotropyDensityBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) //{ // this->distributionsf = distributions; //} ////////////////////////////////////////////////////////////////////////// -void DensityAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) +void ThixotropyDensityBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) { this->distributionsH = distributions; } ////////////////////////////////////////////////////////////////////////// -void DensityAndThixotropyBCAlgorithm::applyBC() +void ThixotropyDensityBCAlgorithm::applyBC() { using namespace D3Q27System; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.h similarity index 89% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.h rename to src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.h index 79cb1c633272137476f32815ba5223dbc30d6ee3..0ed191335ac05eb0e246271f577b024cc11b8de9 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityAndThixotropyBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.h @@ -26,22 +26,22 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file DensityAndThixotropyBCAlgorithm.h +//! \file ThixotropyDensityBCAlgorithm.h //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= -#ifndef DensityAndThixotropyBCAlgorithm_h__ -#define DensityAndThixotropyBCAlgorithm_h__ +#ifndef ThixotropyDensityBCAlgorithm_h__ +#define ThixotropyDensityBCAlgorithm_h__ #include "BCAlgorithm.h" -class DensityAndThixotropyBCAlgorithm : public BCAlgorithm +class ThixotropyDensityBCAlgorithm : public BCAlgorithm { public: - DensityAndThixotropyBCAlgorithm(); - virtual ~DensityAndThixotropyBCAlgorithm(); + ThixotropyDensityBCAlgorithm(); + virtual ~ThixotropyDensityBCAlgorithm(); SPtr<BCAlgorithm> clone(); void addDistributions(SPtr<DistributionArray3D> distributions); //void addDistributionsF(SPtr<DistributionArray3D> distributions); @@ -54,5 +54,5 @@ protected: private: LBMReal lambdaBC; }; -#endif // DensityAndThixotropyBCAlgorithm_h__ +#endif // ThixotropyDensityBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.cpp index 9fae576b70615b56e54bd673c9c26b3def83ad26..48b15fde31369a1857055263f9fc070ce9415a1b 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.cpp @@ -1,34 +1,102 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyNoSlipBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= #include "ThixotropyNoSlipBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" +ThixotropyNoSlipBCAlgorithm::ThixotropyNoSlipBCAlgorithm() +{ + BCAlgorithm::type = BCAlgorithm::ThixotropyNoSlipBCAlgorithm; + BCAlgorithm::preCollision = false; + BCAlgorithm::thixotropy = true; + +} +////////////////////////////////////////////////////////////////////////// +ThixotropyNoSlipBCAlgorithm::~ThixotropyNoSlipBCAlgorithm() +{ + +} +////////////////////////////////////////////////////////////////////////// +SPtr<BCAlgorithm> ThixotropyNoSlipBCAlgorithm::clone() +{ + SPtr<BCAlgorithm> bc(new ThixotropyNoSlipBCAlgorithm()); + return bc; +} ////////////////////////////////////////////////////////////////////////// void ThixotropyNoSlipBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) { - this->distributions = distributions; + this->distributions = distributions; +} +////////////////////////////////////////////////////////////////////////// +//void ThixotropyNoSlipBCAlgorithm::addDistributionsF(SPtr<DistributionArray3D> distributions) +//{ +// this->distributionsf = distributions; +//} +////////////////////////////////////////////////////////////////////////// +void ThixotropyNoSlipBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) +{ + this->distributionsH = distributions; } ////////////////////////////////////////////////////////////////////////// void ThixotropyNoSlipBCAlgorithm::applyBC() { - LBMReal f[D3Q27System::ENDF + 1]; - LBMReal feq[D3Q27System::ENDF + 1]; - distributions->getDistribution(f, x1, x2, x3); - LBMReal rho, vx1, vx2, vx3; - calcMacrosFct(f, rho, vx1, vx2, vx3); - calcFeqFct(feq, rho, vx1, vx2, vx3); + LBMReal f[D3Q27System::ENDF + 1]; + LBMReal feq[D3Q27System::ENDF + 1]; + LBMReal h[D3Q27System::ENDF + 1]; + LBMReal heq[D3Q27System::ENDF + 1]; + distributions->getDistributionInv(f, x1, x2, x3); + distributionsH->getDistributionInv(h, x1, x2, x3); + LBMReal rho, vx1, vx2, vx3;//, concentration, fl1, fl2, fl3, m100; + calcMacrosFct(f, rho, vx1, vx2, vx3); + calcFeqFct(feq, rho, vx1, vx2, vx3); + + //calcDiffusionMacrosFctPost(h, concentration, fl1, fl2, fl3, m100, collFactor); + LBMReal lambda = D3Q27System::getDensity(h); + D3Q27System::calcCompFeq(heq, lambda, 0., 0., 0.); - LBMReal shearRate = D3Q27System::getShearRate(f, collFactor); - LBMReal collFactorF = getThyxotropyCollFactor(collFactor, shearRate, rho); + for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) + { + if (bcPtr->hasNoSlipBoundaryFlag(fdir)) + { + //quadratic bounce back + const int invDir = D3Q27System::INVDIR[fdir]; + LBMReal q = bcPtr->getQ(invDir); + LBMReal fReturnf = ((1.0 - q) / (1.0 + q))*((f[invDir] - feq[invDir]) / (1.0 - collFactor) + feq[invDir]) + ((q / (1.0 + q))*(f[invDir] + f[fdir])); + LBMReal fReturnh = ((1.0 - q) / (1.0 + q))*((h[invDir] - heq[invDir]) / (1.0 - collFactor) + heq[invDir]) + ((q / (1.0 + q))*(h[invDir] + h[fdir])); - for (int fDir = D3Q27System::FSTARTDIR; fDir <= D3Q27System::FENDDIR; fDir++) - { - if (bcPtr->hasNoSlipBoundaryFlag(fDir)) - { - //quadratic bounce back - const int invDir = D3Q27System::INVDIR[fDir]; - LBMReal q = bcPtr->getQ(invDir); - LBMReal fReturn =(f[invDir] + q * f[fDir] + q * collFactorF * (feq[invDir] - f[invDir] + feq[fDir] - f[fDir])) / (1.0 + q); - distributions->setDistributionInvForDirection(fReturn, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], invDir); - } - } -} \ No newline at end of file + distributions->setDistributionForDirection(fReturnf, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir); + distributionsH->setDistributionForDirection(fReturnh, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir); + + } + } +} diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h index 51448a836607080fd34d97fae00546d67ae0ff6e..e3e0ebc348909bd7152cdcbb9d1ede2253c80497 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h @@ -1,20 +1,54 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyNoSlipBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= #ifndef ThixotropyNoSlipBCAlgorithm_h__ #define ThixotropyNoSlipBCAlgorithm_h__ #include "BCAlgorithm.h" -#include <PointerDefinitions.h> - -class DistributionArray3D; class ThixotropyNoSlipBCAlgorithm : public BCAlgorithm { public: - ThixotropyNoSlipBCAlgorithm() = default; - ~ThixotropyNoSlipBCAlgorithm() = default; - virtual SPtr<BCAlgorithm> clone() override { UB_THROW(UbException("LBMReal clone() - belongs in the derived class")); } - void addDistributions(SPtr<DistributionArray3D> distributions) override; - void applyBC() override; + ThixotropyNoSlipBCAlgorithm(); + virtual ~ThixotropyNoSlipBCAlgorithm(); + SPtr<BCAlgorithm> clone(); + void addDistributions(SPtr<DistributionArray3D> distributions); + //void addDistributionsF(DistributionArray3DPtr distributions); + void addDistributionsH(SPtr<DistributionArray3D> distributions); + void applyBC(); protected: - virtual LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const = 0; // { UB_THROW(UbException("LBMReal getThyxotropyCollFactor() - belongs in the derived class")); } + SPtr<DistributionArray3D> distributionsH; +private: + }; #endif // ThixotropyNoSlipBCAlgorithm_h__ + diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp similarity index 89% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.cpp rename to src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp index 3c96343077f1030f7e6477bb352635c870ece4ce..2750e606acff2fb7a9f906f67c0b48975a11261c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp @@ -1,41 +1,73 @@ -#include "NonReflectingOutflowAndThixotropyBCAlgorithm.h" +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyNonReflectingOutflowBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#include "ThixotropyNonReflectingOutflowBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" -NonReflectingOutflowAndThixotropyBCAlgorithm::NonReflectingOutflowAndThixotropyBCAlgorithm() +ThixotropyNonReflectingOutflowBCAlgorithm::ThixotropyNonReflectingOutflowBCAlgorithm() { - BCAlgorithm::type = BCAlgorithm::NonReflectingOutflowAndThixotropyBCAlgorithm; + BCAlgorithm::type = BCAlgorithm::ThixotropyNonReflectingOutflowBCAlgorithm; BCAlgorithm::preCollision = true; BCAlgorithm::thixotropy = true; } ////////////////////////////////////////////////////////////////////////// -NonReflectingOutflowAndThixotropyBCAlgorithm::~NonReflectingOutflowAndThixotropyBCAlgorithm() +ThixotropyNonReflectingOutflowBCAlgorithm::~ThixotropyNonReflectingOutflowBCAlgorithm() { } ////////////////////////////////////////////////////////////////////////// -SPtr<BCAlgorithm> NonReflectingOutflowAndThixotropyBCAlgorithm::clone() +SPtr<BCAlgorithm> ThixotropyNonReflectingOutflowBCAlgorithm::clone() { - SPtr<BCAlgorithm> bc(new NonReflectingOutflowAndThixotropyBCAlgorithm()); + SPtr<BCAlgorithm> bc(new ThixotropyNonReflectingOutflowBCAlgorithm()); return bc; } ////////////////////////////////////////////////////////////////////////// -void NonReflectingOutflowAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +void ThixotropyNonReflectingOutflowBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) { this->distributions = distributions; } ////////////////////////////////////////////////////////////////////////// -//void NonReflectingOutflowAndThixotropyBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) +//void ThixotropyNonReflectingOutflowBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) //{ // this->distributionsf = distributions; //} ////////////////////////////////////////////////////////////////////////// -void NonReflectingOutflowAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) +void ThixotropyNonReflectingOutflowBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) { this->distributionsH = distributions; } ////////////////////////////////////////////////////////////////////////// -void NonReflectingOutflowAndThixotropyBCAlgorithm::applyBC() +void ThixotropyNonReflectingOutflowBCAlgorithm::applyBC() { using namespace D3Q27System; LBMReal f[ENDF + 1]; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..cabc67bd67111b873c9c62db748d1f04eb006c56 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.h @@ -0,0 +1,57 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyNonReflectingOutflowBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef ThixotropyNonReflectingOutflowBCAlgorithm_h__ +#define ThixotropyNonReflectingOutflowBCAlgorithm_h__ + +#include "BCAlgorithm.h" + + +class ThixotropyNonReflectingOutflowBCAlgorithm : public BCAlgorithm +{ +public: + ThixotropyNonReflectingOutflowBCAlgorithm(); + virtual ~ThixotropyNonReflectingOutflowBCAlgorithm(); + SPtr<BCAlgorithm> clone(); + void addDistributions(SPtr<DistributionArray3D> distributions); + //void addDistributionsF(SPtr<DistributionArray3D> distributions); + void addDistributionsH(SPtr<DistributionArray3D> distributions); + void applyBC(); + //void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } + //LBMReal getLambdaBC() { return this->lambdaBC; } +protected: + SPtr<DistributionArray3D> distributionsH; +private: + //LBMReal lambdaBC; +}; +#endif // ThixotropyNonReflectingOutflowBCAlgorithm_h__ + diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp similarity index 54% rename from src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp rename to src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp index e6a50917f2f710ee4e8f240d54021f3e67a02d57..6db2e6230560e313abcccbb08299f1928d5c0672 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp @@ -1,43 +1,75 @@ -#include "VelocityAndThixotropyBCAlgorithm.h" +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyVelocityBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#include "ThixotropyVelocityBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" -VelocityAndThixotropyBCAlgorithm::VelocityAndThixotropyBCAlgorithm() +ThixotropyVelocityBCAlgorithm::ThixotropyVelocityBCAlgorithm() { - BCAlgorithm::type = BCAlgorithm::VelocityAndThixotropyBCAlgorithm; + BCAlgorithm::type = BCAlgorithm::ThixotropyVelocityBCAlgorithm; BCAlgorithm::preCollision = false; BCAlgorithm::thixotropy = true; lambdaBC = 0.0; } ////////////////////////////////////////////////////////////////////////// -VelocityAndThixotropyBCAlgorithm::~VelocityAndThixotropyBCAlgorithm() +ThixotropyVelocityBCAlgorithm::~ThixotropyVelocityBCAlgorithm() { } ////////////////////////////////////////////////////////////////////////// -SPtr<BCAlgorithm> VelocityAndThixotropyBCAlgorithm::clone() +SPtr<BCAlgorithm> ThixotropyVelocityBCAlgorithm::clone() { - SPtr<BCAlgorithm> bc(new VelocityAndThixotropyBCAlgorithm()); - dynamicPointerCast<VelocityAndThixotropyBCAlgorithm>(bc)->setLambdaBC(lambdaBC); + SPtr<BCAlgorithm> bc(new ThixotropyVelocityBCAlgorithm()); + dynamicPointerCast<ThixotropyVelocityBCAlgorithm>(bc)->setLambdaBC(lambdaBC); return bc; } ////////////////////////////////////////////////////////////////////////// -void VelocityAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +void ThixotropyVelocityBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) { this->distributions = distributions; } ////////////////////////////////////////////////////////////////////////// -//void VelocityAndThixotropyBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) +//void ThixotropyVelocityBCAlgorithm::addDistributionsF(DistributionArray3DPtr distributions) //{ // this->distributionsf = distributions; //} ////////////////////////////////////////////////////////////////////////// -void VelocityAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) +void ThixotropyVelocityBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) { this->distributionsH = distributions; } ////////////////////////////////////////////////////////////////////////// -void VelocityAndThixotropyBCAlgorithm::applyBC() +void ThixotropyVelocityBCAlgorithm::applyBC() { LBMReal f[D3Q27System::ENDF + 1]; LBMReal feq[D3Q27System::ENDF + 1]; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..86147cb21a232d8558737f28cb023ff2394a6f0d --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.h @@ -0,0 +1,56 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyVelocityBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef ThixotropyVelocityBCAlgorithm_h__ +#define ThixotropyVelocityBCAlgorithm_h__ + +#include "BCAlgorithm.h" + + +class ThixotropyVelocityBCAlgorithm : public BCAlgorithm +{ +public: + ThixotropyVelocityBCAlgorithm(); + virtual ~ThixotropyVelocityBCAlgorithm(); + SPtr<BCAlgorithm> clone(); + void addDistributions(SPtr<DistributionArray3D> distributions); + void addDistributionsH(SPtr<DistributionArray3D> distributions); + void applyBC(); + void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } + LBMReal getLambdaBC() { return this->lambdaBC; } +protected: + SPtr<DistributionArray3D> distributionsH; +private: + LBMReal lambdaBC; +}; +#endif // ThixotropyVelocityBCAlgorithm_h__ + diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..532570386462c4dd0d6d7db118a19429bc7beff0 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp @@ -0,0 +1,129 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyVelocityWithDensityBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= +#include "ThixotropyVelocityWithDensityBCAlgorithm.h" +#include "DistributionArray3D.h" +#include "BCArray3D.h" + +ThixotropyVelocityWithDensityBCAlgorithm::ThixotropyVelocityWithDensityBCAlgorithm() +{ + BCAlgorithm::type = BCAlgorithm::ThixotropyVelocityWithDensityBCAlgorithm; + BCAlgorithm::preCollision = false; +} +////////////////////////////////////////////////////////////////////////// +ThixotropyVelocityWithDensityBCAlgorithm::~ThixotropyVelocityWithDensityBCAlgorithm() +{ + +} +////////////////////////////////////////////////////////////////////////// +SPtr<BCAlgorithm> ThixotropyVelocityWithDensityBCAlgorithm::clone() +{ + SPtr<BCAlgorithm> bc(new ThixotropyVelocityWithDensityBCAlgorithm()); + dynamicPointerCast<ThixotropyVelocityWithDensityBCAlgorithm>(bc)->setLambdaBC(lambdaBC); + return bc; +} +////////////////////////////////////////////////////////////////////////// +void ThixotropyVelocityWithDensityBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) +{ + this->distributions = distributions; +} +////////////////////////////////////////////////////////////////////////// +void ThixotropyVelocityWithDensityBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) +{ + this->distributionsH = distributions; +} +////////////////////////////////////////////////////////////////////////// +void ThixotropyVelocityWithDensityBCAlgorithm::applyBC() +{ + //velocity bc for non reflecting pressure bc + LBMReal f[D3Q27System::ENDF+1]; + distributions->getDistributionInv(f, x1, x2, x3); + + LBMReal h[D3Q27System::ENDF + 1]; + distributionsH->getDistributionInv(h, x1, x2, x3); + + LBMReal rho, vx1, vx2, vx3, drho; + calcMacrosFct(f, drho, vx1, vx2, vx3); + + rho = 1.0+drho*compressibleFactor; + + /////////////////////////////////////////////////////////////////// + // Rheology + LBMReal lambda = D3Q27System::getDensity(h); + + int nx1 = x1; + int nx2 = x2; + int nx3 = x3; + + //flag points in direction of fluid + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } + else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); + + for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) + { + int nX1 = x1 + D3Q27System::DX1[fdir]; + int nX2 = x2 + D3Q27System::DX2[fdir]; + int nX3 = x3 + D3Q27System::DX3[fdir]; + + int minX1 = 0; + int minX2 = 0; + int minX3 = 0; + + int maxX1 = (int)bcArray->getNX1(); + int maxX2 = (int)bcArray->getNX2(); + int maxX3 = (int)bcArray->getNX3(); + + if (minX1 <= nX1 && maxX1 > nX1 && minX2 <= nX2 && maxX2 > nX2 && minX3 <= nX3 && maxX3 > nX3) + { + if (bcArray->isSolid(nX1,nX2,nX3)) + { + const int invDir = D3Q27System::INVDIR[fdir]; + LBMReal velocity = bcPtr->getBoundaryVelocity(fdir); + + LBMReal fReturn = (f[fdir] + f[invDir] - velocity*rho) / 2.0 - drho*D3Q27System::WEIGTH[invDir]; + distributions->setDistributionForDirection(fReturn, nX1, nX2, nX3, invDir); + } + } + + if (bcPtr->hasVelocityBoundaryFlag(fdir)) + { + LBMReal htemp = D3Q27System::getCompFeqForDirection(fdir, lambda, vx1, vx2, vx3); + htemp = D3Q27System::getCompFeqForDirection(fdir, lambdaBC, vx1, vx2, vx3) + h[fdir] - htemp; + distributionsH->setDistributionForDirection(htemp, nx1, nx2, nx3, fdir); + } + } +} diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..c24b6c28e2f494ced4a85fe4d8b9d2f33125424a --- /dev/null +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.h @@ -0,0 +1,60 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ThixotropyVelocityWithDensityBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + +#ifndef ThixotropyVelocityWithDensityBCAlgorithm_h__ +#define ThixotropyVelocityWithDensityBCAlgorithm_h__ + +#include "BCAlgorithm.h" +#include <PointerDefinitions.h> + +class DistributionArray3D; + +//! \brief Class implements Dirichlet boundary condition for velocity. Set density in system. It is used together with non reflecting outflow. + +class ThixotropyVelocityWithDensityBCAlgorithm : public BCAlgorithm +{ +public: + ThixotropyVelocityWithDensityBCAlgorithm(); + ~ThixotropyVelocityWithDensityBCAlgorithm(); + SPtr<BCAlgorithm> clone(); + void addDistributions(SPtr<DistributionArray3D> distributions); + void addDistributionsH(SPtr<DistributionArray3D> distributions); + void applyBC(); + void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } + LBMReal getLambdaBC() { return this->lambdaBC; } +protected: + SPtr<DistributionArray3D> distributionsH; +private: + LBMReal lambdaBC; +}; +#endif // ThixotropyVelocityWithDensityBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.h deleted file mode 100644 index 0ab2e83c9a6bfbe525c32bcb8de243d7fcfa735b..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityAndThixotropyBCAlgorithm.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef VelocityAndThixotropyBCAlgorithm_h__ -#define VelocityAndThixotropyBCAlgorithm_h__ - -#include "BCAlgorithm.h" - - -class VelocityAndThixotropyBCAlgorithm : public BCAlgorithm -{ -public: - VelocityAndThixotropyBCAlgorithm(); - virtual ~VelocityAndThixotropyBCAlgorithm(); - SPtr<BCAlgorithm> clone(); - void addDistributions(SPtr<DistributionArray3D> distributions); - void addDistributionsH(SPtr<DistributionArray3D> distributions); - void applyBC(); - void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } - LBMReal getLambdaBC() { return this->lambdaBC; } -protected: - SPtr<DistributionArray3D> distributionsH; -private: - LBMReal lambdaBC; -}; -#endif // VelocityAndThixotropyBCAlgorithm_h__ - diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp deleted file mode 100644 index f72f9bc7fd0dc184539181e719528152c14d4dea..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "VelocityWithDensityAndThixotropyBCAlgorithm.h" -#include "DistributionArray3D.h" -#include "BCArray3D.h" - -VelocityWithDensityAndThixotropyBCAlgorithm::VelocityWithDensityAndThixotropyBCAlgorithm() -{ - BCAlgorithm::type = BCAlgorithm::VelocityWithDensityAndThixotropyBCAlgorithm; - BCAlgorithm::preCollision = false; -} -////////////////////////////////////////////////////////////////////////// -VelocityWithDensityAndThixotropyBCAlgorithm::~VelocityWithDensityAndThixotropyBCAlgorithm() -{ - -} -////////////////////////////////////////////////////////////////////////// -SPtr<BCAlgorithm> VelocityWithDensityAndThixotropyBCAlgorithm::clone() -{ - SPtr<BCAlgorithm> bc(new VelocityWithDensityAndThixotropyBCAlgorithm()); - dynamicPointerCast<VelocityWithDensityAndThixotropyBCAlgorithm>(bc)->setLambdaBC(lambdaBC); - return bc; -} -////////////////////////////////////////////////////////////////////////// -void VelocityWithDensityAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions) -{ - this->distributions = distributions; -} -////////////////////////////////////////////////////////////////////////// -void VelocityWithDensityAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions) -{ - this->distributionsH = distributions; -} -////////////////////////////////////////////////////////////////////////// -void VelocityWithDensityAndThixotropyBCAlgorithm::applyBC() -{ - //velocity bc for non reflecting pressure bc - LBMReal f[D3Q27System::ENDF+1]; - distributions->getDistributionInv(f, x1, x2, x3); - - LBMReal h[D3Q27System::ENDF + 1]; - distributionsH->getDistributionInv(h, x1, x2, x3); - - LBMReal rho, vx1, vx2, vx3, drho; - calcMacrosFct(f, drho, vx1, vx2, vx3); - - rho = 1.0+drho*compressibleFactor; - - /////////////////////////////////////////////////////////////////// - // Thixotropy - LBMReal lambda = D3Q27System::getDensity(h); - - int nx1 = x1; - int nx2 = x2; - int nx3 = x3; - - //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } - else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); - - for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) - { - int nX1 = x1 + D3Q27System::DX1[fdir]; - int nX2 = x2 + D3Q27System::DX2[fdir]; - int nX3 = x3 + D3Q27System::DX3[fdir]; - - int minX1 = 0; - int minX2 = 0; - int minX3 = 0; - - int maxX1 = (int)bcArray->getNX1(); - int maxX2 = (int)bcArray->getNX2(); - int maxX3 = (int)bcArray->getNX3(); - - if (minX1 <= nX1 && maxX1 > nX1 && minX2 <= nX2 && maxX2 > nX2 && minX3 <= nX3 && maxX3 > nX3) - { - if (bcArray->isSolid(nX1,nX2,nX3)) - { - const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal velocity = bcPtr->getBoundaryVelocity(fdir); - - LBMReal fReturn = (f[fdir] + f[invDir] - velocity*rho) / 2.0 - drho*D3Q27System::WEIGTH[invDir]; - distributions->setDistributionForDirection(fReturn, nX1, nX2, nX3, invDir); - } - } - - if (bcPtr->hasVelocityBoundaryFlag(fdir)) - { - LBMReal htemp = D3Q27System::getCompFeqForDirection(fdir, lambda, vx1, vx2, vx3); - htemp = D3Q27System::getCompFeqForDirection(fdir, lambdaBC, vx1, vx2, vx3) + h[fdir] - htemp; - distributionsH->setDistributionForDirection(htemp, nx1, nx2, nx3, fdir); - } - } -} diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.h deleted file mode 100644 index b8cd101435a4da2f38b99a5c440f0675b6538179..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.h +++ /dev/null @@ -1,31 +0,0 @@ -//! \file VelocityWithDensityAndThixotropyBCAlgorithm.h -//! \brief Class implements velocity bc for non reflecting pressure bc. -//! \author Konstantin Kutscher - -#ifndef VelocityWithDensityAndThixotropyBCAlgorithm_h__ -#define VelocityWithDensityAndThixotropyBCAlgorithm_h__ - -#include "BCAlgorithm.h" -#include <PointerDefinitions.h> - -class DistributionArray3D; - -//! \brief Class implements Dirichlet boundary condition for velocity. Set density in system. It is used together with non reflecting outflow. - -class VelocityWithDensityAndThixotropyBCAlgorithm : public BCAlgorithm -{ -public: - VelocityWithDensityAndThixotropyBCAlgorithm(); - ~VelocityWithDensityAndThixotropyBCAlgorithm(); - SPtr<BCAlgorithm> clone(); - void addDistributions(SPtr<DistributionArray3D> distributions); - void addDistributionsH(SPtr<DistributionArray3D> distributions); - void applyBC(); - void setLambdaBC(LBMReal lambda) { this->lambdaBC = lambda; } - LBMReal getLambdaBC() { return this->lambdaBC; } -protected: - SPtr<DistributionArray3D> distributionsH; -private: - LBMReal lambdaBC; -}; -#endif // VelocityWithDensityAndThixotropyBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp index f12023be05f6fdabf694f7508e0c46aca96d8e15..3519c83a529314e1135f3d76e21c3b2c3c3f8cba 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp @@ -246,7 +246,7 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) // shearRate = D3Q27System::getShearRate(f, collFactor); - // LBMReal collFactorF = BinghamModelLBMKernel::getBinghamCollFactor(collFactor, yieldStress, + // LBMReal collFactorF = RheologyBinghamModelLBMKernel::getBinghamCollFactor(collFactor, yieldStress, // shearRate, rho); // data[index++].push_back(shearRate); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp index 436f6738b01c5f3fa04fc6e2779642c7fff4ad1d..8c4462066705154bad61846f5e9c147c303a3ba3 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteThixotropyQuantitiesCoProcessor.cpp @@ -11,7 +11,7 @@ #include <numeric> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "ThixotropyExpLBMKernel.h" -#include "Thixotropy.h" +#include "Rheology.h" using namespace std; @@ -204,7 +204,7 @@ void WriteThixotropyQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) //LBMReal collFactorF = collFactor - 1e-6 / (gammaDot + one * 1e-9); //collFactorF = (collFactorF < 0.5) ? 0.5 : collFactorF; - //LBMReal collFactorF = Thixotropy::getBinghamCollFactor(collFactor, gammaDot, rho); + //LBMReal collFactorF = Rheology::getBinghamCollFactor(collFactor, gammaDot, rho); //data[index++].push_back(lambda); //data[index++].push_back(gammaDot); @@ -213,9 +213,9 @@ void WriteThixotropyQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) distributionsF->getDistribution(f, ix1, ix2, ix3); LBMReal rho = D3Q27System::getDensity(f); LBMReal shearRate = D3Q27System::getShearRate(f, collFactor); - //LBMReal omega = Thixotropy::getHerschelBulkleyCollFactor(collFactor, shearRate, rho); - //LBMReal omega = Thixotropy::getPowellEyringCollFactor(collFactor, shearRate, rho); - LBMReal omega = Thixotropy::getBinghamCollFactor(collFactor, shearRate, rho); + //LBMReal omega = Rheology::getHerschelBulkleyCollFactor(collFactor, shearRate, rho); + //LBMReal omega = Rheology::getPowellEyringCollFactor(collFactor, shearRate, rho); + LBMReal omega = Rheology::getBinghamCollFactor(collFactor, shearRate, rho); LBMReal viscosity = (omega == 0) ? 0 : UbMath::c1o3 * (UbMath::c1/omega-UbMath::c1o2); diff --git a/src/cpu/VirtualFluidsCore/LBM/BinghamModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/BinghamModelLBMKernel.h deleted file mode 100644 index 8a3f1e58fd8209c96bbc82f71cfbf3316fa2cf6c..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/BinghamModelLBMKernel.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef BinghamModelLBMKernel_H -#define BinghamModelLBMKernel_H - -#include "ThixotropyModelLBMKernel.h" -#include "Thixotropy.h" - -//! \brief Cumulant LBM kernel + Bingham plastic model -//! \author K. Kutscher, M. Geier -class BinghamModelLBMKernel : public ThixotropyModelLBMKernel -{ -public: - BinghamModelLBMKernel() {}; - ~BinghamModelLBMKernel() {}; - SPtr<LBMKernel> clone() override - { - SPtr<LBMKernel> kernel(new BinghamModelLBMKernel()); - kernel->setNX(nx); - kernel->setCollisionFactor(collFactor); - dynamicPointerCast<BinghamModelLBMKernel>(kernel)->initDataSet(); - kernel->setBCProcessor(bcProcessor->clone(kernel)); - kernel->setWithForcing(withForcing); - kernel->setForcingX1(muForcingX1); - kernel->setForcingX2(muForcingX2); - kernel->setForcingX3(muForcingX3); - kernel->setIndex(ix1, ix2, ix3); - kernel->setDeltaT(deltaT); - - return kernel; - } -protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override - { - return Thixotropy::getBinghamCollFactor(omegaInf, shearRate, drho); - } -}; - - -#endif diff --git a/src/cpu/VirtualFluidsCore/LBM/HerschelBulkleyModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/HerschelBulkleyModelLBMKernel.h deleted file mode 100644 index c5cff32aab78c8a207143fb81b58f1ca0cba856b..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/HerschelBulkleyModelLBMKernel.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef HerschelBulkleyModelLBMKernel_H -#define HerschelBulkleyModelLBMKernel_H - -#include "ThixotropyModelLBMKernel.h" -#include "Thixotropy.h" - -//! \brief Cumulant LBM kernel + Herschel-Bulkley plastic model -//! \author K. Kutscher, M. Geier -class HerschelBulkleyModelLBMKernel : public ThixotropyModelLBMKernel -{ -public: - HerschelBulkleyModelLBMKernel() {}; - ~HerschelBulkleyModelLBMKernel() {}; - SPtr<LBMKernel> clone() override - { - SPtr<LBMKernel> kernel(new HerschelBulkleyModelLBMKernel()); - kernel->setNX(nx); - kernel->setCollisionFactor(collFactor); - dynamicPointerCast<HerschelBulkleyModelLBMKernel>(kernel)->initDataSet(); - kernel->setBCProcessor(bcProcessor->clone(kernel)); - kernel->setWithForcing(withForcing); - kernel->setForcingX1(muForcingX1); - kernel->setForcingX2(muForcingX2); - kernel->setForcingX3(muForcingX3); - kernel->setIndex(ix1, ix2, ix3); - kernel->setDeltaT(deltaT); - - return kernel; - } -protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override - { - return Thixotropy::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); - } -}; - - -#endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/PowellEyringModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/PowellEyringModelLBMKernel.h deleted file mode 100644 index 02932d808e2cbc242617405979435c78fd6386d9..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/PowellEyringModelLBMKernel.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef PowellEyringModelLBMKernel_H -#define PowellEyringModelLBMKernel_H - -#include "ThixotropyModelLBMKernel.h" -#include "Thixotropy.h" - -//! \brief Cumulant LBM kernel + Herschel-Bulkley plastic model -//! \author K. Kutscher, M. Geier -class PowellEyringModelLBMKernel : public ThixotropyModelLBMKernel -{ -public: - PowellEyringModelLBMKernel() {}; - ~PowellEyringModelLBMKernel() {}; - SPtr<LBMKernel> clone() override - { - SPtr<LBMKernel> kernel(new PowellEyringModelLBMKernel()); - kernel->setNX(nx); - kernel->setCollisionFactor(collFactor); - dynamicPointerCast<PowellEyringModelLBMKernel>(kernel)->initDataSet(); - kernel->setBCProcessor(bcProcessor->clone(kernel)); - kernel->setWithForcing(withForcing); - kernel->setForcingX1(muForcingX1); - kernel->setForcingX2(muForcingX2); - kernel->setForcingX3(muForcingX3); - kernel->setIndex(ix1, ix2, ix3); - kernel->setDeltaT(deltaT); - - return kernel; - } -protected: - LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override - { - return Thixotropy::getPowellEyringCollFactor(omegaInf, shearRate, drho); - } -}; - - -#endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/Rheology.cpp b/src/cpu/VirtualFluidsCore/LBM/Rheology.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55f8bba509d53392c804b44e43e54970f3cf1157 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/LBM/Rheology.cpp @@ -0,0 +1,118 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Rheology.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher, Martin Geier +//======================================================================================= +#include "Rheology.h" + +SPtr<Rheology> Rheology::instance = SPtr<Rheology>(); +LBMReal Rheology::tau0 = 0; +LBMReal Rheology::k = 0; +LBMReal Rheology::n = 1; +LBMReal Rheology::omegaMin = 0; +LBMReal Rheology::beta = 0; +LBMReal Rheology::c = 0; +LBMReal Rheology::mu0 = 0; + +////////////////////////////////////////////////////////////////////////// +SPtr<Rheology> Rheology::getInstance() +{ + if (!instance) + instance = SPtr<Rheology>(new Rheology()); + return instance; +} + +void Rheology::setYieldStress(LBMReal yieldStress) +{ + tau0 = yieldStress; +} +LBMReal Rheology::getYieldStress() const +{ + return tau0; +} +void Rheology::setViscosityParameter(LBMReal kParameter) +{ + k = kParameter; +} +LBMReal Rheology::getViscosityParameter() const +{ + return k; +} +void Rheology::setPowerIndex(LBMReal index) +{ + n = index; +} +LBMReal Rheology::getPowerIndex() const +{ + return n; +} + +void Rheology::setOmegaMin(LBMReal omega) +{ + omegaMin = omega; +} +LBMReal Rheology::getOmegaMin() const +{ + return omegaMin; +} + +void Rheology::setBeta(LBMReal PowellEyringBeta) +{ + beta = PowellEyringBeta; +} + +LBMReal Rheology::getBeta() const +{ + return beta; +} + +void Rheology::setC(LBMReal PowellEyringC) +{ + c = PowellEyringC; +} + +LBMReal Rheology::getC() const +{ + return c; +} + +void Rheology::setMu0(LBMReal mu) +{ + mu0 = mu; +} + +LBMReal Rheology::getMu0() const +{ + return mu0; +} + +Rheology::Rheology() +{ +} \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/Thixotropy.h b/src/cpu/VirtualFluidsCore/LBM/Rheology.h similarity index 58% rename from src/cpu/VirtualFluidsCore/LBM/Thixotropy.h rename to src/cpu/VirtualFluidsCore/LBM/Rheology.h index d54e2ac5b598eb2b01e27beb9c9e9410592cf266..b1aa22478a69a77be2aa0275ddb7a44b6e626305 100644 --- a/src/cpu/VirtualFluidsCore/LBM/Thixotropy.h +++ b/src/cpu/VirtualFluidsCore/LBM/Rheology.h @@ -1,17 +1,50 @@ -#ifndef Thixotropy_H -#define Thixotropy_H +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Rheology.h +//! \ingroup LBM +//! \author Konstantin Kutscher, Martin Geier +//======================================================================================= + +#ifndef Rheology_H +#define Rheology_H #include <PointerDefinitions.h> #include <LBMSystem.h> #include <UbMath.h> #include <math.h> -class Thixotropy +class Rheology { public: - Thixotropy(Thixotropy const&) = delete; - Thixotropy& operator=(Thixotropy const&) = delete; - static SPtr<Thixotropy> getInstance(); + Rheology(Rheology const&) = delete; + Rheology& operator=(Rheology const&) = delete; + static SPtr<Rheology> getInstance(); void setYieldStress(LBMReal tau0); LBMReal getYieldStress() const; @@ -39,9 +72,9 @@ public: static LBMReal getHerschelBulkleyCollFactorBackward(LBMReal shearRate, LBMReal drho); static LBMReal getPowellEyringCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho); private: - Thixotropy(); + Rheology(); - static SPtr<Thixotropy> instance; + static SPtr<Rheology> instance; static LBMReal tau0; static LBMReal k; @@ -53,11 +86,12 @@ private: }; ////////////////////////////////////////////////////////////////////////// -inline LBMReal Thixotropy::getBinghamCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) +inline LBMReal Rheology::getBinghamCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) { LBMReal cs2 = UbMath::one_over_sqrt3 * UbMath::one_over_sqrt3; LBMReal rho = UbMath::one + drho; - //LBMReal omega = omegaInf * (UbMath::one - (omegaInf * tau0) / (shearRate * cs2 * rho + UbMath::Epsilon<LBMReal>::val())); + //analytical solution + LBMReal omega = omegaInf * (UbMath::one - (omegaInf * tau0) / (shearRate * cs2 * rho + UbMath::Epsilon<LBMReal>::val())); //LBMReal omega = cs2 * cs2 * shearRate * shearRate * omegaInf * rho * rho / (cs2 * cs2 * shearRate * shearRate * rho * rho + cs2 * shearRate * omegaInf * rho * tau0+omegaInf*omegaInf*tau0*tau0); @@ -66,24 +100,24 @@ inline LBMReal Thixotropy::getBinghamCollFactor(LBMReal omegaInf, LBMReal shearR //LBMReal omega = omegaInf / (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a)))))))))); //20 iterations - //LBMReal omega = omegaInf / (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a)))))))))))))))))))); - - LBMReal omega = omegaInf*cs2 * shearRate * rho / (cs2 * shearRate * rho + omegaInf * tau0); - LBMReal shearRateNew = shearRate * (omega / omegaInf); - - for (int i = 0; i < 20; i++) - { - omega = omegaInf * cs2 * shearRateNew * rho / (cs2 * shearRateNew * rho + omegaInf * tau0); - shearRateNew = shearRate * (omega / omegaInf); - } - omega = omegaInf * cs2 * shearRateNew * rho / (cs2 * shearRateNew * rho + omegaInf * tau0); - - //if (omega < 0.2) - // omega = 0.2; + ////LBMReal omega = omegaInf / (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a * (1 + a)))))))))))))))))))); + // + //LBMReal omega = omegaInf*cs2 * shearRate * rho / (cs2 * shearRate * rho + omegaInf * tau0); + //LBMReal shearRateNew = shearRate * (omega / omegaInf); + + //for (int i = 0; i < 20; i++) + //{ + // omega = omegaInf * cs2 * shearRateNew * rho / (cs2 * shearRateNew * rho + omegaInf * tau0); + // shearRateNew = shearRate * (omega / omegaInf); + //} + //omega = omegaInf * cs2 * shearRateNew * rho / (cs2 * shearRateNew * rho + omegaInf * tau0); + // + ////if (omega < 0.2) + //// omega = 0.2; return omega; } -inline LBMReal Thixotropy::getBinghamCollFactorOld(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) +inline LBMReal Rheology::getBinghamCollFactorOld(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) { const LBMReal cs2 = UbMath::c1o3; // UbMath::one_over_sqrt3* UbMath::one_over_sqrt3; LBMReal rho = UbMath::one + drho; @@ -94,7 +128,7 @@ inline LBMReal Thixotropy::getBinghamCollFactorOld(LBMReal omegaInf, LBMReal she return omegaInf; } ////////////////////////////////////////////////////////////////////////// -inline LBMReal Thixotropy::getHerschelBulkleyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) +inline LBMReal Rheology::getHerschelBulkleyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) { LBMReal cs2 = UbMath::one_over_sqrt3 * UbMath::one_over_sqrt3; LBMReal rho = UbMath::one + drho; @@ -125,7 +159,7 @@ inline LBMReal Thixotropy::getHerschelBulkleyCollFactor(LBMReal omegaInf, LBMRea return omega; } ////////////////////////////////////////////////////////////////////////// -inline LBMReal Thixotropy::getHerschelBulkleyCollFactorBackward(LBMReal shearRate, LBMReal drho) +inline LBMReal Rheology::getHerschelBulkleyCollFactorBackward(LBMReal shearRate, LBMReal drho) { LBMReal rho = UbMath::one + drho; LBMReal gamma = shearRate + UbMath::Epsilon<LBMReal>::val(); @@ -134,7 +168,7 @@ inline LBMReal Thixotropy::getHerschelBulkleyCollFactorBackward(LBMReal shearRat return 1.0 / ((tau0 + k * std::pow(gamma, n)) / (cs2 * rho * gamma) + UbMath::c1o2); } ////////////////////////////////////////////////////////////////////////// -inline LBMReal Thixotropy::getPowellEyringCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) +inline LBMReal Rheology::getPowellEyringCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) { using namespace UbMath; LBMReal cs2 = c1o3; // UbMath::one_over_sqrt3* UbMath::one_over_sqrt3; diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyBinghamModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyBinghamModelLBMKernel.h new file mode 100644 index 0000000000000000000000000000000000000000..5bd2601dad811be6433eaea1d6acafc0a3e54f4c --- /dev/null +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyBinghamModelLBMKernel.h @@ -0,0 +1,71 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyBinghamModelLBMKernel.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= + +#ifndef RheologyBinghamModelLBMKernel_H +#define RheologyBinghamModelLBMKernel_H + +#include "RheologyK17LBMKernel.h" +#include "Rheology.h" + +//! \brief Cumulant LBM kernel + Bingham plastic model + +class RheologyBinghamModelLBMKernel : public RheologyK17LBMKernel +{ +public: + RheologyBinghamModelLBMKernel() {}; + ~RheologyBinghamModelLBMKernel() {}; + SPtr<LBMKernel> clone() override + { + SPtr<LBMKernel> kernel(new RheologyBinghamModelLBMKernel()); + kernel->setNX(nx); + kernel->setCollisionFactor(collFactor); + dynamicPointerCast<RheologyBinghamModelLBMKernel>(kernel)->initDataSet(); + kernel->setBCProcessor(bcProcessor->clone(kernel)); + kernel->setWithForcing(withForcing); + kernel->setForcingX1(muForcingX1); + kernel->setForcingX2(muForcingX2); + kernel->setForcingX3(muForcingX3); + kernel->setIndex(ix1, ix2, ix3); + kernel->setDeltaT(deltaT); + + return kernel; + } +protected: + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + { + return Rheology::getBinghamCollFactor(omegaInf, shearRate, drho); + } +}; + + +#endif diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyHerschelBulkleyModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyHerschelBulkleyModelLBMKernel.h new file mode 100644 index 0000000000000000000000000000000000000000..57478041e04e6a07579be53d58b688866e964e75 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyHerschelBulkleyModelLBMKernel.h @@ -0,0 +1,70 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyHerschelBulkleyModelLBMKernel.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyHerschelBulkleyModelLBMKernel_H +#define RheologyHerschelBulkleyModelLBMKernel_H + +#include "RheologyK17LBMKernel.h" +#include "Rheology.h" + +//! \brief Cumulant LBM kernel + Herschel-Bulkley plastic model + +class RheologyHerschelBulkleyModelLBMKernel : public RheologyK17LBMKernel +{ +public: + RheologyHerschelBulkleyModelLBMKernel() {}; + ~RheologyHerschelBulkleyModelLBMKernel() {}; + SPtr<LBMKernel> clone() override + { + SPtr<LBMKernel> kernel(new RheologyHerschelBulkleyModelLBMKernel()); + kernel->setNX(nx); + kernel->setCollisionFactor(collFactor); + dynamicPointerCast<RheologyHerschelBulkleyModelLBMKernel>(kernel)->initDataSet(); + kernel->setBCProcessor(bcProcessor->clone(kernel)); + kernel->setWithForcing(withForcing); + kernel->setForcingX1(muForcingX1); + kernel->setForcingX2(muForcingX2); + kernel->setForcingX3(muForcingX3); + kernel->setIndex(ix1, ix2, ix3); + kernel->setDeltaT(deltaT); + + return kernel; + } +protected: + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + { + return Rheology::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho); + } +}; + + +#endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp similarity index 93% rename from src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.cpp rename to src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp index 26355a6f8a5d83b48365f1c287597a65e5876ef3..7ee35063f0cfeb9379313a38b9eeb6f0e6388d49 100644 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp @@ -26,51 +26,51 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file ThixotropyInterpolationProcessor.cpp -//! \ingroup BoundarConditions +//! \file RheologyInterpolationProcessor.cpp +//! \ingroup LBM //! \author Konstantin Kutscher //======================================================================================= -#include "ThixotropyInterpolationProcessor.h" +#include "RheologyInterpolationProcessor.h" #include "D3Q27System.h" -#include "Thixotropy.h" +#include "Rheology.h" -ThixotropyInterpolationProcessor::ThixotropyInterpolationProcessor() +RheologyInterpolationProcessor::RheologyInterpolationProcessor() : omegaC(0.0), omegaF(0.0), omegaMin(0.0) { } ////////////////////////////////////////////////////////////////////////// -ThixotropyInterpolationProcessor::ThixotropyInterpolationProcessor(LBMReal omegaC, LBMReal omegaF, LBMReal omegaMin) +RheologyInterpolationProcessor::RheologyInterpolationProcessor(LBMReal omegaC, LBMReal omegaF, LBMReal omegaMin) : omegaC(omegaC), omegaF(omegaF), omegaMin(omegaMin) { } ////////////////////////////////////////////////////////////////////////// -ThixotropyInterpolationProcessor::~ThixotropyInterpolationProcessor() +RheologyInterpolationProcessor::~RheologyInterpolationProcessor() { } ////////////////////////////////////////////////////////////////////////// -InterpolationProcessorPtr ThixotropyInterpolationProcessor::clone() +InterpolationProcessorPtr RheologyInterpolationProcessor::clone() { - InterpolationProcessorPtr iproc = InterpolationProcessorPtr (new ThixotropyInterpolationProcessor(this->omegaC, this->omegaF, this->omegaMin)); + InterpolationProcessorPtr iproc = InterpolationProcessorPtr (new RheologyInterpolationProcessor(this->omegaC, this->omegaF, this->omegaMin)); return iproc; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::setOmegas( LBMReal omegaC, LBMReal omegaF ) +void RheologyInterpolationProcessor::setOmegas( LBMReal omegaC, LBMReal omegaF ) { this->omegaC = omegaC; this->omegaF = omegaF; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::setOmegaMin( LBMReal omegaMin ) +void RheologyInterpolationProcessor::setOmegaMin( LBMReal omegaMin ) { this->omegaMin = omegaMin; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::setOffsets(LBMReal xoff, LBMReal yoff, LBMReal zoff) +void RheologyInterpolationProcessor::setOffsets(LBMReal xoff, LBMReal yoff, LBMReal zoff) { this->xoff = xoff; this->yoff = yoff; @@ -80,7 +80,7 @@ void ThixotropyInterpolationProcessor::setOffsets(LBMReal xoff, LBMReal yoff, LB this->zoff_sq = zoff * zoff; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::interpolateCoarseToFine(D3Q27ICell& icellC, D3Q27ICell& icellF, LBMReal xoff, LBMReal yoff, LBMReal zoff) +void RheologyInterpolationProcessor::interpolateCoarseToFine(D3Q27ICell& icellC, D3Q27ICell& icellF, LBMReal xoff, LBMReal yoff, LBMReal zoff) { setOffsets(xoff, yoff, zoff); calcInterpolatedCoefficiets_intern(icellC, omegaC, 0.5, 0.25, -0.25, -0.25, -1, -1, -1); @@ -101,14 +101,14 @@ void ThixotropyInterpolationProcessor::interpolateCoarseToFine(D3Q27ICell& icell calcInterpolatedNode(icellF.TNE, /*omegaF,*/ 0.25, 0.25, 0.25, calcPressTNE(), 1, 1, 1); } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::interpolateFineToCoarse(D3Q27ICell& icellF, LBMReal* icellC, LBMReal xoff, LBMReal yoff, LBMReal zoff) +void RheologyInterpolationProcessor::interpolateFineToCoarse(D3Q27ICell& icellF, LBMReal* icellC, LBMReal xoff, LBMReal yoff, LBMReal zoff) { setOffsets(xoff, yoff, zoff); calcInterpolatedCoefficiets_intern(icellF, omegaF, 2.0, 0, 0, 0, 0, 0, 0); calcInterpolatedNodeFC(icellC, omegaC); } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::calcMoments(const LBMReal* const f, LBMReal omegaInf, LBMReal& press, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3, LBMReal& kxy, LBMReal& kyz, LBMReal& kxz, LBMReal& kxxMyy, LBMReal& kxxMzz) +void RheologyInterpolationProcessor::calcMoments(const LBMReal* const f, LBMReal omegaInf, LBMReal& press, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3, LBMReal& kxy, LBMReal& kyz, LBMReal& kxz, LBMReal& kxxMyy, LBMReal& kxxMzz) { using namespace D3Q27System; @@ -117,7 +117,7 @@ void ThixotropyInterpolationProcessor::calcMoments(const LBMReal* const f, LBMRe shearRate = D3Q27System::getShearRate(f, omegaInf); - LBMReal omega = Thixotropy::getHerschelBulkleyCollFactor(omegaInf, shearRate, rho); + LBMReal omega = Rheology::getHerschelBulkleyCollFactor(omegaInf, shearRate, rho); press = rho; //interpolate rho! @@ -128,7 +128,7 @@ void ThixotropyInterpolationProcessor::calcMoments(const LBMReal* const f, LBMRe kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))-(vx1*vx1-vx3*vx3)); } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::calcInterpolatedCoefficiets_intern(const D3Q27ICell& icell, +void RheologyInterpolationProcessor::calcInterpolatedCoefficiets_intern(const D3Q27ICell& icell, LBMReal omega, LBMReal eps_new, LBMReal x, @@ -320,7 +320,7 @@ void ThixotropyInterpolationProcessor::calcInterpolatedCoefficiets_intern(const shearRate = sqrt(dxux * dxux + dyuy * dyuy + dzuz * dzuz + Dxy * Dxy + Dxz * Dxz + Dyz * Dyz); - LBMReal o = Thixotropy::getHerschelBulkleyCollFactorBackward(shearRate, rho); //omega; + LBMReal o = Rheology::getHerschelBulkleyCollFactorBackward(shearRate, rho); //omega; if (o < omegaMin) o = omegaMin; @@ -431,7 +431,7 @@ void ThixotropyInterpolationProcessor::calcInterpolatedCoefficiets_intern(const yz_TNW = 0.0625*eps_new *(( bxyz + cxyz)/(72.*o)); } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::calcInterpolatedNode(LBMReal* f, /*LBMReal omega,*/ LBMReal x, LBMReal y, LBMReal z, LBMReal press, LBMReal xs, LBMReal ys, LBMReal zs) +void RheologyInterpolationProcessor::calcInterpolatedNode(LBMReal* f, /*LBMReal omega,*/ LBMReal x, LBMReal y, LBMReal z, LBMReal press, LBMReal xs, LBMReal ys, LBMReal zs) { using namespace D3Q27System; @@ -473,7 +473,7 @@ void ThixotropyInterpolationProcessor::calcInterpolatedNode(LBMReal* f, /*LBMRea } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressBSW() +LBMReal RheologyInterpolationProcessor::calcPressBSW() { return press_SWT * (0.140625 + 0.1875 * xoff + 0.1875 * yoff - 0.5625 * zoff) + press_NWT * (0.046875 + 0.0625 * xoff - 0.1875 * yoff - 0.1875 * zoff) + @@ -486,7 +486,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressBSW() } ////////////////////////////////////////////////////////////////////////// //Position SWT -0.25, -0.25, 0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressTSW() +LBMReal RheologyInterpolationProcessor::calcPressTSW() { return press_SWT * (0.421875 + 0.5625 * xoff + 0.5625 * yoff - 0.5625 * zoff) + press_NWT * (0.140625 + 0.1875 * xoff - 0.5625 * yoff - 0.1875 * zoff) + @@ -499,7 +499,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressTSW() } ////////////////////////////////////////////////////////////////////////// //Position SET 0.25, -0.25, 0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressTSE() +LBMReal RheologyInterpolationProcessor::calcPressTSE() { return press_SET * (0.421875 - 0.5625 * xoff + 0.5625 * yoff - 0.5625 * zoff) + press_NET * (0.140625 - 0.1875 * xoff - 0.5625 * yoff - 0.1875 * zoff) + @@ -512,7 +512,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressTSE() } ////////////////////////////////////////////////////////////////////////// //Position SEB 0.25, -0.25, -0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressBSE() +LBMReal RheologyInterpolationProcessor::calcPressBSE() { return press_SET * (0.140625 - 0.1875 * xoff + 0.1875 * yoff - 0.5625 * zoff) + press_NET * (0.046875 - 0.0625 * xoff - 0.1875 * yoff - 0.1875 * zoff) + @@ -525,7 +525,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressBSE() } ////////////////////////////////////////////////////////////////////////// //Position NWB -0.25, 0.25, -0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressBNW() +LBMReal RheologyInterpolationProcessor::calcPressBNW() { return press_NWT * (0.140625 + 0.1875 * xoff - 0.1875 * yoff - 0.5625 * zoff) + press_NET * (0.046875 - 0.1875 * xoff - 0.0625 * yoff - 0.1875 * zoff) + @@ -538,7 +538,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressBNW() } ////////////////////////////////////////////////////////////////////////// //Position NWT -0.25, 0.25, 0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressTNW() +LBMReal RheologyInterpolationProcessor::calcPressTNW() { return press_NWT * (0.421875 + 0.5625 * xoff - 0.5625 * yoff - 0.5625 * zoff) + press_NET * (0.140625 - 0.5625 * xoff - 0.1875 * yoff - 0.1875 * zoff) + @@ -551,7 +551,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressTNW() } ////////////////////////////////////////////////////////////////////////// //Position NET 0.25, 0.25, 0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressTNE() +LBMReal RheologyInterpolationProcessor::calcPressTNE() { return press_NET * (0.421875 - 0.5625 * xoff - 0.5625 * yoff - 0.5625 * zoff) + press_NWT * (0.140625 + 0.5625 * xoff - 0.1875 * yoff - 0.1875 * zoff) + @@ -564,7 +564,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressTNE() } ////////////////////////////////////////////////////////////////////////// //Position NEB 0.25, 0.25, -0.25 -LBMReal ThixotropyInterpolationProcessor::calcPressBNE() +LBMReal RheologyInterpolationProcessor::calcPressBNE() { return press_NET * (0.140625 - 0.1875 * xoff - 0.1875 * yoff - 0.5625 * zoff) + press_NWT * (0.046875 + 0.1875 * xoff - 0.0625 * yoff - 0.1875 * zoff) + @@ -577,7 +577,7 @@ LBMReal ThixotropyInterpolationProcessor::calcPressBNE() } ////////////////////////////////////////////////////////////////////////// //Position C 0.0, 0.0, 0.0 -void ThixotropyInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f, LBMReal omega) +void RheologyInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f, LBMReal omega) { using namespace D3Q27System; @@ -612,7 +612,7 @@ void ThixotropyInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f, LBMRea shearRate = sqrt(dxux * dxux + dyuy * dyuy + dzuz * dzuz + Dxy * Dxy + Dxz * Dxz + Dyz * Dyz); - LBMReal o = Thixotropy::getHerschelBulkleyCollFactorBackward(shearRate, rho); //omega; + LBMReal o = Rheology::getHerschelBulkleyCollFactorBackward(shearRate, rho); //omega; if (o < omegaMin) o = omegaMin; @@ -661,14 +661,14 @@ void ThixotropyInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f, LBMRea f[REST] = f_ZERO + feq[REST]; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) +void RheologyInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) { vx1 = a0 + ax*x + ay*y + az*z + axx*x*x + ayy*y*y + azz*z*z + axy*x*y + axz*x*z + ayz*y*z+axyz*x*y*z; vx2 = b0 + bx*x + by*y + bz*z + bxx*x*x + byy*y*y + bzz*z*z + bxy*x*y + bxz*x*z + byz*y*z+bxyz*x*y*z; vx3 = c0 + cx*x + cy*y + cz*z + cxx*x*x + cyy*y*y + czz*z*z + cxy*x*y + cxz*x*z + cyz*y*z+cxyz*x*y*z; } ////////////////////////////////////////////////////////////////////////// -void ThixotropyInterpolationProcessor::calcInterpolatedShearStress(LBMReal x, LBMReal y, LBMReal z,LBMReal& tauxx, LBMReal& tauyy, LBMReal& tauzz,LBMReal& tauxy, LBMReal& tauxz, LBMReal& tauyz) +void RheologyInterpolationProcessor::calcInterpolatedShearStress(LBMReal x, LBMReal y, LBMReal z,LBMReal& tauxx, LBMReal& tauyy, LBMReal& tauzz,LBMReal& tauxy, LBMReal& tauxz, LBMReal& tauyz) { tauxx=ax+2*axx*x+axy*y+axz*z+axyz*y*z; tauyy=by+2*byy*y+bxy*x+byz*z+bxyz*x*z; diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.h b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.h similarity index 89% rename from src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.h rename to src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.h index daaa6449ea8a37d16aa9d359cf72ab58d6d872f0..bce0c3d89e137738d9169fab5dbe15cd3c91f8ad 100644 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyInterpolationProcessor.h +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.h @@ -26,24 +26,24 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file ThixotropyInterpolationProcessor.h -//! \ingroup BoundarConditions +//! \file RheologyInterpolationProcessor.h +//! \ingroup LBM //! \author Konstantin Kutscher //======================================================================================= -#ifndef ThixotropyInterpolationProcessor_H_ -#define ThixotropyInterpolationProcessor_H_ +#ifndef RheologyInterpolationProcessor_H_ +#define RheologyInterpolationProcessor_H_ #include "InterpolationProcessor.h" #include "D3Q27System.h" //! \brief A class implements an interpolation function of grid refinement for thixotropic fluid. -class ThixotropyInterpolationProcessor : public InterpolationProcessor +class RheologyInterpolationProcessor : public InterpolationProcessor { public: - ThixotropyInterpolationProcessor(); - ThixotropyInterpolationProcessor(LBMReal omegaC, LBMReal omegaF, LBMReal omegaMin); - virtual ~ThixotropyInterpolationProcessor(); + RheologyInterpolationProcessor(); + RheologyInterpolationProcessor(LBMReal omegaC, LBMReal omegaF, LBMReal omegaMin); + virtual ~RheologyInterpolationProcessor(); InterpolationProcessorPtr clone(); void setOmegas(LBMReal omegaC, LBMReal omegaF); void setOmegaMin(LBMReal omegaMin); @@ -94,12 +94,12 @@ private: }; ////////////////////////////////////////////////////////////////////////// -inline void ThixotropyInterpolationProcessor::interpolateCoarseToFine(D3Q27ICell& icellC, D3Q27ICell& icellF) +inline void RheologyInterpolationProcessor::interpolateCoarseToFine(D3Q27ICell& icellC, D3Q27ICell& icellF) { this->interpolateCoarseToFine(icellC, icellF, 0.0, 0.0, 0.0); } ////////////////////////////////////////////////////////////////////////// -inline void ThixotropyInterpolationProcessor::interpolateFineToCoarse(D3Q27ICell& icellF, LBMReal* icellC) +inline void RheologyInterpolationProcessor::interpolateFineToCoarse(D3Q27ICell& icellF, LBMReal* icellC) { this->interpolateFineToCoarse(icellF, icellC, 0.0, 0.0, 0.0); } diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp index c1fc395c77d84e601e1eb89a081c4978362821ba..94fbad358b16d923ddc5425e6476ff3892bbbf3c 100644 --- a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyK17LBMKernel.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= + #include "RheologyK17LBMKernel.h" #include "D3Q27System.h" #include "InterpolationProcessor.h" @@ -6,7 +39,7 @@ #include "DataSet3D.h" #include "LBMKernel.h" #include "Block3D.h" -#include "Thixotropy.h" +#include "Rheology.h" #define PROOF_CORRECTNESS @@ -615,9 +648,9 @@ void RheologyK17LBMKernel::calculate(int step) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //non Newtonian fluid collision factor LBMReal shearRate = sqrt(c2 * (dxux * dxux + dyuy * dyuy + dzuz * dzuz) + Dxy * Dxy + Dxz * Dxz + Dyz * Dyz) / (drho + c1); - //omega = getThyxotropyCollFactor(omega, shearRate, rho); - //omega = Thixotropy::getHerschelBulkleyCollFactor(omega, shearRate, drho); - omega = Thixotropy::getBinghamCollFactor(omega, shearRate, drho); + omega = getRheologyCollFactor(omega, shearRate, rho); + //omega = Rheology::getHerschelBulkleyCollFactor(omega, shearRate, drho); + //omega = Rheology::getBinghamCollFactor(omega, shearRate, drho); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// dxux = c1o2 * (-omega) * (mxxMyy + mxxMzz);// +c1o2 * OxxPyyPzz * (mfaaa - mxxPyyPzz); diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.h index f9838ba2e73e8d49a5d637b50a871faf751b4e7c..77bb5ce84557c87210932f8fd76b6ae846414545 100644 --- a/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.h +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyK17LBMKernel.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyK17LBMKernel.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef RheologyK17LBMKernel_h__ #define RheologyK17LBMKernel_h__ @@ -26,6 +59,12 @@ public: void setBulkViscosity(LBMReal value); protected: virtual void initDataSet(); + + virtual LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const + { + UB_THROW(UbException("LBMReal getRheologyCollFactor() - belongs in the derived class")); + } + LBMReal f[D3Q27System::ENDF+1]; UbTimer timer; diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.cpp similarity index 93% rename from src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.cpp rename to src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.cpp index 1685eb6e1393055f0e04f7f4289fd295e805c33f..f399a00065d3cfd2be13f4184057f8223de38573 100644 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.cpp @@ -1,4 +1,37 @@ -#include "ThixotropyModelLBMKernel.h" +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyModelLBMKernel.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= + +#include "RheologyModelLBMKernel.h" #include "D3Q27System.h" #include "BCArray3D.h" #include "D3Q27EsoTwist3DSplittedVector.h" @@ -10,17 +43,17 @@ using namespace UbMath; -ThixotropyModelLBMKernel::ThixotropyModelLBMKernel() : forcingX1(0), forcingX2(0), forcingX3(0) +RheologyModelLBMKernel::RheologyModelLBMKernel() : forcingX1(0), forcingX2(0), forcingX3(0) { compressible = false; OxyyMxzz = 1.0; } -ThixotropyModelLBMKernel::~ThixotropyModelLBMKernel() +RheologyModelLBMKernel::~RheologyModelLBMKernel() { } -void ThixotropyModelLBMKernel::calculate(int step) +void RheologyModelLBMKernel::calculate(int step) { using namespace D3Q27System; @@ -483,7 +516,7 @@ void ThixotropyModelLBMKernel::calculate(int step) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //non Newtonian fluid collision factor LBMReal shearRate = sqrt(c2 * (dxux * dxux + dyuy * dyuy + dzuz * dzuz) + Dxy * Dxy + Dxz * Dxz + Dyz * Dyz) / (rho + one); - collFactorF = getThyxotropyCollFactor(collFactorF, shearRate, rho); + collFactorF = getRheologyCollFactor(collFactorF, shearRate, rho); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //relax @@ -862,13 +895,13 @@ void ThixotropyModelLBMKernel::calculate(int step) } } -//SPtr<LBMKernel> ThixotropyModelLBMKernel::clone() +//SPtr<LBMKernel> RheologyModelLBMKernel::clone() //{ -// SPtr<LBMKernel> kernel(new ThixotropyModelLBMKernel()); +// SPtr<LBMKernel> kernel(new RheologyModelLBMKernel()); // kernel->setNX(nx); // kernel->setCollisionFactor(collFactor); // collFactorF = collFactor; -// dynamicPointerCast<ThixotropyModelLBMKernel>(kernel)->initDataSet(); +// dynamicPointerCast<RheologyModelLBMKernel>(kernel)->initDataSet(); // kernel->setBCProcessor(bcProcessor->clone(kernel)); // kernel->setWithForcing(withForcing); // kernel->setForcingX1(muForcingX1); @@ -880,17 +913,17 @@ void ThixotropyModelLBMKernel::calculate(int step) // return kernel; //} -double ThixotropyModelLBMKernel::getCalculationTime() +double RheologyModelLBMKernel::getCalculationTime() { return timer.getTotalTime(); } -void ThixotropyModelLBMKernel::swapDistributions() +void RheologyModelLBMKernel::swapDistributions() { LBMKernel::swapDistributions(); } -void ThixotropyModelLBMKernel::initDataSet() +void RheologyModelLBMKernel::initDataSet() { SPtr<DistributionArray3D> df(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.0)); dataSet->setFdistributions(df); diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.h new file mode 100644 index 0000000000000000000000000000000000000000..0aba5a273536feab9ce892b09ae1837df4fd6a7f --- /dev/null +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel.h @@ -0,0 +1,83 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyModelLBMKernel.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyModelLBMKernel_H +#define RheologyModelLBMKernel_H + +#include "LBMKernel.h" +#include "BCProcessor.h" +#include "D3Q27System.h" +#include "basics/utilities/UbTiming.h" +#include "basics/container/CbArray4D.h" +#include "basics/container/CbArray3D.h" + +class RheologyModelLBMKernel; + +//! \brief Base class for model of thixotropy based on K16. Use Template Method design pattern for Implementation of different models. +//! \author K. Kutscher, M. Geier +class RheologyModelLBMKernel : public LBMKernel +{ +public: + RheologyModelLBMKernel(); + virtual ~RheologyModelLBMKernel(); + void calculate(int step); + virtual SPtr<LBMKernel> clone() { UB_THROW(UbException("SPtr<LBMKernel> clone() - belongs in the derived class")); }; + double getCalculationTime(); + + void swapDistributions(); + +protected: + void initDataSet(); + + virtual LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const { UB_THROW(UbException("LBMReal getRheologyCollFactor() - belongs in the derived class")); } + + LBMReal f[D3Q27System::ENDF + 1]; + + UbTimer timer; + + LBMReal OxyyMxzz; + + CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsF; + CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsF; + CbArray3D<LBMReal, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsF; + + mu::value_type muX1, muX2, muX3; + mu::value_type muDeltaT; + mu::value_type muNu; + LBMReal forcingX1; + LBMReal forcingX2; + LBMReal forcingX3; + + bool test; +}; + +#endif diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.cpp similarity index 97% rename from src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.cpp rename to src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.cpp index 44decadb7a4fb720ce0785373f9acd00106cbe10..2ab87c0b648b48fe56cff8380afdafb7deed08d4 100644 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.cpp @@ -1,28 +1,28 @@ -#include "ThixotropyModelLBMKernel2.h" +#include "RheologyModelLBMKernel2.h" #include "D3Q27System.h" #include "BCArray3D.h" #include "D3Q27EsoTwist3DSplittedVector.h" #include <math.h> #include "DataSet3D.h" #include "LBMKernel.h" -#include "Thixotropy.h" +#include "Rheology.h" #define PROOF_CORRECTNESS using namespace UbMath; -ThixotropyModelLBMKernel2::ThixotropyModelLBMKernel2() : forcingX1(0), forcingX2(0), forcingX3(0) +RheologyModelLBMKernel2::RheologyModelLBMKernel2() : forcingX1(0), forcingX2(0), forcingX3(0) { compressible = false; OxyyMxzz = 1.0; } -ThixotropyModelLBMKernel2::~ThixotropyModelLBMKernel2() +RheologyModelLBMKernel2::~RheologyModelLBMKernel2() { } -void ThixotropyModelLBMKernel2::calculate(int step) +void RheologyModelLBMKernel2::calculate(int step) { using namespace D3Q27System; @@ -488,23 +488,23 @@ void ThixotropyModelLBMKernel2::calculate(int step) LBMReal shearFactor = sqrt(c1o2 * ((mfcaa - mfaaa * c1o3) * (mfcaa - mfaaa * c1o3) + (mfaca - mfaaa * c1o3) * (mfaca - mfaaa * c1o3) + (mfaac - mfaaa * c1o3) * (mfaac - mfaaa * c1o3)) + mfbba * mfbba + mfbab * mfbab + mfabb * mfabb) + UbMath::Epsilon<LBMReal>::val(); - //collFactorF = getThyxotropyCollFactor(collFactorF, shearRate, rho); + //collFactorF = getRheologyCollFactor(collFactorF, shearRate, rho); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //relax //mxxPyyPzz += OxxPyyPzz * (mfaaa - mxxPyyPzz) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz); // - //LBMReal collFactorFyy = getThyxotropyCollFactor(collFactorF, std::sqrt(dxux*dxux + dyuy*dyuy) / (rho + one), rho); + //LBMReal collFactorFyy = getRheologyCollFactor(collFactorF, std::sqrt(dxux*dxux + dyuy*dyuy) / (rho + one), rho); //mxxMyy += collFactorFyy * (-mxxMyy) - 3. * (1. - c1o2 * collFactorFyy) * (vx2 * dxux - vy2 * dyuy); // - //LBMReal collFactorFzz = getThyxotropyCollFactor(collFactorF, std::sqrt(dxux*dxux + dzuz*dzuz) / (rho + one), rho); + //LBMReal collFactorFzz = getRheologyCollFactor(collFactorF, std::sqrt(dxux*dxux + dzuz*dzuz) / (rho + one), rho); //mxxMzz += collFactorFzz * (-mxxMzz) - 3. * (1. - c1o2 * collFactorFzz) * (vx2 * dxux - vz2 * dzuz); - //mfabb += getThyxotropyCollFactor(collFactorF, std::abs(Dyz) / (rho + one), rho) * (-mfabb); - //mfbab += getThyxotropyCollFactor(collFactorF, std::abs(Dxz) / (rho + one), rho) * (-mfbab); - //mfbba += getThyxotropyCollFactor(collFactorF, std::abs(Dxy) / (rho + one), rho) * (-mfbba); + //mfabb += getRheologyCollFactor(collFactorF, std::abs(Dyz) / (rho + one), rho) * (-mfabb); + //mfbab += getRheologyCollFactor(collFactorF, std::abs(Dxz) / (rho + one), rho) * (-mfbab); + //mfbba += getRheologyCollFactor(collFactorF, std::abs(Dxy) / (rho + one), rho) * (-mfbba); - SPtr<Thixotropy> thix = Thixotropy::getInstance(); + SPtr<Rheology> thix = Rheology::getInstance(); LBMReal tau0 = thix->getYieldStress(); mxxPyyPzz += OxxPyyPzz * (mfaaa - mxxPyyPzz /*+ ((mxxPyyPzz-mfaaa)/shearFactor*tau0)*/) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz); @@ -893,13 +893,13 @@ void ThixotropyModelLBMKernel2::calculate(int step) } } -//SPtr<LBMKernel> ThixotropyModelLBMKernel2::clone() +//SPtr<LBMKernel> RheologyModelLBMKernel2::clone() //{ -// SPtr<LBMKernel> kernel(new ThixotropyModelLBMKernel2()); +// SPtr<LBMKernel> kernel(new RheologyModelLBMKernel2()); // kernel->setNX(nx); // kernel->setCollisionFactor(collFactor); // collFactorF = collFactor; -// dynamicPointerCast<ThixotropyModelLBMKernel2>(kernel)->initDataSet(); +// dynamicPointerCast<RheologyModelLBMKernel2>(kernel)->initDataSet(); // kernel->setBCProcessor(bcProcessor->clone(kernel)); // kernel->setWithForcing(withForcing); // kernel->setForcingX1(muForcingX1); @@ -911,17 +911,17 @@ void ThixotropyModelLBMKernel2::calculate(int step) // return kernel; //} -double ThixotropyModelLBMKernel2::getCalculationTime() +double RheologyModelLBMKernel2::getCalculationTime() { return timer.getTotalTime(); } -void ThixotropyModelLBMKernel2::swapDistributions() +void RheologyModelLBMKernel2::swapDistributions() { LBMKernel::swapDistributions(); } -void ThixotropyModelLBMKernel2::initDataSet() +void RheologyModelLBMKernel2::initDataSet() { SPtr<DistributionArray3D> df(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.0)); dataSet->setFdistributions(df); diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.h similarity index 72% rename from src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.h rename to src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.h index b0f492a170a886d23ab1f56d897ac9adf698d8d9..c3a20a11038f74586266c8338027a6187ef2fea5 100644 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel.h +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyModelLBMKernel2.h @@ -1,5 +1,5 @@ -#ifndef ThixotropyModelLBMKernel_H -#define ThixotropyModelLBMKernel_H +#ifndef RheologyModelLBMKernel2_H +#define RheologyModelLBMKernel2_H #include "LBMKernel.h" #include "BCProcessor.h" @@ -8,15 +8,15 @@ #include "basics/container/CbArray4D.h" #include "basics/container/CbArray3D.h" -class ThixotropyModelLBMKernel; +class RheologyModelLBMKernel2; //! \brief Base class for model of thixotropy based on K16. Use Template Method design pattern for Implementation of different models. //! \author K. Kutscher, M. Geier -class ThixotropyModelLBMKernel : public LBMKernel +class RheologyModelLBMKernel2 : public LBMKernel { public: - ThixotropyModelLBMKernel(); - virtual ~ThixotropyModelLBMKernel(); + RheologyModelLBMKernel2(); + virtual ~RheologyModelLBMKernel2(); void calculate(int step); virtual SPtr<LBMKernel> clone() { UB_THROW(UbException("SPtr<LBMKernel> clone() - belongs in the derived class")); }; double getCalculationTime(); @@ -26,7 +26,7 @@ public: protected: void initDataSet(); - virtual LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const { UB_THROW(UbException("LBMReal getThyxotropyCollFactor() - belongs in the derived class")); } + virtual LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const { UB_THROW(UbException("LBMReal getRheologyCollFactor() - belongs in the derived class")); } LBMReal f[D3Q27System::ENDF + 1]; diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyPowellEyringModelLBMKernel.h b/src/cpu/VirtualFluidsCore/LBM/RheologyPowellEyringModelLBMKernel.h new file mode 100644 index 0000000000000000000000000000000000000000..a68eca9cd627be7b56bcfebfd429d80c3f924aa8 --- /dev/null +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyPowellEyringModelLBMKernel.h @@ -0,0 +1,70 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RheologyPowellEyringModelLBMKernel.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= +#ifndef RheologyPowellEyringModelLBMKernel_H +#define RheologyPowellEyringModelLBMKernel_H + +#include "RheologyK17LBMKernel.h" +#include "Rheology.h" + +//! \brief Cumulant LBM kernel + Herschel-Bulkley plastic model +//! \author K. Kutscher, M. Geier +class RheologyPowellEyringModelLBMKernel : public RheologyK17LBMKernel +{ +public: + RheologyPowellEyringModelLBMKernel() {}; + ~RheologyPowellEyringModelLBMKernel() {}; + SPtr<LBMKernel> clone() override + { + SPtr<LBMKernel> kernel(new RheologyPowellEyringModelLBMKernel()); + kernel->setNX(nx); + kernel->setCollisionFactor(collFactor); + dynamicPointerCast<RheologyPowellEyringModelLBMKernel>(kernel)->initDataSet(); + kernel->setBCProcessor(bcProcessor->clone(kernel)); + kernel->setWithForcing(withForcing); + kernel->setForcingX1(muForcingX1); + kernel->setForcingX2(muForcingX2); + kernel->setForcingX3(muForcingX3); + kernel->setIndex(ix1, ix2, ix3); + kernel->setDeltaT(deltaT); + + return kernel; + } +protected: + LBMReal getRheologyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override + { + return Rheology::getPowellEyringCollFactor(omegaInf, shearRate, drho); + } +}; + + +#endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/Thixotropy.cpp b/src/cpu/VirtualFluidsCore/LBM/Thixotropy.cpp deleted file mode 100644 index f28c34f0ddc8be17807a32118074a0c07f36bcfa..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/Thixotropy.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "Thixotropy.h" - -SPtr<Thixotropy> Thixotropy::instance = SPtr<Thixotropy>(); -LBMReal Thixotropy::tau0 = 0; -LBMReal Thixotropy::k = 0; -LBMReal Thixotropy::n = 1; -LBMReal Thixotropy::omegaMin = 0; -LBMReal Thixotropy::beta = 0; -LBMReal Thixotropy::c = 0; -LBMReal Thixotropy::mu0 = 0; - -////////////////////////////////////////////////////////////////////////// -SPtr<Thixotropy> Thixotropy::getInstance() -{ - if (!instance) - instance = SPtr<Thixotropy>(new Thixotropy()); - return instance; -} - -void Thixotropy::setYieldStress(LBMReal yieldStress) -{ - tau0 = yieldStress; -} -LBMReal Thixotropy::getYieldStress() const -{ - return tau0; -} -void Thixotropy::setViscosityParameter(LBMReal kParameter) -{ - k = kParameter; -} -LBMReal Thixotropy::getViscosityParameter() const -{ - return k; -} -void Thixotropy::setPowerIndex(LBMReal index) -{ - n = index; -} -LBMReal Thixotropy::getPowerIndex() const -{ - return n; -} - -void Thixotropy::setOmegaMin(LBMReal omega) -{ - omegaMin = omega; -} -LBMReal Thixotropy::getOmegaMin() const -{ - return omegaMin; -} - -void Thixotropy::setBeta(LBMReal PowellEyringBeta) -{ - beta = PowellEyringBeta; -} - -LBMReal Thixotropy::getBeta() const -{ - return beta; -} - -void Thixotropy::setC(LBMReal PowellEyringC) -{ - c = PowellEyringC; -} - -LBMReal Thixotropy::getC() const -{ - return c; -} - -void Thixotropy::setMu0(LBMReal mu) -{ - mu0 = mu; -} - -LBMReal Thixotropy::getMu0() const -{ - return mu0; -} - -Thixotropy::Thixotropy() -{ -} \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.h b/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.h deleted file mode 100644 index 17fa477977bdfa997c0be0ef2254b139bb1cc1fe..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/ThixotropyModelLBMKernel2.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef ThixotropyModelLBMKernel2_H -#define ThixotropyModelLBMKernel2_H - -#include "LBMKernel.h" -#include "BCProcessor.h" -#include "D3Q27System.h" -#include "basics/utilities/UbTiming.h" -#include "basics/container/CbArray4D.h" -#include "basics/container/CbArray3D.h" - -class ThixotropyModelLBMKernel2; - -//! \brief Base class for model of thixotropy based on K16. Use Template Method design pattern for Implementation of different models. -//! \author K. Kutscher, M. Geier -class ThixotropyModelLBMKernel2 : public LBMKernel -{ -public: - ThixotropyModelLBMKernel2(); - virtual ~ThixotropyModelLBMKernel2(); - void calculate(int step); - virtual SPtr<LBMKernel> clone() { UB_THROW(UbException("SPtr<LBMKernel> clone() - belongs in the derived class")); }; - double getCalculationTime(); - - void swapDistributions(); - -protected: - void initDataSet(); - - virtual LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const { UB_THROW(UbException("LBMReal getThyxotropyCollFactor() - belongs in the derived class")); } - - LBMReal f[D3Q27System::ENDF + 1]; - - UbTimer timer; - - LBMReal OxyyMxzz; - - CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsF; - CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsF; - CbArray3D<LBMReal, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsF; - - mu::value_type muX1, muX2, muX3; - mu::value_type muDeltaT; - mu::value_type muNu; - LBMReal forcingX1; - LBMReal forcingX2; - LBMReal forcingX3; - - bool test; -}; - -#endif diff --git a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp index 60e0b41cb666583e198bb692a189b734f4f11ab1..b4eafda902448564800bb1479f7ac60f74c4b77d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp @@ -45,11 +45,11 @@ #include "BCArray3D.h" #include "ILBMKernel.h" -#include "DensityAndThixotropyBCAlgorithm.h" -#include "VelocityAndThixotropyBCAlgorithm.h" -#include "NoSlipAndThixotropyBCAlgorithm.h" -#include "NonReflectingOutflowAndThixotropyBCAlgorithm.h" -#include "VelocityWithDensityAndThixotropyBCAlgorithm.h" +#include "ThixotropyDensityBCAlgorithm.h" +#include "ThixotropyVelocityBCAlgorithm.h" +#include "ThixotropyNoSlipBCAlgorithm.h" +#include "ThixotropyNonReflectingOutflowBCAlgorithm.h" +#include "ThixotropyVelocityWithDensityBCAlgorithm.h" BoundaryConditionsBlockVisitor::BoundaryConditionsBlockVisitor() : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) {} @@ -102,20 +102,20 @@ void BoundaryConditionsBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> bloc bca->setBcPointer(bcPtr); bca->addDistributions(distributions); - if (alg == BCAlgorithm::VelocityAndThixotropyBCAlgorithm) - std::static_pointer_cast<VelocityAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + if (alg == BCAlgorithm::ThixotropyVelocityBCAlgorithm) + std::static_pointer_cast<ThixotropyVelocityBCAlgorithm>(bca)->addDistributionsH( kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::DensityAndThixotropyBCAlgorithm) - std::static_pointer_cast<DensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + if (alg == BCAlgorithm::ThixotropyDensityBCAlgorithm) + std::static_pointer_cast<ThixotropyDensityBCAlgorithm>(bca)->addDistributionsH( kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::NoSlipAndThixotropyBCAlgorithm) - std::static_pointer_cast<NoSlipAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + if (alg == BCAlgorithm::ThixotropyNoSlipBCAlgorithm) + std::static_pointer_cast<ThixotropyNoSlipBCAlgorithm>(bca)->addDistributionsH( kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::NonReflectingOutflowAndThixotropyBCAlgorithm) - std::static_pointer_cast<NonReflectingOutflowAndThixotropyBCAlgorithm>(bca) + if (alg == BCAlgorithm::ThixotropyNonReflectingOutflowBCAlgorithm) + std::static_pointer_cast<ThixotropyNonReflectingOutflowBCAlgorithm>(bca) ->addDistributionsH(kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::VelocityWithDensityAndThixotropyBCAlgorithm) - std::static_pointer_cast<VelocityWithDensityAndThixotropyBCAlgorithm>(bca) + if (alg == BCAlgorithm::ThixotropyVelocityWithDensityBCAlgorithm) + std::static_pointer_cast<ThixotropyVelocityWithDensityBCAlgorithm>(bca) ->addDistributionsH(kernel->getDataSet()->getHdistributions()); bca->setCollFactor(collFactor);