Skip to content
Snippets Groups Projects
Commit 79b066b6 authored by Lambert Theisen's avatar Lambert Theisen
Browse files

Remove nocoeffs option

- This was anyways only working for heat
- Makes no sense to keep this option anymore
parent 1be6284c
Branches
Tags
3 merge requests!5Update to version 1.1,!3Feat/symmetrization,!2Feat/symmetrization
Showing
with 81 additions and 290 deletions
......@@ -48,14 +48,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......
......@@ -49,14 +49,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 0
......
......@@ -48,14 +48,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 0.08
xi_tilde: 1.0
heat_source: 0
......
......@@ -78,14 +78,12 @@ class Input:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......@@ -186,10 +184,6 @@ class Input:
"required": True,
"allowed": ["heat", "stress", "r13"]
},
"use_coeffs": {
"type": "boolean",
"required": True,
},
"kn": {
"type": "float",
"required": True,
......
......@@ -66,7 +66,6 @@ class Solver:
self.cell = self.mesh.ufl_cell()
self.time = time
self.mode = params["mode"]
self.use_coeffs = params["use_coeffs"]
self.kn = params["kn"]
self.xi_tilde = params["xi_tilde"]
self.use_cip = self.params["stabilization"]["cip"]["enable"]
......@@ -361,104 +360,88 @@ class Solver:
return 1 * df.dot(df.div(tensor), vector) * df.dx
# Setup both weak forms
if self.use_coeffs:
a1 = (
- b(theta, r)
- cpl * c(r, sigma) # SAME RESULTS (I)
) + (
+ 24/25 * kn * df.inner(to.stf3d2(df.grad(s)), df.grad(r))
+ 4/15 * (1/kn) * df.inner(s, r)
# + cpl * 2/5 * df.dot(df.div(sigma), r) # SAME RESULTS (I)
) * df.dx + (
+ (
+ 1/(2*xi_tilde) * s_n
- cpl * 1/4 * sigma_nn
+ cpl * 2/5 * sigma_nn # SAME RESULTS (I)
) * r_n
+ (
+ 11/25 * xi_tilde * s_t
+ cpl * 1/25 * xi_tilde * s_t
- cpl * 1/5 * sigma_nt
+ cpl * 2/5 * sigma_nt # SAME RESULTS (I)
) * r_t
) * df.ds
l1 = sum([
- 1 * r_n * bcs[bc]["theta_w"] * df.ds(bc)
for bc in bcs.keys()
])
a2 = b(kappa, s)
l2 = + (f_heat * kappa) * df.dx
a3 = (
- e(u, psi)
+ cpl * cc(s, psi)
) + (
+ kn * df.inner(
to.stf3d3(to.grad3dOf2(to.gen3dTF2(sigma))),
to.grad3dOf2(to.gen3dTF2(psi))
)
+ (1/(2*kn)) * df.inner(to.gen3dTF2(sigma), to.gen3dTF2(psi))
) * df.dx + (
+ (
+ 21/20 * xi_tilde * sigma_nn
+ cpl * 3/40 * xi_tilde * sigma_nn
- cpl * 3/20 * s_n
) * psi_nn
+ xi_tilde * (
(sigma_tt + (1/2)*sigma_nn)*(psi_tt + (1/2)*psi_nn)
)
+ (
+ (1/xi_tilde) * sigma_nt
- cpl * 1/5 * s_t
) * psi_nt
) * df.ds + sum([
bcs[bc]["epsilon_w"] * (p + sigma_nn) * psi_nn * df.ds(bc)
for bc in bcs.keys()
])
l3 = sum([
- 1 * psi_nt * bcs[bc]["u_t_w"] * df.ds(bc)
- 1 * (
- bcs[bc]["epsilon_w"] * bcs[bc]["p_w"]
+ bcs[bc]["u_n_w"]
) * psi_nn * df.ds(bc)
for bc in bcs.keys()
])
a4 = (
e(v, sigma)
+ d(p, v)
a1 = (
- b(theta, r)
- cpl * c(r, sigma) # SAME RESULTS (I)
) + (
+ 24/25 * kn * df.inner(to.stf3d2(df.grad(s)), df.grad(r))
+ 4/15 * (1/kn) * df.inner(s, r)
# + cpl * 2/5 * df.dot(df.div(sigma), r) # SAME RESULTS (I)
) * df.dx + (
+ (
+ 1/(2*xi_tilde) * s_n
- cpl * 1/4 * sigma_nn
+ cpl * 2/5 * sigma_nn # SAME RESULTS (I)
) * r_n
+ (
+ 11/25 * xi_tilde * s_t
+ cpl * 1/25 * xi_tilde * s_t
- cpl * 1/5 * sigma_nt
+ cpl * 2/5 * sigma_nt # SAME RESULTS (I)
) * r_t
) * df.ds
l1 = sum([
- 1 * r_n * bcs[bc]["theta_w"] * df.ds(bc)
for bc in bcs.keys()
])
a2 = b(kappa, s)
l2 = + (f_heat * kappa) * df.dx
a3 = (
- e(u, psi)
+ cpl * cc(s, psi)
) + (
+ kn * df.inner(
to.stf3d3(to.grad3dOf2(to.gen3dTF2(sigma))),
to.grad3dOf2(to.gen3dTF2(psi))
)
l4 = + df.Constant(0) * df.div(v) * df.dx
a5 = (
- d(q, u)
) + sum([
bcs[bc]["epsilon_w"] * (p + sigma_nn) * q * df.ds(bc)
for bc in bcs.keys()
])
l5 = + (f_mass * q) * df.dx - sum([
(
- bcs[bc]["epsilon_w"] * bcs[bc]["p_w"]
+ bcs[bc]["u_n_w"]
) * q * df.ds(bc)
for bc in bcs.keys()
])
else:
a1 = (
kn * df.inner(to.stf3d2(df.grad(s)), df.grad(r))
+ (1/kn) * df.inner(s, r)
- theta * df.div(r)
) * df.dx + (
+ 1/(xi_tilde) * s_n * r_n
+ xi_tilde * s_t * r_t
) * df.ds
a2 = - (df.div(s) * kappa) * df.dx
l1 = sum([
- 1 * r_n * bcs[bc]["theta_w"] * df.ds(bc)
for bc in bcs.keys()
])
l2 = - (f_heat * kappa) * df.dx
+ (1/(2*kn)) * df.inner(to.gen3dTF2(sigma), to.gen3dTF2(psi))
) * df.dx + (
+ (
+ 21/20 * xi_tilde * sigma_nn
+ cpl * 3/40 * xi_tilde * sigma_nn
- cpl * 3/20 * s_n
) * psi_nn
+ xi_tilde * (
(sigma_tt + (1/2)*sigma_nn)*(psi_tt + (1/2)*psi_nn)
)
+ (
+ (1/xi_tilde) * sigma_nt
- cpl * 1/5 * s_t
) * psi_nt
) * df.ds + sum([
bcs[bc]["epsilon_w"] * (p + sigma_nn) * psi_nn * df.ds(bc)
for bc in bcs.keys()
])
l3 = sum([
- 1 * psi_nt * bcs[bc]["u_t_w"] * df.ds(bc)
- 1 * (
- bcs[bc]["epsilon_w"] * bcs[bc]["p_w"]
+ bcs[bc]["u_n_w"]
) * psi_nn * df.ds(bc)
for bc in bcs.keys()
])
a4 = (
e(v, sigma)
+ d(p, v)
)
l4 = + df.Constant(0) * df.div(v) * df.dx
a5 = (
- d(q, u)
) + sum([
bcs[bc]["epsilon_w"] * (p + sigma_nn) * q * df.ds(bc)
for bc in bcs.keys()
])
l5 = + (f_mass * q) * df.dx - sum([
(
- bcs[bc]["epsilon_w"] * bcs[bc]["p_w"]
+ bcs[bc]["u_n_w"]
) * q * df.ds(bc)
for bc in bcs.keys()
])
# stabilization
if self.use_cip:
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
# General
# =======
# - output_folder: Used as output folder
output_folder: heat_01_nocoeffs_p1p2_nostab
# Meshes
# ======
# - meshes: List of input meshes in h5 format to run simulations on
meshes:
- ../mesh/ring0.h5
- ../mesh/ring1.h5
- ../mesh/ring2.h5
- ../mesh/ring3.h5
- ../mesh/ring4.h5
# - ../mesh/ring5.h5
# - ../mesh/ring6.h5
# - ../mesh/ring7.h5
# - ../mesh/ring8.h5
# Numerical Parameters
# ====================
# - elements: Must contain the fields: theta, s, p, u, sigma
# - fields: List of FEM parameters (shape, degree)
# - shape: Element shape, e.g. Lagrange
# - degree: Element degree, e.g. 2
# - stabilization: Must contain cip
# - cip: Collection of Continous Interior Penalty (CIP) parameters
# - enable: Enable CIP stabilization
# - delta_1: Stabilization of grad(T)*grad(T_test) over edge
# - delta_2: Stabilization of grad(u)*grad(u_test) over edge
# - delta_3: Stabilization of grad(p)*grad(p_test) over edge
elements:
theta:
shape: Lagrange
degree: 1
s:
shape: Lagrange
degree: 2
p:
shape: Lagrange
degree: 1
u:
shape: Lagrange
degree: 1
sigma:
shape: Lagrange
degree: 1
stabilization:
cip:
enable: False
delta_1: 1.0
delta_2: 1.0
delta_3: 0.1
# Formulation Parameters
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: False
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
mass_source: 2.0/5.0 * (1.0 - (5.0*std::pow(sqrt(pow(x[0],2)+pow(x[1],2)),2))/(18.0*pow(kn,2))) * std::cos(phi)
# Boundary Conditions
# ===================
# - bcs: Dictionary of all boundary IDs from mesh
# - bc_id: must contain theta_w, u_t_w, u_n_w, p_w, epsilon_w
# - theta_w: Value for temperature at wall
# - u_t_w: Value for tangential velocity at wall
# - u_n_w: Value for normal velocity at wall
# - p_w: Value for pressure at wall
# - epsilon_w: Inflow-model parameter <=> Weight of pressure prescription
bcs:
3000:
theta_w: 1.0
u_t_w: 10
u_n_w: 0
p_w: 0
epsilon_w: 0
3100:
theta_w: 0.5
u_t_w: 0
u_n_w: 0
p_w: 0
epsilon_w: 0
# Convergence Study
# =================
# - enable: Enable convergence study on given meshes
# - exact_solution: Path to exact solution in cpp-format to compare errors
# - plot: Show errors in matplotlib window. PDF output is always per default.
# - write_systemmatrix: Writes out systemmatrix (LHS) to use for analysis
# - rescale_pressure: Rescale numerical pressure result to have zero mean
# - relative_errors: Use relative errors. If exact sol. is zero, use absolute.
convergence_study:
enable: True
exact_solution: esols/01_nocoeffs.cpp
plot: False # to avoid error exit code due to $DISPLAY
write_systemmatrix: False
rescale_pressure: True
relative_error: True
# Postprocessing
# ==============
# - write_pdfs: Write all solution fields as PDF plot
# - massflow: List of BC IDs to compute massflow J=int_bc dot(u,n) ds
postprocessing:
write_pdfs: False
massflow: []
# Parameter Study
# ==============
# - enable: Repeat simulation with different p. values (study)
# - parameter_key: Key as list, e.g. ["elemenets", "p", "degree"]
# - parameter_values: List of value for parameter, e.g. [0.01,0.1,1,10]
parameter_study:
enable: False
parameter_key: []
parameter_values: []
\ No newline at end of file
......@@ -56,14 +56,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 10.0
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
h,theta_L_2,theta_l_inf,sx_L_2,sx_l_inf,sy_L_2,sy_l_inf
0.9886573325052778,0.357894741689,0.216098612525,0.240410304204,0.306339813914,0.324881748186,0.320082148112
0.6340332990709842,0.242909399797,0.1495055347,0.146027964209,0.190711929877,0.142634466684,0.193949622178
0.32904683851469807,0.0756545620653,0.0593796453478,0.0251308062691,0.0399464486938,0.0262011355659,0.05645443766
0.16754966839339377,0.0218835981854,0.0181220033842,0.00544830689941,0.0113641486981,0.00549987793301,0.00741084339653
0.08734460120995041,0.0054162057365,0.00589807915544,0.00122021718208,0.00184678984693,0.00122121393164,0.00215311144954
......@@ -64,7 +64,6 @@ class TestHeatConvergence(object):
Parameter Value
============= =======================
:math:`Kn` :math:`0.1`
Formulation Coefficients
Elements :math:`P_1P_1`
Stabilization CIP, :math:`\delta_1=1`
============= =======================
......@@ -83,7 +82,6 @@ class TestHeatConvergence(object):
Parameter Value
============= =======================
:math:`Kn` :math:`10.0`
Formulation Coefficients
Elements :math:`P_2P_2`
Stabilization CIP, :math:`\delta_1=1`
============= =======================
......@@ -102,7 +100,6 @@ class TestHeatConvergence(object):
Parameter Value
============= =======================
:math:`Kn` :math:`0.1`
Formulation Coefficients
Elements :math:`P_2P_2`
Stabilization CIP, :math:`\delta_1=1`
============= =======================
......@@ -121,7 +118,6 @@ class TestHeatConvergence(object):
Parameter Value
============= =======================
:math:`Kn` :math:`0.1`
Formulation Coefficients
Elements :math:`P_2P_1`
Stabilization CIP, :math:`\delta_1=1`
============= =======================
......@@ -131,22 +127,3 @@ class TestHeatConvergence(object):
errors = name + "/" + "errors.csv"
referrors = "referrors/" + name + "/errors.csv"
self.compare_errors(errors, referrors)
def test_heat_01_nocoeffs_p1p2_nostab(self):
r"""
Execute decoupled heat system test and check with reference errors.
============= =======================
Parameter Value
============= =======================
:math:`Kn` :math:`0.1`
Formulation No Coefficients
Elements :math:`P_2P_1`
Stabilization CIP, :math:`\delta_1=1`
============= =======================
"""
name = "heat_01_nocoeffs_p1p2_nostab"
self.run_solver("inputs/" + name + ".yml")
errors = name + "/" + "errors.csv"
referrors = "referrors/" + name + "/errors.csv"
self.compare_errors(errors, referrors)
......@@ -56,14 +56,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......
......@@ -53,14 +53,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: stress
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -56,14 +56,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: stress
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: stress
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -53,14 +53,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: stress
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -54,14 +54,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: stress
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment