read BC from model database
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
color lattice boltzmann model
|
||||
*/
|
||||
#include "models/ColorModel.h"
|
||||
@@ -121,7 +121,10 @@ void ScaLBL_ColorModel::ReadParams(string filename){
|
||||
//if (BoundaryCondition==4) flux *= rhoA; // mass flux must adjust for density (see formulation for details)
|
||||
|
||||
BoundaryCondition = 0;
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
if (color_db->keyExists( "BC" )){
|
||||
BoundaryCondition = color_db->getScalar<int>( "BC" );
|
||||
}
|
||||
else if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
|
||||
|
||||
@@ -81,13 +81,18 @@ void ScaLBL_DFHModel::ReadParams(string filename){
|
||||
outletA=0.f;
|
||||
outletB=1.f;
|
||||
|
||||
if (BoundaryCondition==4) flux = din*rhoA; // mass flux must adjust for density (see formulation for details)
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
if (color_db->keyExists( "BC" )){
|
||||
BoundaryCondition = color_db->getScalar<int>( "BC" );
|
||||
}
|
||||
else if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
|
||||
// Read domain parameters
|
||||
auto L = domain_db->getVector<double>( "L" );
|
||||
auto size = domain_db->getVector<int>( "n" );
|
||||
auto nproc = domain_db->getVector<int>( "nproc" );
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
Nx = size[0];
|
||||
Ny = size[1];
|
||||
Nz = size[2];
|
||||
@@ -98,6 +103,8 @@ void ScaLBL_DFHModel::ReadParams(string filename){
|
||||
nprocy = nproc[1];
|
||||
nprocz = nproc[2];
|
||||
|
||||
if (BoundaryCondition==4) flux = din*rhoA; // mass flux must adjust for density (see formulation for details)
|
||||
|
||||
}
|
||||
void ScaLBL_DFHModel::SetDomain(){
|
||||
Dm = std::shared_ptr<Domain>(new Domain(domain_db,comm)); // full domain for analysis
|
||||
|
||||
@@ -88,7 +88,10 @@ void ScaLBL_GreyscaleModel::ReadParams(string filename){
|
||||
|
||||
//------------------------ Other Domain parameters ------------------------//
|
||||
BoundaryCondition = 0;
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
if (greyscale_db->keyExists( "BC" )){
|
||||
BoundaryCondition = greyscale_db->getScalar<int>( "BC" );
|
||||
}
|
||||
else if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
// ------------------------------------------------------------------------//
|
||||
|
||||
@@ -57,7 +57,10 @@ void ScaLBL_MRTModel::ReadParams(string filename){
|
||||
}
|
||||
|
||||
// Read domain parameters
|
||||
if (domain_db->keyExists( "BC" )){
|
||||
if (mrt_db->keyExists( "BoundaryCondition" )){
|
||||
BoundaryCondition = mrt_db->getScalar<int>( "BC" );
|
||||
}
|
||||
else if (domain_db->keyExists( "BC" )){
|
||||
BoundaryCondition = domain_db->getScalar<int>( "BC" );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user