time dependent diffusion coefficient
16 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!