19#include "SpreaderModel.h"
20#include "SimpleFish.h"
22#include <EnvironmentProvider.h>
26#include "sfh/util/diagnostic.h"
28#include "sfh/constants.h"
36#ifdef FH_VISUALIZATION
37#include <OgreBoxEmitter.h>
49 static const int USE_SIMPLE_FISH_MODEL = 0;
52 PelletField(std::string sSimObjectName, ISimObjectCreator* pCreator );
54 void FinalSetup(
const double T,
const double *
const X, ISimObjectCreator*
const creator);
56 void InitialConditionSetup(
const double T,
const double *
const currentIC,
double*
const updatedIC, ISimObjectCreator*
const creator);
58 void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot,
const bool bIsMajorTimeStep);
60 int getIndex(
int x,
int y,
int z);
62 void calcAdvectAndDiff(
double T,
const double*
const adX,
double*
const adXDot);
64 void calcAdvectAndDiffWorker(
double T,
double dt,
const double*
const adX,
double*
const adXDot,
int kstart,
int kend);
66 int* getIndexFromPos(Eigen::Vector3d position);
68 double getConcentration(Eigen::Vector3d position,
const double*
const X);
70 double getConcentrationAndGradient(Eigen::Vector3d position,
const double*
const X,
double* gradient);
72 double removePellet(Eigen::Vector3d position,
const double*
const X, IStateUpdater* updater);
74 double getPelletWeight();
76 double getTotalFeed(
const double *
const X);
78 double superbeeAdv(
double dt,
double dx,
double c_ll,
double c_l,
double c_c,
double c_r,
double c_rr,
double v_l,
double v_r);
80 bool checkSign(
double value,
bool signToTest);
82 double minmod(
double v1,
double v2);
84 double maxmod(
double v1,
double v2);
86 void PreOdeFcn(
const double T,
const double *
const X, IStateUpdater* updater);
88 const virtual double* ConcAtRefPos(
const double T,
const double *
const X,
int iPos);
89 const virtual double *concOutputAtStaticPos(
const double dT,
const double *
const adX,
int iExtNode);
92 const virtual double* OutputIngestion(
const double T,
const double*
const X);
94#ifdef FH_VISUALIZATION
96 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
99 virtual void RenderUpdate(
const double T,
const double*
const X);
101 void CloudRenderInit(Ogre::SceneManager* sceneMgr);
102 void RenderCloud(
const double T,
const double*
const X);
108 std::vector<std::string> SplitString(std::string sData,std::string separator);
109 virtual const double* Position(
const double dT,
const double*
const adX);
111 double getAtPos(
int i,
int j,
int k,
const double*
const X);
113 ISimObjectCreator* m_pCreator;
116 const double* local_adX;
117 double* local_adXdot;
120 int m_nRefPosOutputs;
121 ISignalPort **m_refPos;
122 double *m_concAtRefPos;
130 int m_nfishstates, m_isimplefish;
132 double m_time_last = -1;
133 double m_dx, m_sinkingSpeed, m_diffKappaXY, m_diffKappaZ;
134 int m_imax, m_jmax, m_kmax;
135 double m_cageRad, m_cageCylDepth, m_cageTotDepth;
136 int m_feederCenterX, m_feederCenterY, m_feederType, m_feederTilt;
137 double m_feederAirSpeed, m_feederAngle;
139 double m_simpleFishN, m_simpleFishW, m_simpleFishStd;
141 double m_feedingRateMult;
142 double m_pelletWeight;
144 double m_temperature;
146 vector<double> m_advect, m_diffus, m_feeding;
147 vector<vector<double>> m_feedingRate;
152 vector<vector<vector<vector<double>>>> m_currentField;
154 vector<vector<int>> m_cellOffsets;
156 int m_readCurrentField, m_outputcounter;
160 int m_nStaticSensorPoints;
161 ISignalPort **m_staticPosInputs;
162 double* m_staticPosOutputs;
165 environment::EnvironmentProvider* m_environment;
188 double m_prevTextOutputTime;
194 double m_IngestionRate[3];
195 double m_CurrentReduction;
196 double m_UpdateStepSize;
204#ifdef FH_VISUALIZATION
206 double m_visParticleSize;
207 double m_visParticleMultiplier;
208 double m_visSinkingSpeedMultiplier;
209 double m_visParticleTimeToLive;
210 double m_visParticleFadeRate;
211 int m_visParticleQuota;
212 double m_visAngleSpread;
213 std::string m_visParticleColor;
215 std::string m_sMaterial;
216 std::string m_sMeshName;
218 Ogre::Entity* m_pRenderEntity;
219 Ogre::SceneNode* m_pRenderNode;
220 Ogre::SceneManager* m_pSceneMgr;
222 Ogre::ParticleSystem* m_particleSystem;
223 Ogre::SceneNode* m_particleNode;
224 Ogre::ParticleEmitter* m_particleEmitter;
Definition PelletField.h:46
float * m_gridCentre
Grid centre in cartesian coordinates. Fixed during simulation if m_boolMoveGrid equals false....
Definition PelletField.h:171
ISignalPort * m_feedRateIn
Signal port. Input port receiving feeding rate in g/s, (grams/second).
Definition PelletField.h:186
float * m_gridCentreInit
Grid centre in cartesian coordinates. Initial value.
Definition PelletField.h:172
bool m_useTankFeeding
Boolean. True if tank feeding pattern should be used.
Definition PelletField.h:201
int * m_dij_tot
Total movement of grid centre (since initialization) in grid coordinates (i,j).
Definition PelletField.h:177
bool m_boolVarFeedRate
Feeding (time and rate) determined by input during simulation.
Definition PelletField.h:184
std::string m_startDateString
String describing the start date for the data to be used.
Definition PelletField.h:187
double ** m_feedingRegime
Feeding regime with first dimension being m_nFeedingPeriods and second dimension being [startup time ...
Definition PelletField.h:183
double * m_cageCentre
Time dependent centre postion of cage. Updated by input port m_cageCentreNED.
Definition PelletField.h:178
double m_dynFeedRate
Feeding rate (g/s, grams/second) set by input port.
Definition PelletField.h:185
bool m_boolMoveGrid
Boolean. If true, the grid is moving with the centre of the grid. m_gridCentre will be equal to m_cag...
Definition PelletField.h:169
bool m_boolCagePos
Boolean indicating whether time dependent cage position is received or not.
Definition PelletField.h:168
void setVarValFromInputPort(ISignalPort *inputPort, double *varVal, int nVal, const double T, const double *const X)
Internal (to PelletField) function setting varVal equal to inputPort.
int m_nFeedingPeriods
Number of feeding periods in feeding regime.
Definition PelletField.h:182
PelletField(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.
bool m_useFeedAsExperimentalO2Proxy
Boolean. True if feed distribution model shall be used as O2 level proxy.
Definition PelletField.h:202
ISignalPort * m_cageCentreNED
Input port receiving (x,y,z) coordinates in NED frame of cage top position. x and y are used in the c...
Definition PelletField.h:170
Definition SimpleFish.h:28
Definition SpreaderModel.h:21