MURE
Loading...
Searching...
No Matches
COBRA_EN.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _COBRA_EN_HXX
20#define _COBRA_EN_HXX
21
28#include <vector>
29#include <fstream>
30#include <string>
31
33
34using namespace std;
35
36
38
52{
53 public:
60 virtual ~COBRA_EN();
61 COBRA_EN();
62 virtual COBRA_EN *Clone()
63 {
64 return new COBRA_EN(*this);
65 }
67
72 void SetInletTemperature(double T)
73 {
75 }
76 void SetInletMassFlux(double Q)
77 {
78 fInletMassFlux = Q;
79 }
81 {
83 }
84 void SetExitPressure(double P)
85 {
86 fExitPressure = P;
87 }
88 void BuildCOBRAFile();
89 void SetSpacerGridsCoeff(double GridCoefficient)
90 {
91 fSpacerGridCoeff = GridCoefficient;
92 }
93 void AddSpacerGridsPos(double Pos)
94 {
95 fSpacerGridPositions.push_back(Pos);
96 }
97 static void ResetSigmaPhiBool()
98 {
99 fSigmaPhiUpdated = false;
100 }
102 {
103 return fReactorAssembly;
104 }
105
112 void SetInletDensity(double D)
113 {
114 fInletDensity = D;
115 }
117 {
119 }
121
122 protected:
123
128 void Card1();
129 void Card2();
130 void Card3();
131 void Card4();
132 void Card5();
133 void Card7();
134 void Card8();
135 void Card10();
136 void Card11();
137 void Card12();
138 void Card14();
139 void Card18();
140 void Card20();
141 void Card22();
142 void Card26();
143 void Card27();
144 void Card29();
145 void Card30();
146 void Card32();
147 void Card36();
149
150
156 COBRA_EN(const COBRA_EN &c);
158 void Init();
160 void THDataCalculations();
162 void MeshGridMC();
164 void CardComment(int N, string Comment);
165
167 string InputCardTruncate(double Value, int CharNumber, bool MustBeADouble = false);
168
174 vector < double > CalculateChannelConnectionAndData(int ChannelNumber);
176 vector < double > IdentifyRodsToSubChannelsConnexion(int RodNumber);
178 void OrganizeChannels();
180 void PrintData();
182 void PrintNewTHData();
184 void RunCOBRA();
186 void CheckRestrictions();
188
189
195 void UpdateData();
197 void CheckOutputFile();
199 void ExtractData();
201 void MCCellsDataAverages();
203 void MCZonesDataAverages();
205 void RebootStrapping();
207
208
209
210 private:
211
213 static bool fSigmaPhiUpdated;
219 int fNDX;
225 string fDirectory;
226 ofstream *fInputFile;
227 ifstream *fOutputFile;
230 vector < double > fSpacerGridPositions;
231 vector < vector < double > > fPower;
232 vector < vector < double > > fPowerErr;
233 vector < vector < int > > fCOBRARodsLatticeNumbering;
234 vector < vector < int > > fCOBRAChannelsLatticeNumbering;
235 vector < vector < double > > fCOBRAChannelsRCXPos;
236 vector < vector < double > > fCOBRAChannelsRCYPos;
237 vector < vector < double > > fCOBRAChannelsCenterXPos;
238 vector < vector < double > > fCOBRAChannelsCenterYPos;
239 vector < vector < int > > fChannelTypes;
240 vector < double > fChannelFlowArea;
241 vector < double > fChannelWettedPerimeter;
242 vector < double > fChannelHeatedPerimeter;
243
244 vector < vector < double > > fMUREFuelCellsTemp;
245 vector < vector < double > > fMURECladCellsTemp;
246 vector < vector < double > > fMURECoolantCellsTemp;
247 vector < vector < double > > fCOBRACoolantChannelDensity;
248 vector < vector < double > > fMURECoolantCellsDensity;
249
252
253 vector < ofstream *> fFiles;
254};
255
256#endif
257
Header file for abstract class GenricReactorAssembly.
Manages the coupling analysis with thermal hydraulics code COBRA-EN.
Definition COBRA_EN.hxx:52
vector< vector< double > > fCOBRAChannelsRCYPos
Matrix containing channels top right corner Y cartesian position.
Definition COBRA_EN.hxx:236
double fSpacerGridCoeff
Grid loss coefficient.
Definition COBRA_EN.hxx:229
vector< double > CalculateChannelConnectionAndData(int ChannelNumber)
Calculate channels connections distances and channels data (area and perimeters)
Definition COBRA_EN_constructor.cxx:394
int fChannelsNumber
Total number of coolant channels (not including bypass channels)
Definition COBRA_EN.hxx:217
void Card32()
Generate and Write : Transient Parameters.
Definition COBRA_EN_buildfile.cxx:633
void RebootStrapping()
Re initialize some values (in the case of iterations with neutronics)
Definition COBRA_EN_reader.cxx:475
void Card2()
Generate and Write : General Options.
Definition COBRA_EN_buildfile.cxx:108
double fInletTemperature
Inlet temperature (K) default = 560 K.
Definition COBRA_EN.hxx:220
void Init()
Initializes some structures.
Definition COBRA_EN_constructor.cxx:123
void OrganizeChannels()
Organize Channels types.
Definition COBRA_EN_constructor.cxx:611
void Card26()
Generate and Write : Parameters Section A and B.
Definition COBRA_EN_buildfile.cxx:543
void Card18()
Generate and Write : Two Phase Friction Model.
Definition COBRA_EN_buildfile.cxx:497
int fNDX
Number of axials interval in thermal hydraulics.
Definition COBRA_EN.hxx:219
void Card10()
Generate and Write : Channel Data.
Definition COBRA_EN_buildfile.cxx:286
vector< double > fChannelWettedPerimeter
Wetted perimeter value of the channel.
Definition COBRA_EN.hxx:241
void CalculatePowerDeposits()
Calculate cells' power deposits.
Definition COBRA_EN_constructor.cxx:276
void MCCellsDataAverages()
Do an average on thermal data (COBRA mesh —> MURE mesh)
Definition COBRA_EN_reader.cxx:255
GenericReactorAssembly * GetReactorAssembly()
Definition COBRA_EN.hxx:101
ofstream * fInputFile
COBRA Input File.
Definition COBRA_EN.hxx:226
int fFuelRodsNumber
Total number of fuel rods (control rods are including in this numbering but they do not release power...
Definition COBRA_EN.hxx:216
void CheckOutputFile()
Checks output file presence (results of thermal hydraulics computation)
Definition COBRA_EN_reader.cxx:49
void SetInletBoronConcentration(double C)
Definition COBRA_EN.hxx:80
void SetInletMassFlux(double Q)
Definition COBRA_EN.hxx:76
string fAssemblyName
Identification Name Of the assembly.
Definition COBRA_EN.hxx:215
void SetExitPressure(double P)
Definition COBRA_EN.hxx:84
vector< vector< double > > fMURECladCellsTemp
Matrix containing MURE cladding cells temperature f[X][Y] : X = COBRA rod numbering ; Y = Levels step...
Definition COBRA_EN.hxx:245
vector< vector< int > > fCOBRAChannelsLatticeNumbering
Matrix containing channels lattice mesh data for COBRA identification number (MURE->COBRA)
Definition COBRA_EN.hxx:234
double fOutletMeanTemperature
Outlet mean temperature (used for plenum)
Definition COBRA_EN.hxx:250
void Card14()
Generate and Write : Hydraulic Model Indicators.
Definition COBRA_EN_buildfile.cxx:472
void CalculateChannelsPositions()
Calculate channels' positions.
Definition COBRA_EN_constructor.cxx:343
void CheckRestrictions()
Checks coherence on data : some improvments are to be done.
Definition COBRA_EN_constructor.cxx:715
vector< vector< int > > fChannelTypes
Matrix containing channels types with their identification number.
Definition COBRA_EN.hxx:239
vector< vector< double > > fCOBRAChannelsCenterXPos
Matrix containing channels center X cartesian position.
Definition COBRA_EN.hxx:237
int fChannelType
Number of different channel types.
Definition COBRA_EN.hxx:218
void Card5()
Generate and Write : Linear Rod Powers.
Definition COBRA_EN_buildfile.cxx:181
void Card7()
Generate and Write : Channel Connexion Data.
Definition COBRA_EN_buildfile.cxx:227
void Card11()
Generate and Write : Grids position.
Definition COBRA_EN_buildfile.cxx:339
void RunCOBRA()
Run script for COBRA launching.
Definition COBRA_EN_buildfile.cxx:667
void SetInletTemperature(double T)
Definition COBRA_EN.hxx:72
bool fHydraulicModelIndicators
If true, user hydraulics parameters are used.
Definition COBRA_EN.hxx:214
double fInletBoronConcentration
Inlet boron concentration (mass proportion in ppm) default = 1000 ppm.
Definition COBRA_EN.hxx:223
string InputCardTruncate(double Value, int CharNumber, bool MustBeADouble=false)
Truncate value to the correct input size.
Definition COBRA_EN_constructor.cxx:210
vector< vector< int > > fCOBRARodsLatticeNumbering
Matrix containing rods lattice mesh data for COBRA identification number (MURE->COBRA)
Definition COBRA_EN.hxx:233
vector< double > fSpacerGridPositions
Positions of grids.
Definition COBRA_EN.hxx:230
vector< vector< double > > fMURECoolantCellsDensity
Matrix containing MURE coolant cells temperature f[X][Y] : X = COBRA rod numbering ; Y = Levels steps...
Definition COBRA_EN.hxx:248
vector< double > fChannelFlowArea
Flow area value of the channel.
Definition COBRA_EN.hxx:240
vector< vector< double > > fCOBRACoolantChannelDensity
Temporary Matrix containing COBRA coolant channels temperature f[X][Y] : X = COBRA channel numbering ...
Definition COBRA_EN.hxx:247
double fInletMassFlux
Average inlet mass flux (kg/m2/s) default = 3900 kg/m2/s.
Definition COBRA_EN.hxx:222
void Card30()
Generate and Write : Time Data.
Definition COBRA_EN_buildfile.cxx:621
void Card4()
Generate and Write : Axial Intervals.
Definition COBRA_EN_buildfile.cxx:166
void PrintNewTHData()
Print output files of new operating conditions.
Definition COBRA_EN_reader.cxx:420
void Card1()
Generate and Write : Run Identifier.
Definition COBRA_EN_buildfile.cxx:103
double fExitPressure
System exit pressure (MPa) default = 15.8 MPa.
Definition COBRA_EN.hxx:224
vector< vector< double > > fMUREFuelCellsTemp
Matrix containing MURE fuel cells temperature f[X][Y] : X = COBRA rod numbering ; Y = Levels steps (b...
Definition COBRA_EN.hxx:244
void MCZonesDataAverages()
Do an average on radial zones thermal data for each axial level (MURE simplified mesh)
Definition COBRA_EN_reader.cxx:283
vector< vector< double > > fCOBRAChannelsCenterYPos
Matrix containing channels center Y cartesian position.
Definition COBRA_EN.hxx:238
string fDirectory
MURE output directory.
Definition COBRA_EN.hxx:225
ifstream * fOutputFile
COBRA Output File.
Definition COBRA_EN.hxx:227
double fInletDensity
If necessary for plenum : inlet density linked with the temperature.
Definition COBRA_EN.hxx:221
void THDataCalculations()
Calculates values necessary to COBRA code.
Definition COBRA_EN_constructor.cxx:186
void AddSpacerGridsPos(double Pos)
Definition COBRA_EN.hxx:93
void Card12()
Generate and Write : Data for COBRA Fuel Heating Models.
Definition COBRA_EN_buildfile.cxx:363
void ExtractData()
Read the output file and store required data into matrix (temperatures, densities,...
Definition COBRA_EN_reader.cxx:60
double fOutletMeanDensity
Outlet mean density (used for plenum)
Definition COBRA_EN.hxx:251
vector< vector< double > > fPowerErr
Error on power deposit value for each radial and axial zones.
Definition COBRA_EN.hxx:232
void UpdateData()
Run routines to get and update all data.
Definition COBRA_EN_reader.cxx:39
void Card8()
Generate and Write : Rod To Subchannel Connection Data.
Definition COBRA_EN_buildfile.cxx:260
void Card3()
Generate and Write : General TH Parameters.
Definition COBRA_EN_buildfile.cxx:125
vector< vector< double > > fPower
Power deposit value for each radial and axial zones.
Definition COBRA_EN.hxx:231
static void ResetSigmaPhiBool()
Definition COBRA_EN.hxx:97
void MeshGridMC()
Create mesh grid correspondance between MURE and COBRA lattices.
Definition COBRA_EN_constructor.cxx:317
void SetSpacerGridsCoeff(double GridCoefficient)
Definition COBRA_EN.hxx:89
static bool fSigmaPhiUpdated
Check if the update of sigma phi is already done.
Definition COBRA_EN.hxx:213
vector< vector< double > > fMURECoolantCellsTemp
Matrix containing MURE coolant cells temperature f[X][Y] : X = COBRA rod numbering ; Y = Levels steps...
Definition COBRA_EN.hxx:246
void SetInletDensity(double D)
Definition COBRA_EN.hxx:112
void PrintData()
Print output files of geometry and power deposits.
Definition COBRA_EN_constructor.cxx:649
GenericReactorAssembly * fReactorAssembly
Definition COBRA_EN.hxx:212
vector< double > fChannelHeatedPerimeter
Heated perimeter value of the channel.
Definition COBRA_EN.hxx:242
vector< double > IdentifyRodsToSubChannelsConnexion(int RodNumber)
Calculate Rod to subchannel connection data.
Definition COBRA_EN_constructor.cxx:554
int fNumberOfSpacerGrids
Number of grids.
Definition COBRA_EN.hxx:228
virtual COBRA_EN * Clone()
Definition COBRA_EN.hxx:62
void Card20()
Generate and Write : Void Friction Model.
Definition COBRA_EN_buildfile.cxx:510
vector< vector< double > > fCOBRAChannelsRCXPos
Matrix containing channels top right corner X cartesian position.
Definition COBRA_EN.hxx:235
void Card29()
Generate and Write : Operating Conditions.
Definition COBRA_EN_buildfile.cxx:601
void BuildCOBRAFile()
Build COBRA input file and run COBRA.
Definition COBRA_EN_buildfile.cxx:37
virtual ~COBRA_EN()
Default destructor.
COBRA_EN()
Fictitious constructor ; just used for reset of static bool.
Definition COBRA_EN_constructor.cxx:72
void Card27()
Generate and Write : Convergence Parameters.
Definition COBRA_EN_buildfile.cxx:577
vector< ofstream * > fFiles
Output files.
Definition COBRA_EN.hxx:253
void SetUserHydraulicsModel()
Definition COBRA_EN.hxx:116
void Card36()
Generate and Write : Output Printing.
Definition COBRA_EN_buildfile.cxx:645
void Card22()
Generate and Write : Heat Transfer Model.
Definition COBRA_EN_buildfile.cxx:525
void CardComment(int N, string Comment)
Generate and Write comments of cards.
Definition COBRA_EN_buildfile.cxx:660
This abstract class is used to built a reactor assembly.
Definition GenericReactorAssembly.hxx:69
the namespace of the Standard C++

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024