Anisotropic f coefficient for PDE solving

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!!!!!

Antworten (1)

Torsten
Torsten am 31 Dez. 2021

0 Stimmen

4 Kommentare

Andrea Zacheo
Andrea Zacheo am 31 Dez. 2021
Bearbeitet: Andrea Zacheo am 31 Dez. 2021
Hi thanks for the asnwer, but under the page 2-79 of the manual, there is the explanation of the c coefficent, nothing related to the f coefficent.
The given error is: Number 1 of rows in the f coefficient matrix must be equal to the number 2 of equations in the system.
Torsten
Torsten am 31 Dez. 2021
Bearbeitet: Torsten am 31 Dez. 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
Andrea Zacheo am 31 Dez. 2021
That's exactly what I wrote :( :(
What do you get for
size(state.uy)
size(state.ux)
Are they equal ?

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 31 Dez. 2021

Kommentiert:

am 31 Dez. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by