Skip to content
Snippets Groups Projects
Commit d85a6396 authored by kutscher's avatar kutscher
Browse files

unifies quantity names and scaling in VTK file output

parent 33de20a4
No related branches found
No related tags found
No related merge requests found
...@@ -149,16 +149,15 @@ void WriteMacroscopicQuantitiesCoProcessor::clearData() ...@@ -149,16 +149,15 @@ void WriteMacroscopicQuantitiesCoProcessor::clearData()
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block)
{ {
double level = (double)block->getLevel();
double blockID = (double)block->getGlobalID(); double blockID = (double)block->getGlobalID();
//This data is written: //This data is written:
datanames.resize(0); datanames.resize(0);
datanames.push_back("Rho"); datanames.push_back("DRho");
datanames.push_back("Press");
datanames.push_back("Vx"); datanames.push_back("Vx");
datanames.push_back("Vy"); datanames.push_back("Vy");
datanames.push_back("Vz"); datanames.push_back("Vz");
datanames.push_back("Level");
data.resize(datanames.size()); data.resize(datanames.size());
...@@ -166,7 +165,7 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) ...@@ -166,7 +165,7 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block)
SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray();
SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions();
LBMReal f[D3Q27System::ENDF+1]; LBMReal f[D3Q27System::ENDF+1];
LBMReal vx1,vx2,vx3,rho; LBMReal vx1,vx2,vx3,drho,press;
//node numbering always starts at 0! //node numbering always starts at 0!
int SWB,SEB,NEB,NWB,SWT,SET,NET,NWT; int SWB,SEB,NEB,NWB,SWT,SET,NET,NWT;
...@@ -212,10 +211,14 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) ...@@ -212,10 +211,14 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block)
float(worldCoordinates[2]) )); float(worldCoordinates[2]) ));
distributions->getDistribution(f, ix1, ix2, ix3); distributions->getDistribution(f, ix1, ix2, ix3);
calcMacros(f,rho,vx1,vx2,vx3); calcMacros(f,drho,vx1,vx2,vx3);
press = D3Q27System::calcPress(f,drho,vx1,vx2,vx3);
if (UbMath::isNaN(rho) || UbMath::isInfinity(rho)) if (UbMath::isNaN(drho) || UbMath::isInfinity(drho))
UB_THROW( UbException(UB_EXARGS,"rho is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+ UB_THROW( UbException(UB_EXARGS,"drho is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+
", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3)));
if (UbMath::isNaN(press) || UbMath::isInfinity(press))
UB_THROW( UbException(UB_EXARGS,"press is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+
", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); ", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3)));
if (UbMath::isNaN(vx1) || UbMath::isInfinity(vx1)) if (UbMath::isNaN(vx1) || UbMath::isInfinity(vx1))
UB_THROW( UbException(UB_EXARGS,"vx1 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+ UB_THROW( UbException(UB_EXARGS,"vx1 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+
...@@ -227,11 +230,11 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) ...@@ -227,11 +230,11 @@ void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block)
UB_THROW( UbException(UB_EXARGS,"vx3 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+ UB_THROW( UbException(UB_EXARGS,"vx3 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+
", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); ", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3)));
data[index++].push_back(rho * conv->getFactorDensityLbToW() ); data[index++].push_back(drho * conv->getFactorDensityLbToW());
data[index++].push_back(press * conv->getFactorPressureLbToW());
data[index++].push_back(vx1 * conv->getFactorVelocityLbToW()); data[index++].push_back(vx1 * conv->getFactorVelocityLbToW());
data[index++].push_back(vx2 * conv->getFactorVelocityLbToW()); data[index++].push_back(vx2 * conv->getFactorVelocityLbToW());
data[index++].push_back(vx3 * conv->getFactorVelocityLbToW()); data[index++].push_back(vx3 * conv->getFactorVelocityLbToW());
data[index++].push_back(level);
} }
} }
} }
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ \
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 CumulantK17LBMKernel.cpp
//! \ingroup LBM
//! \author Konstantin Kutscher, Martin Geier
//=======================================================================================
#include "CumulantK17LBMKernel.h" #include "CumulantK17LBMKernel.h"
#include "D3Q27System.h" #include "D3Q27System.h"
#include "D3Q27EsoTwist3DSplittedVector.h" #include "D3Q27EsoTwist3DSplittedVector.h"
......
...@@ -582,10 +582,9 @@ namespace D3Q27System ...@@ -582,10 +582,9 @@ namespace D3Q27System
static inline LBMReal calcPress(const LBMReal* const f, LBMReal rho, LBMReal vx1, LBMReal vx2, LBMReal vx3) static inline LBMReal calcPress(const LBMReal* const f, LBMReal rho, LBMReal vx1, LBMReal vx2, LBMReal vx3)
{ {
using namespace UbMath; using namespace UbMath;
LBMReal op=1.0; LBMReal OxxPyyPzz = c1;
return ((f[E]+f[W]+f[N]+f[S]+f[T]+f[B]+2.*(f[NE]+f[SW]+f[SE]+f[NW]+f[TE]+f[BW]+f[BE]+f[TW]+f[TN]+f[BS]+f[BN]+f[TS])+ return ((f[E]+f[W]+f[N]+f[S]+f[T]+f[B]+c2*(f[NE]+f[SW]+f[SE]+f[NW]+f[TE]+f[BW]+f[BE]+f[TW]+f[TN]+f[BS]+f[BN]+f[TS])+
3.*(f[TNE]+f[TSW]+f[TSE]+f[TNW]+f[BNE]+f[BSW]+f[BSE]+f[BNW])-(vx1*vx1+vx2*vx2+vx3*vx3))*(1-0.5*op)+op*0.5*(rho))*c1o3; c3*(f[TNE]+f[TSW]+f[TSE]+f[TNW]+f[BNE]+f[BSW]+f[BSE]+f[BNW])-(vx1*vx1+vx2*vx2+vx3*vx3))*(c1-c1o2*OxxPyyPzz)+OxxPyyPzz*c1o2*(rho))*c1o3;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment