From e4593057b09d328a30e26a32e5724b4a20bb7c5f Mon Sep 17 00:00:00 2001 From: Cameron Stewart <cstewart@icp.uni-stuttgart.de> Date: Mon, 3 Dec 2018 13:56:55 +0100 Subject: [PATCH] convert d.c() --- src/lbm/SuViscoelasticity.h | 10 +++++----- tests/lbm/SuViscoelasticityTest.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lbm/SuViscoelasticity.h b/src/lbm/SuViscoelasticity.h index d7a264446..9783b3981 100644 --- a/src/lbm/SuViscoelasticity.h +++ b/src/lbm/SuViscoelasticity.h @@ -147,9 +147,9 @@ public: for (uint_t a = 0; a < LatticeModel_T::Stencil::D; ++a) { for (uint_t b = 0; b < LatticeModel_T::Stencil::D; ++b) { if(boundaryHandling->isDomain(cell + *d) ) { - gradu(b, a) += (velocity->get(cell + *d)[a] * d.c(b)) * real_c(0.5); + gradu(b, a) += velocity->get(cell + *d)[a] * real_c(d.c(b)) * real_c(0.5); } else if(boundaryHandling->isDomain(cell - *d)){ - gradu(b, a) += (velocity->get(cell - *d)[a] * d.c(b)) * real_c(-0.5) + velocity->get(cell)[a] * d.c(b); + gradu(b, a) += velocity->get(cell - *d)[a] * real_c(d.c(b)) * real_c(-0.5) + velocity->get(cell)[a] * real_c(d.c(b)); } else { gradu(b, a) += real_t(0); } @@ -166,7 +166,7 @@ public: } // equation 23 from Su 2013 - stressNew->get(cell) = stressOld->get(cell) + (stress1 * real_c(2.0) - stress2 * real_c(1.5) - stress3 * real_c(0.5)) * delta_t_ * (real_c(1) / pdf->getDensity(cell)) + + stressNew->get(cell) = stressOld->get(cell) + (stress1 * real_c(2.0) - stress2 * real_c(1.5) - stress3 * real_c(0.5)) * delta_t_ * (real_c(1.0) / pdf->getDensity(cell)) + relstr * delta_t_; } }) @@ -221,9 +221,9 @@ public: k = 2; } if (boundaryHandling->isDomain(cell + *d)) { - f[i] += stress->get(cell + *d)(k, i) * d.c(k); + f[i] += stress->get(cell + *d)(k, i) * real_c(d.c(k)); } else if(boundaryHandling->isDomain(cell - *d)){ - f[i] += -stress->get(cell - *d)(k, i) * d.c(k) + stress->get(cell)(k, i) * d.c(k) * real_c(2.0); + f[i] += -stress->get(cell - *d)(k, i) * real_c(d.c(k)) + stress->get(cell)(k, i) * real_c(d.c(k)) * real_c(2.0); } else { f[i] += real_t(0); } diff --git a/tests/lbm/SuViscoelasticityTest.cpp b/tests/lbm/SuViscoelasticityTest.cpp index 822456bb7..b58ec8375 100644 --- a/tests/lbm/SuViscoelasticityTest.cpp +++ b/tests/lbm/SuViscoelasticityTest.cpp @@ -263,7 +263,7 @@ int main(int argc, char ** argv ){ BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field", FieldGhostLayers); BlockDataID forceFieldId = field::addToStorage<ForceField_T>( blocks, "Force Field", Vector3<real_t>(0.0), field::zyxf, FieldGhostLayers); LatticeModel_T latticeModel = LatticeModel_T(lbm::collision_model::TRT::constructWithMagicNumber( walberla::lbm::collision_model::omegaFromViscosity(eta_s)), lbm::force_model::GuoField<ForceField_T>( forceFieldId ) ); - BlockDataID pdfFieldId = lbm::addPdfFieldToStorage( blocks, "pdf field", latticeModel, Vector3<real_t>(), real_c(1), FieldGhostLayers ); + BlockDataID pdfFieldId = lbm::addPdfFieldToStorage( blocks, "pdf field", latticeModel, Vector3<real_t>(), real_c(1.0), FieldGhostLayers ); BlockDataID stressId = walberla::field::addToStorage<StressField_T>( blocks, "Stress Field", Matrix3<real_t>(0.0), field::zyxf, FieldGhostLayers); BlockDataID stressOldId = walberla::field::addToStorage<StressField_T>( blocks, "Old Stress Field", Matrix3<real_t>(0.0), field::zyxf, FieldGhostLayers); BlockDataID velocityId = walberla::field::addToStorage<VelocityField_T> (blocks, "Velocity Field", Vector3<real_t>(0.0), field::zyxf, FieldGhostLayers); -- GitLab