dicoDesBlocs[FieldName] = SIMPFieldName
return BLOC(condition=laCondition, **dicoDesBlocs)
-#---------------------------------------------------------------------
-def prepareBlocParticleDynVarOld(condition, nomDuFact, nomDelaContante) :
-#---------------------------------------------------------------------
- dicoDesBlocs = {}
- dicoDuFact = {}
- dicoDuFact[nomDelaContante] = SIMP(typ=(dynamicVariableParticle,'createObject'), statut='o', defaut = nomDelaContante, homo='constant')
- monFact = FACT ( statut ='o',
- **dicoDuFact,
- blocSteadyState = BLOC(condition = 'SteadyState == True',
- blocFluidInSame = creeBlocPourLesFichiers('InSameFile == False', 'Position', ('Med', 'cgns' ), None),
- blocGivenPosition = BLOC(condition = 'OriginOfDynamicalVariables == "Given"',
- PositionFieldName = SIMP(typ='TXM',statut='o'),
- ),
- blocInteractionPosition = BLOC(condition = 'OriginOfDynamicalVariables == "Interaction"',
- InteractionName = SIMP(typ=interaction,statut='o'),
- Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Create and choose suitable interaction'),
- ),
- ),
- blocSimulatedPosition = prepareBlocInitialisation(condition = 'VariablesSimulation == True'),
- )
- dicoDesBlocs[nomDuFact] = monFact
- return BLOC(condition=condition,**dicoDesBlocs)
-
-
#---------------------------------------------------------------------
def prepareBlocAmbiantMediaField(condition, nomDuFact, nomDelaContante) :
#---------------------------------------------------------------------
Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Create and choose suitable interaction'),
),
),
- # blocConsigne = BLOC(condition = 'SteadyState == False',
- # Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet. Will ask for a range of calculation steps.'),
- # ), #BlocNotSteady
+ blocConsigne = BLOC(condition = 'SteadyState == False',
+ Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet. Will ask for a range of calculation steps.'),
+ ), #BlocNotSteady
FieldAppliesOnAllSpecies = SIMP(statut='o', typ=bool, defaut=True),
blocPorteEspece = BLOC(condition = 'FieldAppliesOnAllSpecies == False ',
AppliesToSpecies = SIMP(statut='o', typ=userParticle, max= '**', homo='SansOrdreNiDoublon'), # faire un typ = "espece"
#------------------------------------------------------
def prepareFactTurbulenceForParticule():
-#statut, ajout=None , position=None, positionChoice=None):
#------------------------------------------------------
listInto = ['Fully resolved (DNS)', 'Spatial filtering (LES)', 'One-point moment', 'One-point PDF']
return FACT(statut='o',
into=['Algebraic flux models','Turbulent diffusivity models', 'Scalar-flux transport equations']),
# Ce bloc consigne ne passe pas dans la projection XSD
# blocAlgebraic = BLOC(condition= "RANSModel == 'Algebraic flux models'",
- # blocConsigne = BLOC(condition= "RANSModel == 'Algebraic flux models'",
- # Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet'),
- # ), # fin blocAlgebraic
+ blocConsigne = BLOC(condition= "RANSModel == 'Algebraic flux models'",
+ Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet'),
+ ), # fin blocAlgebraic
blocTDM = BLOC(condition = "RANSModel == 'Turbulent diffusivity models'",
TDMChoice = SIMP(typ='TXM', statut='o', into=['SGDH', 'GGDH',]),
), # fin blocTDM
ConstraintsAndReducedStatisticalDescription = FACT(statut='o',
Constraint= FACT(statut='o',
- TypeOfConstraint = SIMP( typ='TXM', statut='o', into=['Quasi-static_methods','Brownian_dynamics','Presumed_transport','Time-marching_equilibrium','Time-marching non-equilibrium'],defaut=['Time-marching_non-equilibrium',], max ='**', position='reCalculeEtape', homo='SansOrdreNiDoublon'),
+ TypeOfConstraint = SIMP( typ='TXM', statut='o', into=['Quasi-static_methods','Brownian_dynamics','Presumed_transport','Time-marching_equilibrium','Time-marching_non-equilibrium'],defaut=['Time-marching_non-equilibrium',], max ='**', position='reCalculeEtape', homo='SansOrdreNiDoublon'),
),
),
)# fin du prepareBlocCps
def prepareParticles():
- return FACT(statut='o', max='**',
+ return FACT(statut='o', max='**',
ParticleNature = SIMP(statut='o', typ='TXM',
into=['Atom', 'Molecule', 'Dissipative Particle', 'Fluid Particle', 'Discrete Particle']),
- blocAtom = BLOC(condition='ParticleNature == "Atom"',
- ParticleName = SIMP(statut='o', typ=(userAtom,'createObject'),nomXML='ParticleName'),
+ blocAtomName = BLOC(condition='ParticleNature == "Atom"',
+ ParticleName = SIMP(statut='o', typ=(userAtom,'createObject') ),
InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
+ ),
+
+ blocMoleculeName = BLOC(condition='ParticleNature == "Molecule"',
+ ParticleName = SIMP(statut='o', typ=(userMolecule,'createObject')),
+ InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
+ ),
+
+ blocDissipativeName = BLOC(condition='ParticleNature == "Dissipative Particle"',
+ ParticleName = SIMP(statut='o', typ=(userDPD,'createObject')),
+ InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
+ ),
+
+ blocDiscreteName = BLOC(condition='ParticleNature == "Discrete Particle"',
+ ParticleName = SIMP(statut='o', typ=(userDiscrete,'createObject')),
+ InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
+ ),
+
+ blocAtom = BLOC(condition='ParticleNature == "Atom"',
ChemicalSpecies = SIMP(statut='o', typ='TXM'),
ElectricCharge = SIMP(statut='f', typ='R'),
MagneticMoment = SIMP(statut='f', typ='R'),
), # fin b_Atom
# --------------- Molecules ------------------
blocMolecule = BLOC(condition='ParticleNature == "Molecule"',
- ParticleName = SIMP(statut='o', typ=(userMolecule,'createObject'),nomXML='ParticleName'),
- InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
Shape = SIMP(statut='o', typ='TXM', into=['Linear', 'Trigonal Planar', 'Angular', 'Tetrahedral', 'Octahedral', 'Trigonal pyramid', 'Other']),
- Size = SIMP(statut='f', typ='R'), # relevant ?
ElectricCharge = SIMP(statut='f', typ='R'),
MagneticMoment = SIMP(statut='f', typ='R'),
+ Size = SIMP(statut='f', typ='R'), # relevant ?
), #fin b_Molecule
# --------------- Dissipative ------------------
blocDissipative = BLOC(condition='ParticleNature == "Dissipative Particle"',
- ParticleName = SIMP(statut='o', typ=(userDPD,'createObject'),nomXML='ParticleName'),
- InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
- #BondedParticles = SIMP(statut="o", typ=bool, defaut=False),
- ), # b_Dissipative
+ BondedParticles = SIMP(statut="o", typ=bool, defaut=False),
+ ), # b_Dissipative
# --------------- Discrete Particle ------------------
blocDiscrete = BLOC(condition='ParticleNature == "Discrete Particle"',
- ParticleName = SIMP(statut='o', typ=(userDiscrete,'createObject'),nomXML='ParticleName'),
- InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0),
TypeOfDiscreteParticle = SIMP(statut='o', typ='TXM', into=['Solid', 'Droplets', 'Bubbles','Bio Organism'],),
blocTypeDPSolid = BLOC(condition ='TypeOfDiscreteParticle == "Solid"',
- PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], position = 'global'),
- b_SolidPrimary = BLOC(condition='PrimaryOrAggregate == "Primary Particle"',
- ),
+ #PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], position = 'global'),
+ PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], ),
+# b_SolidPrimary = BLOC(condition='PrimaryOrAggregate == "Primary Particle"',
+# ),
b_SolidAggregate = BLOC(condition='PrimaryOrAggregate == "Assemblage / Aggregate"',
Morphology = FACT (statut ='o',
NumberOfPrimaryParticles = SIMP(statut='o', typ='I', val_min=0),
),
# --------------- Bio Organism ------------------
blocTypeBioSolid = BLOC(condition='TypeOfDiscreteParticle == "Bio Organism"',
- #ParticleName = SIMP(statut='o', typ=(userBioSolid,'createObject'),),
TypeOfOrganism = SIMP(statut='o', typ='TXM', into=['Unicellular', 'Multicellular']),
blocUnicellular = BLOC(condition ='TypeOfOrganism=="Unicellular"',
Unicellular = SIMP(statut='o', typ='TXM', into=["Bactaria"], defaut='Bactaria')
),
), # Properties
), # b_Discrete
- ) # fin Particle
+ ) # fin Particle
#---------------------------------
def prepareContactPhenomena():
return FACT(statut='o', max= "**",
withContactPhenomena = SIMP(statut='o', typ=bool, defaut=False),
bwithContact = BLOC(condition = 'withContactPhenomena == True',
- ŁevelOfDescription = SIMP(statut='o', typ='TXM', into=[ 'Microscopic', 'Macroscopic']),
+ LevelOfDescription = SIMP(statut='o', typ='TXM', into=[ 'Microscopic', 'Macroscopic']),
bMicroscopic = BLOC(condition = 'LevelOfDescription == "Microscopic"',
DescriptionOfContact = SIMP(statut='o', typ='TXM', into=[ 'Contact distance (cutoff)', 'Contact force']),
),
# REM : L'existence des mc TVMChoice et RSMChoice est exclusive, du coup une évaluation de condition
# qui contient les deux renvoie forcément une exception, le bloc n'est alors pas evalué
# sauf si le mc de la première condition existe (ordre évaluation du or)
+ # blocTurbulenceTWMChoice2 = BLOC(condition = 'TVMChoice == "K-Epsilon" or RSMChoice != None',
+ # blocTurbulenceTWMChoice2 = BLOC(condition = '(RSMChoice != None) or (TVMChoice == "K-Epsilon")',
+ # blocTurbulenceTWMChoice2 = BLOC(condition = 'TVMChoice == "K-Epsilon"',
blocTurbulenceTWMChoice2 = BLOC(condition = 'RANSModel == "Reynolds Stress Model (RSM)" or TVMChoice == "K-Epsilon"',
EpsilonDefinition = FACT(statut ='o',
Name = SIMP(typ=(scalar,'createObject'), statut='o', defaut ='Epsilon', homo='constant'),
),
), # blocTurbulenceTWMChoice3
+ # blocTurbulenceRSMChoice1 = BLOC(condition = "(RANSModel == 'Reynolds Stress Model (RSM)') and (RSMChoice !=None)",
blocTurbulenceRSMChoice1 = BLOC(condition = "RSMChoice !=None",
RijDefinition = FACT(statut ='o',
Name = SIMP(typ=(scalar,'createObject'), statut='o', defaut ='Rij', homo='constant'),
#-----------------------------------------------------#
def prepareBoundaryCondition():
- return FACT(statut='o',max = '**',
- BCFluide = BLOC ( condition = 'SystemType == "Continuum system"',
+#-----------------------------------------------------#
+# on en fait 1 bloc seul pour CS and CPS
+# pour pas de souci dans la projection XSD
+ return FACT(statut='o',max = '**', # max = nb de facette de bord
TypeOfBoundaryCondition = SIMP(statut='o', typ='TXM', into=['Inlet', 'Outlet', 'Symmetry','Periodicity', 'Wall', 'Free Surface'], ),
- ApplyOnGroups = SIMP(statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon', nomXML='ApplyOnGroups',
- filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ',
- ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueContinuum").getChild("NumericalModel")'), )
+
+ blocDesigneMesh = BLOC(condition = "SystemType == 'Continuum system'",
+ ApplyOnGroups = SIMP(statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon',
+ filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ',
+ ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueContinuum").getChild("NumericalModel")'), )
+ ),
),
- ),
- blocOnStateVariable = BLOC(condition = "TypeOfBoundaryCondition not in ['Wall', 'Outlet']",
- ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon',nomXML='ApplyOnGroups',
+ ),
+ blocDesigne_Shape = BLOC(condition = "SystemType == 'Classical particle system'",
+ #ApplyOnGroups = SIMP (statut ='o', typ=spatialRegion, max='**'
+ ApplyOnGroups = SIMP (statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon',
+ filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ',
+ ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueClassical").getChild("NumericalModel")'), )
+ ),
+ ),
+ ),
+
+
+ blocOnStateVariable = BLOC(condition = "(TypeOfBoundaryCondition in ['Inlet', 'Symmetry','Periodicity', 'Free Surface'] and SystemType == 'Continuum system') or (SystemType == 'Classical particle system' and TypeOfBoundaryCondition not in ['Outlet','Inlet'])" ,
+ ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon',
filtre=( 'etape in set(self.getEtapes()) ', (('etape', None),), ), #Il ne faut pas proposer les variables d'état des autres composants.
- ), #PNPN A FAIRE : fenetreIhm='menuDeroulant'
+ ), #PNPN A FAIRE : fenetreIhm='menuDeroulant'
),
+
blocPeriodique = BLOC(condition = "TypeOfBoundaryCondition == 'Periodicity'",
Direction = SIMP(statut='o', typ='TXM', into=['X','Y','Z', 'XYZ']),
), # b_periodique
- blocInlet = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet'",
- FormulationOfBoundary= SIMP(statut='o', typ='TXM', into=['Dirichlet','Neumann','Cauchy']),
- blocDirichlet = BLOC(condition = 'FormulationOfBoundary == "Dirichlet"',
- regles=(AU_MOINS_UN('InletProfile','IntegratedValue','IntegratedVectorValue',),
+
+ blocInlet1 = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet' and SystemType == 'Continuum system'",
+ FormulationOfBoundary= SIMP(statut='o', typ='TXM', into=['Dirichlet','Neumann','Cauchy']),
+ blocDirichlet = BLOC(condition = 'FormulationOfBoundary == "Dirichlet"',
+ regles=(AU_MOINS_UN('InletProfile','IntegratedValue','IntegratedVectorValue',),
EXCLUS ('InletProfile','IntegratedValue','IntegratedVectorValue',), ),
- Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Choose between InletProfile,IntegratedValue,IntegratedVectorValue "),
- InletProfile = SIMP (statut ='f', typ='TXM'),
- IntegratedValue = SIMP (statut='f', typ='R'),
- IntegratedVectorValue = FACT(statut='f',
- U = SIMP (statut ='o', typ='R'),
- V = SIMP (statut ='o', typ='R'),
- W = SIMP (statut ='o', typ='R'),
- ),
- #PN : faire une regle
- ),
- blocNeumann = BLOC(condition = 'FormulationOfBoundary == "Neumann"',
+ Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Choose between InletProfile,IntegratedValue,IntegratedVectorValue "),
+ InletProfile = SIMP (statut ='f', typ='TXM'),
+ IntegratedValue = SIMP (statut='f', typ='R'),
+ IntegratedVectorValue = FACT(statut='f',
+ U = SIMP (statut ='o', typ='R'),
+ V = SIMP (statut ='o', typ='R'),
+ W = SIMP (statut ='o', typ='R'),
+ ),
+ ),# fin Dirichlet
+ blocNeumann = BLOC(condition = 'FormulationOfBoundary == "Neumann"',
FluxFile = SIMP (statut ='o', typ=('Fichier', " ;;All Files (*)"),)
- ),
- blocCauchy = BLOC(condition = 'FormulationOfBoundary == "Cauchy"',
+ ),
+ blocCauchy = BLOC(condition = 'FormulationOfBoundary == "Cauchy"',
ImposedFlux = SIMP (statut ='o', typ='TXM'),
_IntegratedValue = SIMP (statut='o', typ='R'),
),
- ), # b_inlet
- blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall'",
+ ), # b_inlet1
+ blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall' and SystemType == 'Continuum system'",
VelocityAtBoundary = FACT(statut='o',
SlipVelocity = SIMP(statut='o', typ='R', defaut= 0.0),
WallMotion = FACT(statut='o',
),
),
LevelOfDescription = FACT(statut='o',
- blocWall = BLOC(condition = "FlowNature == 'Turbulent'", ##JP+CH TODO : Choix des lois en fct du type du TurbulenceModelingType
+ blocWallInside = BLOC(condition = "FlowNature == 'Turbulent'", ##JP+CH TODO : Choix des lois en fct du type du TurbulenceModelingType
WallFunction = SIMP(statut ='o', typ='TXM',
into=['No wall function','1-scale model (Log law)',
'2-scale model (Log law)','Scalable 2-scale model (Log law)',
),
),
), # b_Wall
- ), # FinBCfuid
- blocBDCpS = BLOC(condition = "SystemType == 'Classical particle system'",
- TypeOfBoundaryCondition = SIMP(statut='o', typ='TXM', into=['Inlet', 'Outlet', 'Symmetry','Periodicity', 'Wall', 'Free Surface'], ),
- ApplyOnShape = SIMP(statut ='o', typ=spatialRegion, max='**', homo='SansOrdreNiDoublon', nomXML='ApplyOnShape',
- #ApplyOnGroups = SIMP(statut ='o', typ=spatialRegion, max='**', homo='SansOrdreNiDoublon',nomXML='ApplyOnGroups',
-#PN a faire le filtre correctement
- #filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ',
- # ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueClassical").getChild("NumericalModel")'), )
- # ),
- ),
-
- blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall'",
+ blocWall2 = BLOC(condition = "TypeOfBoundaryCondition == 'Wall' and SystemType == 'Classical particle system'",
ChoiceOfParticleWallInteraction = SIMP(statut='o', typ = wallInteractionId)
), # b_Wall
- blocOnStateVariable = BLOC(condition = "TypeOfBoundaryCondition not in ['Outlet','Inlet']",
- ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon',
- filtre=( 'etape in set(self.getEtapes()) ', (('etape', None),), ), #Il ne faut pas proposer les variables d'état des autres composants.
- ), #PNPN A FAIRE : fenetreIhm='menuDeroulant'
- ),
-
- blocPeriodique = BLOC(condition = "TypeOfBoundaryCondition == 'Periodicity'",
- Direction = SIMP(statut='o', typ='TXM', into=['X','Y','Z', 'XYZ']),
- ), # b_periodique
-
- blocInlet = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet'",
+ blocInlet2 = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet' and SystemType == 'Classical particle system'",
NumberOfParticleInjected = SIMP(statut='o', typ = 'I', val_min = 1),
InjectionEveryNTimeSteps = SIMP(statut='o', typ = 'I', val_min = 0),
DiameterOfParticleInjected = SIMP(statut='o', typ = 'R', val_min = 0),
),
),
),# blocNoBrownianDynamics
- ), # b_inlet
- ), # Boundary_Conditions
-)
+ ), # bInlet2
+ ) # Boundary_Conditions
blocModeleNumeriqueQuantum = prepareBlocSystemType('Quantum system'),
blocModeleNumeriqueClassical = prepareBlocSystemType('Classical particle system'),
blocModeleNumeriqueContinuum = prepareBlocSystemType('Continuum system'),
+
# Exemple de reecriture d'un BLOC_XOR pour eviter la generation d'un type xsd double
# BCFluide = BLOC ( condition = 'SystemType == "Continuum system"',
# BoundaryConditions = FACT(statut = 'o',
# ),
# ),
BoundaryConditions = FACT(statut = 'o',
- BoundaryCondition = prepareBoundaryCondition(),
+ BoundaryCondition = prepareBoundaryCondition(),
),
)