from Accas import OPER, BLOC, FACT, SIMP, ASSD, JDC_CATA, Matrice, Tuple, AU_MOINS_UN, A_VALIDATOR, PROC
from Noyau.N_VALIDATOR import Valid
-#
+# sert a activer les options d incertitude dans eficas
+# et a changer le convert en convertUQ
avecIncertitude=True
#
-dictUQ = {'initial_power' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
+dictUQ = {'initial_power' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}, {'UserDefined' :{}}),
'initial_core_inlet_temperature' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
- #'initial_boron_concentration' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
- #'initial_inlet_pressure' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
- #'initial_outlet_pressure' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
- #'assembly_width' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
+ 'initial_boron_concentration' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
+ 'initial_inlet_pressure' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
+ 'initial_outlet_pressure' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
+ 'assembly_width' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}),
# modifier la partie Accas pour garder une reference a l objet nomme
}
-listeDesSortiesPossibles = ("Average_mass_flux", "Boiling_power_fraction", "Boron_concentration", "Enthalpy", "Fuel_power_fraction", "Fuel_temperature", "Kinetic_reactivity", "Liquid_power", "Mass_flux", "Mass_fraction", "Mass_title", "Mixture_density", "Mixture_specific_enthalpy", "Mixture_temperature", "Neutronic_power", "Outlet_pressure", "Pollutant_concentration", "Pressure ", "Rowlands_fuel_effective_temp", "Thermal_power", "Water_density", "Water_temperature", "Power_level" )
+#listeDesSortiesPossibles = ("Average_mass_flux", "Boiling_power_fraction", "Boron_concentration", "Enthalpy", "Fuel_power_fraction", "Fuel_temperature", "Kinetic_reactivity", "Liquid_power", "Mass_flux", "Mass_fraction", "Mass_title", "Mixture_density", "Mixture_specific_enthalpy", "Mixture_temperature", "Neutronic_power", "Outlet_pressure", "Pollutant_concentration", "Pressure ", "Rowlands_fuel_effective_temp", "Thermal_power", "Water_density", "Water_temperature", "Power_level" )
+listeDesSortiesNeutro = ( "Boron_concentration", "Kinetic_reactivity", "Neutronic_power", )
+listeDesSortiesTherm = ("Average_mass_flux", "Boiling_power_fraction", "Enthalpy", "Fuel_temperature", "Liquid_power", "Mass_flux", "Mass_fraction", "Mass_title", "Mixture_density", "Mixture_specific_enthalpy", "Mixture_temperature", "Outlet_pressure", "Pollutant_concentration", "Pressure ", "Rowlands_fuel_effective_temp", "Thermal_power", "Water_density", "Water_temperature", )
+dicoDesSortiesPossibles={'Neutro':listeDesSortiesNeutro,'Thermo':listeDesSortiesTherm}
+#dicoDesSortiesPossibles={'Neutro':listeDesSortiesNeutro}
from cata_UQ import creeOperExpressionIncertitude
-ExpressionIncertitude=creeOperExpressionIncertitude(dictUQ, listeDesSortiesPossibles)
+ExpressionIncertitude=creeOperExpressionIncertitude(dictUQ, dicoDesSortiesPossibles)
if autonome :
from Accas import *
JdC = JDC_CATA(code="UQ");
- ExpressionIncertitude = creeOperExpressionIncertitude(dictUQ, listeDesSortiesPossibles);
+ ExpressionIncertitude = creeOperExpressionIncertitude(dictUQ, dicoDesSortiesPossibles);
#
#
-def affineDistribution(monDico,var,loi):
- nomLoi=list(monDico[var].keys())[0]
+def affineDistribution(monDicoVarDeter,var,loi):
+ nomLoi=list(monDicoVarDeter[var].keys())[0]
argsLoi=loi[nomLoi]
nomFonction='cree'+nomLoi
maFonction=globals()[nomFonction]
bloc=maFonction(**argsLoi)
-def creeDistributionsSelonVariable(monDico):
+def creeDistributionsSelonVariable(monDicoVarDeter):
lesBlocs={}
- for var in monDico :
- listeLoisComplete=monDico[var]
+ for var in monDicoVarDeter :
+ listeLoisComplete=monDicoVarDeter[var]
listeChoix=[]
for loi in listeLoisComplete:
nomLoi=list(loi.keys())[0]
return lesBlocs
+def creeOutput(monDicoVarSortie):
+ intoVariable=list(monDicoVarSortie.keys())
+ if len(intoVariable) == 1 :
+ listeDesVariablesSortiePossibles = monDicoVarSortie[list(monDicoVarSortie.keys())[0]]
+ output = FACT (max=1, statut ='o',
+ VariableDeSortie = FACT ( max='**', statut ='o',
+ Physique = SIMP (statut = "o", typ = "TXM",into = intoVariable,defaut=intoVariable[0]),
+ NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = listeDesVariablesSortiePossibles),
+ FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'),defaut=('Max'), max='**', homo='SansOrdreNiDoublon'),
+ Unit = SIMP ( statut = "f", typ = "TXM", fr = "Unite", ang = "Unit",),
+ Format = SIMP ( statut = "f", typ = "TXM", fr = "Format de sortie", ang = "format", into =['med', 'csv']),
+ ),
+ )
+ return output
+ else :
+ lesBlocs={}
+ Physique = SIMP (statut = "o", typ = "TXM",into = intoVariable,defaut=intoVariable[0])
+ for phys in intoVariable :
+ laCondition ="Physique == '" + phys + "'"
+ NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = monDicoVarSortie[phys], )
+ nomBloc = 'b_physique_' + phys
+ lesBlocs[nomBloc] = BLOC (condition=laCondition, NomDeLaVariable = NomDeLaVariable)
+ FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'),defaut=('Max'), max='**', homo='SansOrdreNiDoublon')
+ Unit = SIMP ( statut = "f", typ = "TXM", fr = "Unite", ang = "Unit",)
+ Format = SIMP ( statut = "f", typ = "TXM", fr = "Format de sortie", ang = "format", into =['med', 'csv'])
+ VariableDeSortie = FACT ( max='**', statut ='o', Physique=Physique, **lesBlocs, FonctionDAggregation=FonctionDAggregation, Unit=Unit,Format=Format)
+ output = FACT (max=1, statut ='o', VariableDeSortie=VariableDeSortie)
+ return output
+
+
+
-def creeOperExpressionIncertitude(monDico, maListe):
- listeDesVariablesPossibles = list(monDico.keys())
- listeDesVariablesSortiePossibles = maListe
+def creeOperExpressionIncertitude(monDicoVarDeter, monDicoVarSortie):
+ listeDesVariablesPossibles = list(monDicoVarDeter.keys())
+ monOutput = creeOutput(monDicoVarSortie)
modelVariable = SIMP ( statut = "o",
typ = ( 'TXM'),
fr = "Variable d'entrée du modèle",
)
laConsigne = SIMP(statut="o", homo="information", typ="TXM", defaut=' ')
xPathVariable = SIMP(statut='d', typ='TXM', defaut=(), max='**', min=0,)
- blocs=creeDistributionsSelonVariable(monDico)
+ blocs=creeDistributionsSelonVariable(monDicoVarDeter)
# Attention
# l ordre des motclefs en 3.7 a l air de dépendre de l ordre de creation des objets
# et non d un dict ordonné. on retombe toujours sur ce pb
Methode = SIMP( statut = "o", typ = "TXM", max=1, into = ('SRS', 'Sobol'), defaut='Sobol'),
), # fin UraniePropagation
), # fin Propagation
- Output = FACT (max=1, statut ='o',
- VariableDeSortie = FACT ( max='**', statut ='o',
- NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = listeDesVariablesSortiePossibles, defaut='Average_mass_flux'),
- Physique = SIMP (statut = "o", typ = "TXM",into = ('Neutronics', 'ThermoHydraulics'),defaut='Neutronics'),
- FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'),defaut=('Max'), max='**', homo='SansOrdreNiDoublon'),
- Unit = SIMP ( statut = "f", typ = "TXM", fr = "Unite", ang = "Unit",),
- Format = SIMP ( statut = "f", typ = "TXM", fr = "Format de sortie", ang = "format", into =['med', 'csv']),
- ),
- ),
+ Output=monOutput,
Execution = FACT (max=1, statut ='o',
bloc_OT = BLOC (condition = 'UncertaintyTool == "OpenTurns"',
ExecutionMode = SIMP ( statut = "o", typ = "TXM", into = ['local', 'cluster']),