From: pascale.noyret Date: Thu, 4 Oct 2018 16:41:30 +0000 (+0200) Subject: version Vimmp pour demo Bremen X-Git-Tag: avantMenage~72 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4720763fee5d17042732948003b151a7e29c8944;p=tools%2Feficas.git version Vimmp pour demo Bremen --- diff --git a/Vimmp/LBM/LBM2MED.py b/Vimmp/LBM/LBM2MED.py new file mode 100644 index 00000000..eba16966 --- /dev/null +++ b/Vimmp/LBM/LBM2MED.py @@ -0,0 +1,80 @@ +from numpy import * +from numpy.linalg import * +import MEDCoupling as mc +import MEDLoader as ml +from MEDCouplingRemapper import MEDCouplingRemapper + +def run_LBM(maxIter,nx,ny): +###### Flow definition ######################################################### + Re = 220.0 # Reynolds number. + ly=ny-1.0; q = 9 # Lattice dimensions and populations. + cx = nx/4; cy=ny/2; r=ny/9; # Coordinates of the cylinder. + uLB = 0.04 # Velocity in lattice units. + nulb = uLB*r/Re; omega = 1.0 / (3.*nulb+0.5); # Relaxation parameter. + +###### Lattice Constants ####################################################### + c = array([(x,y) for x in [0,-1,1] for y in [0,-1,1]]) # Lattice velocities. + t = 1./36. * ones(q) # Lattice weights. + t[asarray([norm(ci)<1.1 for ci in c])] = 1./9.; t[0] = 4./9. + noslip = [c.tolist().index((-c[i]).tolist()) for i in range(q)] + i1 = arange(q)[asarray([ci[0]<0 for ci in c])] # Unknown on right wall. + i2 = arange(q)[asarray([ci[0]==0 for ci in c])] # Vertical middle. + i3 = arange(q)[asarray([ci[0]>0 for ci in c])] # Unknown on left wall. + +###### Function Definitions #################################################### + sumpop = lambda fin: sum(fin,axis=0) # Helper function for density computation. + def equilibrium(rho,u): # Equilibrium distribution function. + cu = 3.0 * dot(c,u.transpose(1,0,2)) + usqr = 3./2.*(u[0]**2+u[1]**2) + feq = zeros((q,nx,ny)) + for i in range(q): feq[i,:,:] = rho*t[i]*(1.+cu[i]+0.5*cu[i]**2-usqr) + return feq + +###### Setup: cylindrical obstacle and velocity inlet with perturbation ######## + obstacle = fromfunction(lambda x,y: (x-cx)**2+(y-cy)**2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100000 + + + 260 + + + 90 + + + DataIn1 PyScript0 + + DataIn1 maxIter + PyScript0 maxIter + + + DataIn1 nx + PyScript0 nx + + + DataIn1 ny + PyScript0 ny + + + + + diff --git a/Vimmp/Models/CFD.py b/Vimmp/Models/CFD.py new file mode 100644 index 00000000..8c4ea096 --- /dev/null +++ b/Vimmp/Models/CFD.py @@ -0,0 +1,48 @@ +from Accas import * + +def Physical_Parameters_LBM(): + return FACT( statut='o', + rho = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + + Rheo_Type = SIMP(statut='o',typ='TXM', into=('Newtonian', 'Carreau-Yasuda',), defaut='Newtonian'), + + Rheo_Newt = BLOC(condition = 'Rheo_Type == "Newtonian"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=1.0,val_min=0.0), + ), + + Rheo_Visco = BLOC(condition = 'Rheo_Type == "Carreau-Yasuda"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + ViscInf = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + Tau = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + n = SIMP(statut = "o", typ = 'R', defaut=0.3, val_min=0.0), + a = SIMP(statut = "o", typ = 'R', defaut=0.5, val_min=0.0), + ), + ) + +def Param_Num_LBM(): + return FACT( statut='o', + dt = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + nb_iter = SIMP(statut = "o", typ = 'I', defaut=1, val_min=1), + ) + +def Output_Files_LBM() : + return FACT( statut='o', + + File_Format = SIMP(statut='o',typ='TXM', into=('Med', 'Other',), defaut='Med'), + + Mesh_Med = BLOC(condition = 'File_Format == "Med"', + File_Name = SIMP (statut="o", + typ=("FichierNoAbs",'MED Files (*.med)',), + ang="Name of the mesh file in Med format", + ), + ), + + Mesh_Other = BLOC(condition = 'File_Format == "Other"', + File_Name = SIMP (statut="o", + typ=("FichierNoAbs",), + ang="Name of the mesh file in other format", + ), + ), + + ) + diff --git a/Vimmp/Models/DPM.py b/Vimmp/Models/DPM.py new file mode 100644 index 00000000..5c5c0ae0 --- /dev/null +++ b/Vimmp/Models/DPM.py @@ -0,0 +1,8 @@ +from Accas import * + +def Numerical_Parameters_DPM(): + return FACT( statut='o', + nb_particle = SIMP(statut = "o", typ = 'I', defaut=1000, val_min=1), + dt = SIMP(statut = "o", typ = 'R', defaut=0.1, val_min=0.0), + nb_iter = SIMP(statut = "o", typ = 'I', defaut=10, val_min=1), + ) diff --git a/Vimmp/Models/LBM.py b/Vimmp/Models/LBM.py new file mode 100644 index 00000000..6371f9ae --- /dev/null +++ b/Vimmp/Models/LBM.py @@ -0,0 +1,47 @@ +from Accas import * + +def Physical_Parameters_LBM(): + return FACT( statut='o', + rho = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + + Rheo_Type = SIMP(statut='o',typ='TXM', into=('Newtonian', 'Carreau-Yasuda',), defaut='Newtonian'), + + Rheo_Newt = BLOC(condition = 'Rheo_Type == "Newtonian"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=1.0,val_min=0.0), + ), + + Rheo_Visco = BLOC(condition = 'Rheo_Type == "Carreau-Yasuda"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + ViscInf = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + Tau = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + n = SIMP(statut = "o", typ = 'R', defaut=0.3, val_min=0.0), + a = SIMP(statut = "o", typ = 'R', defaut=0.5, val_min=0.0), + ), + ) + +def Discretization_LBM(): + return FACT( statut='o', + nx = SIMP(statut = "o", typ = 'I', defaut=30, val_min=1), + ny = SIMP(statut = "o", typ = 'I', defaut=10, val_min=1), + max_iter = SIMP(statut = "o", typ = 'I', defaut=1, val_min=1), + ) + +def Output_Files_LBM() : + return FACT( statut='o', + + File_Format = SIMP(statut='o',typ='TXM', into=('Med', 'Other',), defaut='Med'), + Mesh_Med = BLOC(condition = 'File_Format == "Med"', + File_Name = SIMP (statut="o", + typ="FichierNoAbs", + ang="Name of the mesh file in Med format", + ), + ), + Mesh_Other = BLOC(condition = 'File_Format == "Other"', + File_name = SIMP (statut="o", + typ="FichierNoAbs", + ang="Name of the mesh file in other format", + ), + ), + + ) + diff --git a/Vimmp/Models/OtherCFD.py b/Vimmp/Models/OtherCFD.py new file mode 100644 index 00000000..6301f5a8 --- /dev/null +++ b/Vimmp/Models/OtherCFD.py @@ -0,0 +1,55 @@ +from Accas import * + +def Physical_Parameters_OtherCFD(): + return FACT( statut='o', + rho = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + + Rheo_Type = SIMP(statut='o',typ='TXM', into=('Newtonian', 'Carreau-Yasuda',), defaut='Newtonian'), + + Rheo_Newt = BLOC(condition = 'Rheo_Type == "Newtonian"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=0.5,val_min=0.0), + ), + + Rheo_Visco = BLOC(condition = 'Rheo_Type == "Carreau-Yasuda"', + Visc0 = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + ViscInf = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + Tau = SIMP(statut = "o", typ = 'R', defaut=10.0, val_min=0.0), + n = SIMP(statut = "o", typ = 'R', defaut=0.3, val_min=0.0), + a = SIMP(statut = "o", typ = 'R', defaut=0.5, val_min=0.0), + ), + ) + +def Param_Num_OtherCFD(): + return FACT( statut='o', + dt = SIMP(statut = "o", typ = 'R', defaut=1.0, val_min=0.0), + number_of_time_step = SIMP(statut = "o", typ = 'I', defaut=1, val_min=1), + ) + +def Input_Files_OtherCFD() : + return FACT( statut='o', + + File_Format = SIMP(statut='o',typ='TXM', into=('Med', 'Iges' 'Other',), defaut='Iges'), + + Mesh_Med = BLOC(condition = 'File_Format == "Med"', + File_Name = SIMP (statut="o", + typ=("FichierNoAbs",'MED Files (*.med)',), + ang="Name of the mesh file in Med format", + ), + ), + Mesh_Iges = BLOC(condition = 'File_Format == "Iges"', + File_Name = SIMP (statut="o", + typ=("FichierNoAbs",'MED Files (*.igs)',), + ang="Name of the mesh file in iges format", + ), + ), + + + Mesh_Other = BLOC(condition = 'File_Format == "Other"', + File_Name = SIMP (statut="o", + typ=("FichierNoAbs",), + ang="Name of the mesh file in other format", + ), + ), + + ) + diff --git a/Vimmp/Models/__init__.py b/Vimmp/Models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Vimmp/cata_lbm.py b/Vimmp/cata_lbm.py new file mode 100644 index 00000000..1510cb0e --- /dev/null +++ b/Vimmp/cata_lbm.py @@ -0,0 +1,36 @@ +# Copyright (C) 2008-2018 EDF R&D +# +# This file is part of SALOME ADAO module +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +import os, re +import Accas +from Accas import * +from Models.LBM import Physical_Parameters_LBM, Discretization_LBM, Output_Files_LBM + +JdC = JDC_CATA ( code = 'LBM',) + +VERSION_CATALOGUE='V_0' + +LBM_Param = PROC(nom = 'LBM_Param', + Physical_Param=Physical_Parameters_LBM(), + Discretization=Discretization_LBM(), + Output_Files =Output_Files_LBM(), +) +TEXTE_NEW_JDC = 'LBM_Param()' + + diff --git a/Vimmp/cata_lbm_genere.xsd b/Vimmp/cata_lbm_genere.xsd new file mode 100644 index 00000000..8e171acc --- /dev/null +++ b/Vimmp/cata_lbm_genere.xsd @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Vimmp/cata_vimmp.py b/Vimmp/cata_vimmp.py new file mode 100644 index 00000000..6e732fc5 --- /dev/null +++ b/Vimmp/cata_vimmp.py @@ -0,0 +1,64 @@ +# Copyright (C) 2008-2018 EDF R&D +# +# This file is part of SALOME ADAO module +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +import os, re +import Accas +from Accas import * +from Models.LBM import Physical_Parameters_LBM, Discretization_LBM, Output_Files_LBM + +JdC = JDC_CATA ( code = 'Map2',) + +VERSION_CATALOGUE='V_0' + +def getCfdInstance(): + return ('Code_Saturne - UoM','OpenFOAM - POLITO', 'LBM' ) + +def getRhInstance(): + return ('TFEM - UniNa','OpenFOAM - IBM-UK') + +def getSurfTensInstance(): + return ('GROMACS - UoM','LAMMPS - ICPF', ) + +def getDPDInstance(): + return ('DPM','DPM1', ) + +case = PROC(nom = 'case', + + usecase = SIMP(statut='o', typ='TXM', into=['Emulsion','Surfactant Mesophases','nano powder dispersion']), + + b_Emulsion = BLOC(condition="usecase == 'Emulsion'", + workflow = SIMP(statut='o', typ='TXM', into=['Dilute emulsion /suspension','Concentrated emulsions']), + b_Dilute_emulsion = BLOC(condition="workflow == 'Dilute emulsion /suspension'", + Dilute_emulsion = FACT( statut = 'o', + cfd = SIMP(statut='o', typ='TXM', into=getCfdInstance()), + # b_lbm = BLOC(condition="cfd=='LBM'", + # Physical_Param_LBM=Physical_Parameters_LBM(), + # Numerical_Param_LBM=Discretization_LBM(), + # Output_Files_LBM =Output_Files_LBM(), + # ), + rh = SIMP(statut='o', typ='TXM', into=getRhInstance()), + surfTens = SIMP(statut='o', typ='TXM', into=getSurfTensInstance()), + ), # FIn Dilute_emulsion + ), + ), +) + +TEXTE_NEW_JDC = 'case()' + + diff --git a/Vimmp/cata_vimmp_genere.xsd b/Vimmp/cata_vimmp_genere.xsd new file mode 100644 index 00000000..67812860 --- /dev/null +++ b/Vimmp/cata_vimmp_genere.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Vimmp/configuration_Vimmp.py b/Vimmp/configuration_Vimmp.py new file mode 100644 index 00000000..6a8cc458 --- /dev/null +++ b/Vimmp/configuration_Vimmp.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# maConfiguration MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +from InterfaceQT4 import configuration +import os + + +class CONFIG(configuration.configBase): + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + self.labels_user=['catalogues','lang'] + self.labels_eficas=['lang','rep_cata','catalogues'] + self.afficheOptionnelVide=True + configuration.configBase.__init__(self,appli,repIni) + + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/Vimmp/prefs.py b/Vimmp/prefs.py new file mode 100644 index 00000000..8567802b --- /dev/null +++ b/Vimmp/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +code="Vimmp" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/Vimmp/prefs_Vimmp.py b/Vimmp/prefs_Vimmp.py new file mode 100644 index 00000000..492ad1c9 --- /dev/null +++ b/Vimmp/prefs_Vimmp.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# maConfiguration MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os,sys +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='fr' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +# +#typeDeCata='XML' +catalogues=( +# ('Map2','V2017PY',os.path.join(repIni,'cata_map.py'),'python','python'), +# ('Map2','V2017',os.path.join(repIni,'cata_map.py'),'xml','xml'), + ('Vimmp','LBM',os.path.join(repIni,'cata_lbm.py'),'python','python'), + ('Vimmp','VIMP',os.path.join(repIni,'cata_vimmp.py'),'python','python'), +# ('Map2','V2017',os.path.join(repIni,'cata_bloc.py'),'xml','xml'), +# ('Map2','V2017',os.path.join(repIni,'cata_map_reduit.py'),'python','python'), +) +#nombreDeBoutonParLigne=4 +simpleClic=True +#closeFrameRechercheCommande=True +boutonDsMenuBar=False +#closeArbre=True +afficheListesPliees=False +#withXSD=True +afficheCommandesPliees = False +dumpXSD=True +#afficheIhm=False diff --git a/Vimmp/qtEficasVimmp.py b/Vimmp/qtEficasVimmp.py new file mode 100755 index 00000000..91140d97 --- /dev/null +++ b/Vimmp/qtEficasVimmp.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS configure pour MAP +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import sys +reload(sys) +sys.setdefaultencoding('latin1') +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +import prefs +from InterfaceQT4 import eficas_go +eficas_go.lanceEficas(code=prefs.code)