time dependent diffusion coefficient

16 Ansichten (letzte 30 Tage)
Ness_243
Ness_243 am 14 Okt. 2020
Bearbeitet: Ness_243 am 14 Okt. 2020
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

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by