Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector exchange #695

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion include/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef Algorithm_h
#define Algorithm_h

#include<NaluParsing.h>

#include <vector>

namespace stk {
Expand Down Expand Up @@ -45,10 +47,12 @@ class Algorithm

virtual void pre_work() {}

virtual void set_data(double theDouble) {}
virtual void set_data(double theDouble, double theSecondDouble = 0.0) {}

virtual void set_data_alt(double theDouble) {}

virtual void set_data_vector(Velocity uVec) {}

virtual void set_bool(bool theBool) {}

Realm &realm_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@ class AssembleMomentumElemWallFunctionProjectedSolverAlgorithm : public SolverAl
stk::mesh::Part *part,
EquationSystem *eqSystem,
const bool &useShifted,
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap,
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > > &pointInfoMap,
stk::mesh::Ghosting *wallFunctionGhosting);
virtual ~AssembleMomentumElemWallFunctionProjectedSolverAlgorithm() {}
virtual void initialize_connectivity();
virtual void execute();

const bool useShifted_;
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap_;
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > >&pointInfoMap_;
stk::mesh::Ghosting *wallFunctionGhosting_;

const double yplusCrit_;
const double elog_;
const double kappa_;

double exchangeAlphaTau_;
const double shiftedPiomelli_;
const double om_shiftedPiomelli_;

VectorFieldType *velocity_;
VectorFieldType *bcVelocity_;
ScalarFieldType *density_;
Expand Down
30 changes: 24 additions & 6 deletions include/ComputeWallFrictionVelocityProjectedAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include<Algorithm.h>
#include<PointInfo.h>
#include<NaluParsing.h>
#include<FieldTypeDef.h>

// stk
Expand Down Expand Up @@ -41,19 +42,23 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
ComputeWallFrictionVelocityProjectedAlgorithm(
Realm &realm,
stk::mesh::Part *part,
const double wallNormalProjectedDistance,
const double projectedDistance,
const Velocity projectedDistanceUnitNormal,
const double odeFac,
const bool useShifted,
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap,
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > > &pointInfoMap,
stk::mesh::Ghosting *wallFunctionGhosting);
virtual ~ComputeWallFrictionVelocityProjectedAlgorithm();

void execute();

void set_data(
double theDouble);
double theDouble, double theSecondDouble);
void set_data_alt(
double theDouble);
void set_data_vector(
Velocity theVec);

void compute_utau(
const double &up, const double &yp,
Expand All @@ -65,7 +70,7 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
const double &muWall, PointInfo *pInfo, double &utau, bool &converged);

// debug
void provide_output(const PointInfo *pInfo, const bool problemPoint);
void provide_output(const PointInfo *pInfo, const bool problemPoint, const int firstSecond);

// ghosting and initialization set of calls
void initialize();
Expand All @@ -77,9 +82,14 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
void coarse_search();
void manage_ghosting();
void complete_search();
void complete_search_pinfo(
std::vector<double> &isoParCoords,
std::vector<double> &pointCoords,
PointInfo *pInfo,
std::vector<PointInfo *> &problemInfoVec);

const bool useShifted_;
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap_;
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > > &pointInfoMap_;
stk::mesh::Ghosting *wallFunctionGhosting_;

stk::mesh::BulkData *bulkData_;
Expand All @@ -89,6 +99,8 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
const double yplusCrit_;
const double elog_;
const double kappa_;
const double exchangeAlphaTau_;

const int maxIteration_;
const double tolerance_;

Expand All @@ -99,7 +111,11 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
const stk::search::SearchMethod searchMethod_;
const double expandBoxPercentage_;
size_t needToGhostCount_;


/* min/max domain bounding box */
std::vector<double> minDomainBoundingBox_;
std::vector<double> maxDomainBoundingBox_;

VectorFieldType *velocity_;
VectorFieldType *bcVelocity_;
VectorFieldType *coordinates_;
Expand All @@ -111,8 +127,10 @@ class ComputeWallFrictionVelocityProjectedAlgorithm : public Algorithm
ScalarFieldType *assembledWallNormalDistance_;
ScalarFieldType *assembledWallArea_;

// per part value for projected distance and ODE
// per part value for projected distance (and unit vec) and ODE option
std::vector<double> projectedDistanceVec_;
std::vector<double> wallNormalProjectedDistanceVec_;
std::vector<Velocity > projectedDistanceUnitNormalVec_;
std::vector<double> projectedDistanceOdeVec_;

/* data types for stk_search */
Expand Down
2 changes: 1 addition & 1 deletion include/LowMachEquationSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class MomentumEquationSystem : public EquationSystem {
std::vector<stk::mesh::Part *> notProjectedPart_;

// projected in space points
std::map<std::string, std::vector<std::vector<PointInfo *> > > pointInfoMap_;
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > > pointInfoMap_;
};

class ContinuityEquationSystem : public EquationSystem {
Expand Down
9 changes: 7 additions & 2 deletions include/NaluParsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ struct WallUserData : public UserData {
bool wallFunctionProjectedApproach_;
bool neumann_;
double projectedDistance_;
double wallNormalProjectedDistance_;
Velocity projectedDistanceUnitNormal_;

bool projectedDistanceOde_;

bool isFsiInterface_;
Expand All @@ -231,9 +234,11 @@ struct WallUserData : public UserData {
wallFunctionApproach_(false),
wallFunctionProjectedApproach_(false),
neumann_(false),
projectedDistance_(1.0),
projectedDistance_(-1.0e16),
wallNormalProjectedDistance_(-1.0e16),
projectedDistanceOde_(false),
isFsiInterface_(false) {}
isFsiInterface_(false)
{}
};

struct InflowUserData : public UserData {
Expand Down
4 changes: 4 additions & 0 deletions include/SolutionOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ class SolutionOptions
// wetted wall init
bool wettedWallInit_;
double wettedWallDistance_;

// exchange model constant
double exchangeAlphaTau_;
double shiftedPiomelli_;
};

} // namespace nalu
Expand Down
7 changes: 5 additions & 2 deletions include/SurfaceForceAndMomentWallFunctionProjectedAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SurfaceForceAndMomentWallFunctionProjectedAlgorithm : public Algorithm
const std::vector<double > &parameters,
const bool &useShifted,
ScalarFieldType *assembledArea,
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap,
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > > &pointInfoMap,
stk::mesh::Ghosting *wallFunctionGhosting);
~SurfaceForceAndMomentWallFunctionProjectedAlgorithm();

Expand All @@ -55,11 +55,14 @@ class SurfaceForceAndMomentWallFunctionProjectedAlgorithm : public Algorithm
const std::string &outputFileName_;
const std::vector<double > &parameters_;
const bool useShifted_;
std::map<std::string, std::vector<std::vector<PointInfo *> > > &pointInfoMap_;
std::map<std::string, std::vector<std::vector<std::pair<PointInfo *, PointInfo *> > > >&pointInfoMap_;
stk::mesh::Ghosting *wallFunctionGhosting_;
const double yplusCrit_;
const double elog_;
const double kappa_;
double exchangeAlphaTau_;
const double shiftedPiomelli_;
const double om_shiftedPiomelli_;

ScalarFieldType *assembledArea_;
VectorFieldType *coordinates_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ realms:
wall_user_data:
velocity: [0.0,0.0,0.0]
use_wall_function_projected: yes
projected_distance: 0.0625
wall_normal_projected_distance: 0.0625
projected_distance_ode: yes
use_neumann_condition: yes

Expand All @@ -103,7 +103,7 @@ realms:
wall_user_data:
velocity: [0.0,0.0,0.0]
use_wall_function_projected: yes
projected_distance: 0.0625
wall_normal_projected_distance: 0.0625
projected_distance_ode: no
use_neumann_condition: yes

Expand Down
Loading