Anisotropic f coefficient for PDE solving
Show older comments
Hello everybody,
I am modelling a multyphysics simulation between current flowing within plate and the consequent Joule heating. I have a system of 2 PDEs: 1) the Laplace equation of the electric potential; 2) the heat equation.
The coupling between the two is given by the Joule heating term (forcing term of the heat equation) that is: σ*|∇ V|^2, with σ the electrical conductivity, and V the potential.
The complexity is given by the fact that σ is anisotropic, and there are two different values for x-direction and y-direction (2.5 and 0.042 respectively).
In the definition of the fcoefficient for the heat equation (the second in order) I wrote this:
f(2,:)= 2.5.*(state.ux(1,:)).^2+0.042.*(state.uy(1,:)).^2;
with state.ux(1,:) I suppose it refers to the gradeint (in x) of the potential, that should be the solution of the first PDE.
but the system gives me an error. How can I overcame this? Moreover, written in this way, does this expression take in account the anisotropy of σ?
Thanks for the help!!!!!
Answers (1)
Torsten
on 31 Dec 2021
0 votes
4 Comments
Andrea Zacheo
on 31 Dec 2021
Edited: Andrea Zacheo
on 31 Dec 2021
According to the documentation, this should work:
specifyCoefficients(model,'f',@fcoeffunction,...)
function f = fcoeffunction(location,state)
N = 2; % Number of equations
nr = length(location.x); % Number of columns
f = zeros(N,nr); % Allocate f
% Now the particular functional form of f
f(1,:) = 0.0; % or whatever you want to set here
f(2,:) = 2.5*(state.ux(1,:)).^2+0.042*(state.uy(1,:)).^2;
end
If not, I wouldn't know.
Andrea Zacheo
on 31 Dec 2021
Torsten
on 31 Dec 2021
What do you get for
size(state.uy)
size(state.ux)
Are they equal ?
Categories
Find more on Boundary Conditions 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!