time dependent diffusion coefficient
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!