time dependent diffusion coefficient

17 ビュー (過去 30 日間)
Ness_243
Ness_243 2020 年 10 月 14 日
編集済み: Ness_243 2020 年 10 月 14 日
Hi,
I'm trying to solve the diffusion equation with time dependent c and f coefficients. The diffusion coefficient c is a function of temperature T and the temperature varies with time (t) :
% diffusion coefficient (c_coeff)
T = a*exp(-b*t) - d*t + h
c = D*exp(E/(R*T))
% source term
s = m*exp(n*t)
Can you help me to express these coefficients as functions that can be used in Pdetool or in the following code?
model = createpde();
% Call the geometry considered to solve the PDE
[ dl ] = geometry () ;
geometryFromEdges(model,dl);
%Apply Dirichlet Boundary conditions
applyBoundaryCondition(model,'dirichlet','Edge',1:model.Geometry.NumEdges,'u',0);
% Define the time step
time = 0:0.01:1;
% Define pde coefficients
specifyCoefficients(model,'m',0,'d',1,'c',@c_coef,'a',0,'f',@source, 'face',1);
% Initial conditions
setInitialConditions(model,0);
% Generate the Mesh
generateMesh(model,'GeometricOrder','linear');
% Solve the pde
results = solvepde(model,time);
Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by