Dir
多维插值能量耦合模块
多维插值耦合能量的实例
以CuNiSi为例,说明采用多维插值实现能量输入来进行相场模拟的示例。
Step 1: 能量输入文件的生成
首先需要生成相场模拟所需的能量输入文件,以下给出输出液相和固相的能量输入文件的示例。
因为示例模型的扩散系数设置为常数,所以其相关的输入在后续模拟中可以暂时不考虑。最终得到的输入文件为:
- cunisi_liquid_energy.cchi
- cunisi_fcc_a1_energy.cchi
液相的能量输入文件生成
液相能量生成所需的配置文件
type: MockMultiComponentPhase_Vector
omp_threads: 64
elements: [NI, SI]
mock_setting:
NI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [logit, logit, linear]
grid_points: [1.0e-4, 1.0e-2, 0.1]
grid_nums: [20, 80, 100]
SI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [logit, logit, linear]
grid_points: [1.0e-4, 1.0e-2, 0.1]
grid_nums: [20, 80, 100]
T:
lower: 1300
upper: 1400
threshold: 1300
types: [sqrt]
grid_points: [1400]
grid_nums: [20]
validate_setting:
NI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [log]
grid_points: [0.1]
grid_nums: [20]
SI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [log]
grid_points: [0.1]
grid_nums: [20]
T:
lower: 1300
upper: 1400
threshold: 1300
types: [linear]
grid_points: [1400]
grid_nums: [10]
energy_destination: cunisi_liquid_energy.cchi
diffusion_destination: cunisi_liquid_diffusion.cchi
phase:
energy:
type: CuNiSiNoMagn_Vector_Liquid
ncomp: 2
interdiffusivity:
type: ConstantMatrixMultiComponentFunctor_Vector
values: [1.0e-9, 0.0, 0.0, 1.0e-9]
element: [NI, SI]
name: Liquid
type: MultiComponentPhase_Vector
path: results
enable_check: true
固相的能量输入文件生成
固相能量生成所需的配置文件
type: MockMultiComponentPhase_Vector
omp_threads: 64
elements: [NI, SI]
mock_setting:
NI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [logit, logit, linear]
grid_points: [1.0e-4, 1.0e-2, 0.1]
grid_nums: [20, 80, 100]
SI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [logit, logit, linear]
grid_points: [1.0e-4, 1.0e-2, 0.1]
grid_nums: [20, 80, 100]
T:
lower: 1300
upper: 1400
threshold: 1300
types: [sqrt]
grid_points: [1400]
grid_nums: [20]
validate_setting:
NI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [log]
grid_points: [0.1]
grid_nums: [20]
SI:
lower: 0
upper: 0.1
threshold: 1.0e-07
types: [log]
grid_points: [0.1]
grid_nums: [20]
T:
lower: 1300
upper: 1400
threshold: 1300
types: [linear]
grid_points: [1400]
grid_nums: [10]
energy_destination: cunisi_fcc_a1_energy.cchi
diffusion_destination: cunisi_fcc_a1_diffusion.cchi
phase:
energy:
type: CuNiSiNoMagn_Vector_Fcc_A1
ncomp: 2
interdiffusivity:
type: ConstantMatrixMultiComponentFunctor_Vector
values: [1.0e-14, 0.0, 0.0, 1.0e-14]
element: [NI, SI]
name: Liquid
type: MultiComponentPhase_Vector
path: results
enable_check: true
Step 2: 相场模拟
在进行相场模拟之前,需要先将生成的能量输入文件放置到与配置文件相同的文件夹,或者将配置文件中与能量相关的路径设置为全局路径。在配置文件中,
mdinterp用于指定能量输入文件的路径,mdinterp的路径可以是相对路径,也可以是绝对路径。凝固过程相场模拟示例文件
alpha:
energy:
type: MDInterpFunctor_Vector
ncomp: 2
mdinterp: mock/cunisi_liquid_energy.cchi
ninput: 3
ntarget: 3
interdiffusivity:
type: ConstantMatrixMultiComponentFunctor_Vector
values: [4.636237609126011e-09, 0, 0, 3.1347997340392758e-09]
element: [NI, SI]
name: Liquid
type: MultiComponentPhase_Vector
beta:
energy:
type: MDInterpFunctor_Vector
ncomp: 2
mdinterp: mock/cunisi_fcc_a1_energy.cchi
ninput: 3
ntarget: 3
interdiffusivity:
type: ConstantMatrixMultiComponentFunctor_Vector
values: [1.98172e-13, -1.14452e-13, -1.78916e-13, 1.41911e-12]
element: [NI, SI]
name: Fcc_A1
type: MultiComponentPhase_Vector
anisotropy:
mobility: [0.5]
parameters: [0.5]
type: CubicAnisotropyYang
boundary_condition:
BC0X:
type: PERIODIC
BC0Y:
type: PERIODIC
BC0Z:
type: PERIODIC
BCNX:
type: PERIODIC
BCNY:
type: PERIODIC
BCNZ:
type: PERIODIC
clear: true
elements: [Si, Ni, Cu]
flag:
average: true
rotation: false
mesh:
current_time: 0
dt: 1.0e-6
dx: 1.0e-6
nx: 130
ny: 90
nz: 1
simulation_time: 3
nucleation:
- type: SetWhole
variable:
- value: [1, 0]
varname: phi
- value: [0.0162, 0.0077]
varname: c1
- value: [0.0162, 0.0077]
varname: c2
- point: [50, 50, 0]
radius: 4
smooth: true
smooth_variable: phi
type: SetSphere
variable:
- value: [0, 1]
varname: phi
- value: [0.01418, 0.01005]
varname: c1
- value: [0.01835, 0.00518]
varname: c2
width: 6
omp_threads: 64
output:
every_number: 50
factor: 2
final_time: 360000
initial_interval: 0.001
output_time: 0
variable: []
parameter:
P: [1.92188057302129e-7, 1.37625897704027e-7]
Vm: 1.0e-05
eta: 6.0e-06
mu: 3.6029977398687324e-10
sigma: 0.24
path: results/solidification
temperature:
T: 1358.15
dTdt: -1.0
dTdx: 0
dTdy: 0
dTdz: 0
type: LinearTemperature
type: MultiComponentPhaseField_Vector