Quiet@Remove["Global`*"];
$HistoryLength=2;
SetDirectory[NotebookDirectory[]];

div[v_]:=Div[v,{r,fi,z},"Cylindrical"];
rot[v_]:=Curl[v,{r,fi,z},"Cylindrical"];
grad[s_]:=Grad[s,{r,fi,z},"Cylindrical"];

hvect={0,0,Hz[r]};
evect={0,Efi[r],0};
rce1=Thread[rot[evect]==-I*ω*μ*hvect][[3]];
rce2=Thread[rot[hvect]==γ*evect][[2]];
sol1=DSolve[{rce1,rce2},{Hz[r],Efi[r]},r][[1]];
sol2=Simplify[sol1/.C[2]->0,{r>0,γ>0,ω>0,μ>0}];
hacko1[r_]=Hz[r]/.sol2;
dosC=Solve[hacko1[R]==HR,C[1]][[1]];
hacko[r_]:=hacko1[r]/.dosC;
ecko[r_]=(Efi[r]/.sol2)/.dosC;

cm=0.01;
dosTry={μ->4.*Pi*(10^(-7)),R->7cm,ω->31.4,γ->0.3*57*(10^6),HR->1};
Plot[Abs[hacko[r]/.dosTry],{r,-7cm,7cm},AxesOrigin->{0,0},PlotRange->All,AxesLabel->{"r[m]","Hz[r][A/m]"},PlotStyle->{Blue,Thickness[0.006]},GridLines->Full]

dosTry={μ->4.*Pi*(10^(-7)),R->7cm,ω->3140,γ->0.3*57*(10^6),HR->1};
Plot[Abs[ecko[r]/.dosTry],{r,-7cm,7cm},AxesOrigin->{0,0},PlotRange->All,AxesLabel->{"r[m]","Efi[r][V/m]"},PlotStyle->{Red,Thickness[0.006]},GridLines->Full]

dosTry={μ->4.*Pi*(10^(-7)),R->7cm,ω->31400,γ->0.3*57*(10^6),HR->200};
rmax=R/.dosTry;
Print["a= ",a=(Sqrt[(2/(ω*γ*μ))])/.dosTry," m"];
QV=((Abs[γ*ecko[r]/.dosTry])^2);
Plot[QV,{r,-7cm,7cm},AxesOrigin->{0,0},PlotRange->All,AxesLabel->{"r[m]","QV[W/(m^3)]"},PlotStyle->{Red,Thickness[0.006]},GridLines->Full];
c=394.;
ρ=8700.;
λ=120;
rmin=0.1cm;
rce={ρ*c*D[T[r,t],t]==div[λ*grad[T[r,t]]]+QV,T[r,0]==20,D[T[r,t],r]==0/.r->rmin,D[T[r,t],r]==0/.r->rmax};
tmax=3;
solT=NDSolve[rce,T,{r,rmin,rmax},{t,0,tmax}][[1]];
teplota=T/.solT;
Plot3D[T[r,t]/.solT,{r,rmin,rmax},{t,0,tmax},PlotRange->All,PlotPoints->50]

a