This commit is contained in:
jeremias 2021-06-15 12:11:18 +02:00
parent b75e5995e0
commit 6e8598b897
3 changed files with 209 additions and 35 deletions

View File

@ -76,10 +76,13 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
} }
dim = dat['theta'].shape[-1]
meas_flag = False meas_flag = False
RC_flag = False if dim==7:
RC_flag = True
else:
RC_flag = False
line_split = 1.5 line_split = 1.5
current_val = [] current_val = []
current_val_C = [] current_val_C = []
@ -110,7 +113,6 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
dim = dat['theta'].shape[-1]
fig1, axes1 = plt.subplots(1,1,figsize=(12,6)) fig1, axes1 = plt.subplots(1,1,figsize=(12,6))
if RC_flag: if RC_flag:
fig2, axes2 = plt.subplots(1,1,figsize=(12,6)) fig2, axes2 = plt.subplots(1,1,figsize=(12,6))
@ -200,6 +202,7 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
axes1.set_ylabel(r'$R_d$',fontsize=22) axes1.set_ylabel(r'$R_d$',fontsize=22)
axes1.legend(fontsize=18,loc='upper right') axes1.legend(fontsize=18,loc='upper right')
axes1.set_xlim([-0.01,0.81]) axes1.set_xlim([-0.01,0.81])
axes1.set_ylim([1700,35000])
axes1.set_xlabel(r'$t (s)$',fontsize=22) axes1.set_xlabel(r'$t (s)$',fontsize=22)
plt.savefig('C.png') plt.savefig('C.png')

View File

@ -8,7 +8,7 @@ fluid:
implicit_windkessel: True implicit_windkessel: True
io: io:
write_path: 'results/Rz_Pa_vnoise' write_path: 'results/Rz_Pc7'
restart: restart:
path: '' # './projects/nse_coa3d/results/test_restart2/' path: '' # './projects/nse_coa3d/results/test_restart2/'
time: 0 time: 0
@ -26,10 +26,9 @@ boundary_conditions:
# -U*sin(DOLFIN_PI*(t-1.6)/Th)*(t<= 1.6+Th )*(t>1.6) + (t<2.4)*(1.6+Th<t)*(U*DOLFIN_PI/Th*(t-1.6-Th)*exp(-(t-1.6-Th)*beta))' ] # -U*sin(DOLFIN_PI*(t-1.6)/Th)*(t<= 1.6+Th )*(t>1.6) + (t<2.4)*(1.6+Th<t)*(U*DOLFIN_PI/Th*(t-1.6-Th)*exp(-(t-1.6-Th)*beta))' ]
value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (Th<t)*(U*DOLFIN_PI/Th*(t-Th)*exp(-(t-Th)*beta))'] value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (Th<t)*(U*DOLFIN_PI/Th*(t-Th)*exp(-(t-Th)*beta))']
parameters: parameters:
#U: 75 #P0 #U: 75 #REFERENCE
U: 150 #Pa #U: 150 #Pa
#U: 100 #Pg U: 40 #Pc
#U: 40 #Pc
Th: 0.36 Th: 0.36
beta: 70 beta: 70
t: 0 t: 0
@ -51,16 +50,15 @@ boundary_conditions:
type: 'windkessel' type: 'windkessel'
parameters: parameters:
R_p: 480 R_p: 480
#C: 0.0004 # P0 C: 0.0004 # REFERENCE
C: 0.0005 # Pa #C: 0.0005 # Pa
#C: 0.0010 # Pb #C: 0.0010 # Pb
#C: 0.0001 # Pc #C: 0.0001 # Pc
#C: 0.0008 # Pg #C: 0.0008 # Pg
#R_d: 7200 #P0 #R_d: 7200 # REFERENCE
R_d: 8760 #Pa #R_d: 8760 #Pa
#R_d: 17520 #Pb x2 #R_d: 17520 #Pb x2
#R_d: 10000 #Pg R_d: 4000 #Pc
#R_d: 4000 #Pc
p0: 85 p0: 85
conv: 1333.223874 conv: 1333.223874
- -
@ -68,17 +66,15 @@ boundary_conditions:
type: 'windkessel' type: 'windkessel'
parameters: parameters:
R_p: 520 R_p: 520
#C: 0.0003 # REFERENCE C: 0.0003 # REFERENCE
C: 0.0005 # Pa #C: 0.0005 # Pa
#C: 0.0010 # Pb #C: 0.0010 # Pb
#C: 0.0001 # Pc #C: 0.0001 # Pc
#C: 0.0008 # Pg #C: 0.0008 # Pg
#R_d: 11520 # REFERENCE #R_d: 11520 # REFERENCE
R_d: 8760 #Pa #R_d: 8760 #Pa
#R_d: 17520 #Pb x2 #R_d: 17520 #Pb x2
#R_d: 26280 #Pc x3 R_d: 4000 #Pc
#R_d: 10000 #Pg
#R_d: 4000 #Pc
p0: 85 p0: 85
conv: 1333.223874 conv: 1333.223874
- -
@ -86,17 +82,14 @@ boundary_conditions:
type: 'windkessel' type: 'windkessel'
parameters: parameters:
R_p: 520 R_p: 520
#C: 0.0003 # REFERENCE C: 0.0003 # REFERENCE
C: 0.0005 #Pa #C: 0.0005 #Pa
#C: 0.0010 #Pb #C: 0.0010 #Pb
#C: 0.0001 #Pc #C: 0.0001 #Pc
#C: 0.0008 #Pg
#R_d: 11520 # REFERENCE #R_d: 11520 # REFERENCE
R_d: 8760 #Pa #R_d: 8760 #Pa
#R_d: 17520 #Pb x2 #R_d: 17520 #Pb x2
#R_d: 26280 #Pc x3 R_d: 4000 #Pc
#R_d: 10000 #Pg
#R_d: 4000 #Pc
p0: 85 p0: 85
conv: 1333.223874 conv: 1333.223874
@ -170,17 +163,17 @@ estimation:
id: 4 id: 4
type: 'windkessel' type: 'windkessel'
mode: 'Rd' mode: 'Rd'
initial_stddev: 1 initial_stddev: 2
- -
id: 5 id: 5
type: 'windkessel' type: 'windkessel'
mode: 'Rd' mode: 'Rd'
initial_stddev: 1 initial_stddev: 2
- -
id: 6 id: 6
type: 'windkessel' type: 'windkessel'
mode: 'Rd' mode: 'Rd'
initial_stddev: 1 initial_stddev: 2
- -
id: 2 id: 2
type: 'dirichlet' type: 'dirichlet'
@ -193,13 +186,13 @@ estimation:
mesh: '/home/yeye/NuMRI/kalman/meshes/coaortaH3_leo2.0.h5' mesh: '/home/yeye/NuMRI/kalman/meshes/coaortaH3_leo2.0.h5'
#mesh: './meshes/coaortaH1.h5' #mesh: './meshes/coaortaH1.h5'
fe_degree: 1 fe_degree: 1
#xdmf_file: 'measurements/aorta_zdir/Perturbation/Mg15V120/u_all.xdmf' xdmf_file: 'measurements/aorta_zdir/Perturbation/Mg15V120/u_all.xdmf'
#file_root: 'measurements/aorta_zdir/Perturbation/Mg15V120/u{i}.h5' file_root: 'measurements/aorta_zdir/Perturbation/Mg15V120/u{i}.h5'
xdmf_file: 'measurements/aorta_zdir_vnoise/u_all.xdmf' #xdmf_file: 'measurements/aorta_zdir_NV/u_all.xdmf'
file_root: 'measurements/aorta_zdir_vnoise/u{i}.h5' #file_root: 'measurements/aorta_zdir_NV/u{i}.h5'
indices: 0 # indices of checkpoints to be processed. 0 == all indices: 0 # indices of checkpoints to be processed. 0 == all
velocity_direction: [0,0,1] velocity_direction: [0,0,1]
noise_stddev: 45 # standard deviation of Gaussian noise noise_stddev: 25 # standard deviation of Gaussian noise
roukf: roukf:
particles: 'simplex' # unique or simplex particles: 'simplex' # unique or simplex

View File

@ -0,0 +1,178 @@
mesh: './meshes/coaortaH1.h5'
# Physical parameters of the fluid
fluid:
density: 1.2
dynamic_viscosity: 0.035
stokes: False
implicit_windkessel: True
io:
write_path: 'results/aortaRR_Pa'
restart:
path: '' # './projects/nse_coa3d/results/test_restart2/'
time: 0
write_xdmf: True
write_checkpoints: True
write_hdf5_timeseries: False
write_velocity: 'update' # update or tentative
boundary_conditions:
-
id: 2
type: 'dirichlet'
#value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (t<0.8)*(Th<t)*(U*DOLFIN_PI/Th*(t-Th)*exp(-(t-Th)*beta)) +
# -U*sin(DOLFIN_PI*(t-0.8)/Th)*(t<= 0.8+Th )*(t>0.8) + (t<1.6)*(0.8+Th<t)*(U*DOLFIN_PI/Th*(t-0.8-Th)*exp(-(t-0.8-Th)*beta)) +
# -U*sin(DOLFIN_PI*(t-1.6)/Th)*(t<= 1.6+Th )*(t>1.6) + (t<2.4)*(1.6+Th<t)*(U*DOLFIN_PI/Th*(t-1.6-Th)*exp(-(t-1.6-Th)*beta))' ]
value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (Th<t)*(U*DOLFIN_PI/Th*(t-Th)*exp(-(t-Th)*beta))']
parameters:
U: 75
Th: 0.36
beta: 70
t: 0
-
id: 1
type: 'dirichlet'
value: ['0','0','0']
-
id: 3
type: 'windkessel'
parameters:
R_p: 200
C: 0.0005
R_d: 4800
p0: 85
conv: 1333.223874
-
id: 4
type: 'windkessel'
parameters:
R_p: 480
C: 0.00045
R_d: 7200
p0: 85
conv: 1333.223874
-
id: 5
type: 'windkessel'
parameters:
R_p: 520
C: 0.00045
R_d: 11520
p0: 85
conv: 1333.223874
-
id: 6
type: 'windkessel'
parameters:
R_p: 520
C: 0.00045
R_d: 11520
p0: 85
conv: 1333.223874
timemarching:
velocity_pressure_coupling: 'fractionalstep' # monolithic, fractionalstep
monolithic:
timescheme: 'gmp' # generalized midpoint, steady FIXME TODO
theta: 1 # 1: Euler, 0.5: implicit midpoint rule (one-legged)
nonlinear:
method: 'constant_extrapolation' # constant_extrapolation, linear_extrapolation, newton, picard, snes
maxit: 20
init_steps: 30
use_aitken: 1 # 0: False, 1: Picard only, 2: all
report: 1 # 0: None, 1: residuals, 2: residuals and energy (inflow/driving/forcing via ESSENTIAL Dbcs!)
atol: 1.e-6 # note: dot required!!
rtol: 1.e-16
stol: 0.0
fractionalstep:
scheme: 'CT' # CT, IPCS
coupled_velocity: False # False faster, True needed if robin_bc implicit
robin_bc_velocity_scheme: 'implicit' # explicit, semi-implicit, implicit
transpiration_bc_projection: 'robin' # robin, dirichlet
flux_report_normalize_boundary: 1
T: 0.8 # end time
dt: 0.001
write_dt: 0.03
checkpoint_dt: 0.03 # <= 0: only last; else value + last
report: 1 # 0: print nothing, 1: print time step and writeout, 2: 1 + flux
# solver setup
fem:
velocity_space: p1 # p1 p1b/p1+ p2
pressure_space: p1 # p1 p0/dg0 dg1
strain_symmetric: False
convection_skew_symmetric: True # aka Temam term
stabilization:
forced_normal:
enabled: True
boundaries: [3,4,5,6]
gamma: 20
backflow_boundaries: [3,4,5,6]
streamline_diffusion:
enabled: False
parameter: 'standard' # standard, shakib, codina, klr
length_scale: 'metric' # average, max, metric
parameter_element_constant: True
Cinv: ~
monolithic:
infsup: 'pspg' # pspg, pressure-stabilization
graddiv: False
consistent: False
pressure_stab_constant: 1.
fix_pressure: False
fix_pressure_point: [0., 0. , 0.]
linear_solver:
method: 'lu'
estimation:
boundary_conditions:
#-
# id: 3
# type: 'windkessel'
# initial_stddev: 1
-
id: 4
type: 'windkessel'
initial_stddev: 1
-
id: 5
type: 'windkessel'
initial_stddev: 1
-
id: 6
type: 'windkessel'
initial_stddev: 1
-
id: 2
type: 'dirichlet'
parameters: 'U'
initial_stddev: 1
measurements:
-
mesh: '/home/yeye/NuMRI/kalman/meshes/coaortaH3_leo2.0.h5'
#mesh: './meshes/coaortaH1.h5'
fe_degree: 1
xdmf_file: 'measurements/aortaRR/Perturbation/Mg15V120/u_all.xdmf'
file_root: 'measurements/aortaRR/Perturbation/Mg15V120/u{i}.h5'
#xdmf_file: 'measurements/aortaRR/u_all.xdmf'
#file_root: 'measurements/aortaRR/u{i}.h5'
indices: 0 # indices of checkpoints to be processed. 0 == all
velocity_direction: ~
noise_stddev: 55 # standard deviation of Gaussian noise
roukf:
particles: 'simplex' # unique or simplex
observation_operator: 'postprocessing' #state or postprocessing
reparameterize: True
ODV_functional:
enable: False
VENC: 102 # 102,120% 59,70% 42 50%, 21,25%