Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbulence CMFD compatibility #7

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
"\n",
"run.reset()\n",
"liste_dis = [\"VDF\", \"PolyMAC_P0P1NC\", \"PolyMAC_P0\"]\n",
"for dis in liste_dis:\n",
" run.addCaseFromTemplate(\"jdd.data\", dis, {\"dis\" : dis})\n",
"for pb in [\"ThHyd\", \"Hyd\"]:\n",
" for dis in liste_dis:\n",
" run.addCaseFromTemplate(f\"jdd_{pb}.data\", dis, {\"dis\" : dis})\n",
"\n",
"run.printCases()\n",
"run.runCases()"
Expand All @@ -60,17 +61,43 @@
"from trustutils import plot\n",
"from math import ceil\n",
"\n",
"vars = (\"V\", \"P\", \"RHO\", \"MU\", \"NU\", \"LAMBDA\", \"CP\")\n",
"a = plot.Graph(\"comparaison\", nX=len(vars))\n",
"dvars = {\n",
" \"Hyd\": (\"V\", \"P\", \"RHO\", \"MU\", \"NU\"),\n",
" \"ThHyd\": (\"V\", \"P\", \"RHO\", \"MU\", \"NU\", \"LAMBDA\", \"CP\"),\n",
"}\n",
"\n",
"for i, var in enumerate(vars):\n",
" a.addPlot(i, f\"Variable {var}\")\n",
" for dis in liste_dis:\n",
" a.addSegment(f\"{run.BUILD_DIRECTORY}/{dis}/jdd_{var}.son\", label=dis, compo=(1 if var == \"V\" else 0))\n"
"for pb, vars in dvars.items():\n",
" a = plot.Graph(pb, nX=len(vars))\n",
" for i, var in enumerate(vars):\n",
" a.addPlot(i, f\"Variable {var}\")\n",
" for dis in liste_dis:\n",
" a.addSegment(\n",
" f\"{run.BUILD_DIRECTORY}/{dis}/jdd_{pb}_{var}.son\",\n",
" label=dis,\n",
" compo=(1 if var == \"V\" else 0),\n",
" )"
]
}
],
"metadata": {},
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.19"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# PARALLEL OK 8 #
# OPENMP NOT # # Gmgres+Boomeramg GPU diverges in parallel: Bicgstab+Boomeramg works #
dimension 2
Domaine dom

# BEGIN MESH #
mailler dom
{
pave carre
{
origine 0.0 0.0
nombre_de_noeuds 2 11
longueurs 1 1
}
{
bord bas Y = 0.0 0.0 <= X <= 1.0
bord haut Y = 1.0 0.0 <= X <= 1.0
bord boundary X = 0.0 0.0 <= Y <= 1.0
bord boundary X = 1.0 0.0 <= Y <= 1.0
}
}
# END MESH #

# BEGIN PARTITION
Decouper dom
{
partitionneur metis { nb_parts 2 }
nb_parts_tot 2
Larg_joint 2
Nom_Zones dom
}
Fin
END PARTITION #

# BEGIN SCATTER
Scatter dom.Zones dom
END SCATTER #

$dis dis

Schema_euler_implicite sch
Read sch
{
tinit 0
facsec 1e8
dt_max 0.1
seuil_statio 1e-3
Solveur implicite { solveur petsc cli { } }
}

pb_hydraulique pb
Associate pb dom
Associate pb sch
Discretize pb dis

Read pb
{
Fluide_sodium_liquide
{
P_ref 1e5 T_ref 500
porosites_champ champ_fonc_xyz dom 1 1-0.5*(y>0.5)
}

navier_stokes_standard
{
solveur_pression petsc cli_quiet { -pc_type hypre -pc_hypre_type boomeramg }
convection { amont }
diffusion { negligeable }
initial_conditions { vitesse champ_uniforme 2 0 1 }
boundary_conditions
{
boundary symetrie
bas frontiere_ouverte_vitesse_imposee_sortie champ_front_uniforme 2 0 1
haut frontiere_ouverte_pression_imposee champ_front_uniforme 1 0
}
}

Post_processing
{
probes
{
v grav vitesse periode 1e8 segment 10 0.5 0 0.5 1
p grav pression periode 1e8 segment 10 0.5 0 0.5 1
rho grav masse_volumique periode 1e8 segment 10 0.5 0 0.5 1
mu grav viscosite_dynamique periode 1e8 segment 10 0.5 0 0.5 1
nu grav viscosite_cinematique periode 1e8 segment 10 0.5 0 0.5 1
}
Format lml
fields dt_post 0
{
vitesse elem
pression elem
pression_pa elem
masse_volumique elem
viscosite_cinematique elem
viscosite_dynamique elem
}
}
}
Solve pb
End
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# PARALLEL OK #

Dimension 2
Pb_hydraulique pb

Domaine dom
# BEGIN MESH #
Mailler dom
{
pave bloc1
{
origine 0 0
longueurs 100 0.2
nombre_de_noeuds 51 3
}
{
bord entree X = 0. 0. <= Y <= 0.2
bord sortie X = 100 0. <= Y <= 0.2
bord bas Y = 0. 0. <= X <= 100
} ,
pave bloc2
{
origine 0 0.2
longueurs 100 0.2
nombre_de_noeuds 51 3
}
{
bord entree X = 0 0.2 <= Y <= 0.4
bord sortie X = 100 0.2 <= Y <= 0.4
} ,
pave bloc3
{
origine 0 0.4
longueurs 100 0.6
nombre_de_noeuds 51 7
}
{
bord entree X = 0 0.4 <= Y <= 1.0
bord sortie X = 100 0.4 <= Y <= 1.0
bord haut Y = 1.0 0 <= X <= 100
}
}

# END MESH #

# BEGIN PARTITION
Partition dom
{
/* Choose Nb_parts so to have ~ 25000 cells per processor */
Partition_tool metis { nb_parts 4 }
Larg_joint 2
zones_name DOM
}
End
END PARTITION #

# BEGIN SCATTER
Scatter DOM.Zones dom
END SCATTER #

$dis dis

Schema_Euler_implicite sch
Lire sch
{
tinit 0
dt_impr 1e-10
facsec 1e8
dt_max 0.5
solveur implicite { solveur petsc cli { } }
seuil_statio 1e-8
}

Associer pb dom
Associer pb sch

Discretiser pb dis

Lire pb
{

fluide_incompressible
{
mu champ_uniforme 1 2e-2
rho champ_uniforme 1 1000.0
}
Navier_Stokes_standard
{
Solveur_pression PETSC Cholesky { }
Convection { amont }
diffusion { turbulente l_melange { l_melange 1.e-3 } }
Conditions_initiales { vitesse champ_uniforme 2 1 0 }
Conditions_limites
{
bas Paroi_fixe
haut symetrie
entree frontiere_ouverte_vitesse_imposee_sortie Champ_front_uniforme 2 1 0
sortie frontiere_ouverte_pression_imposee champ_front_uniforme 1 100000.0
}
}

Postraitement
{
sondes
{
vitesse grav vitesse periode 1e8 segment 10 95 0.05 95 0.95
u VitesseX periode 1e8 position_like vitesse
y_plus y_plus periode 1e8 segment 40 1.25 0.05 98.75 0.05
pression pression_pa periode 1e8 segment 10 0 0.8 100 0.8
pression_io pression periode 1e8 segment 2 0.75 0 0.75 100
pression_i pression periode 1e8 segment 100 50 0 50 1
pression_o pression periode 1e8 segment 100 100 0 100 1
nut NU_TURBULENTE periode 1e8 position_like vitesse
mut MU_TURBULENTE periode 1e8 position_like vitesse
}
format lml
champs dt_post 1e8
{
vitesse elem
pression_pa elem
}
}
}


Resoudre pb

Fin

Loading