Clear Filters
Clear Filters

3D Multi-Domain PDE Modelling

25 views (last 30 days)
ADSW121365 on 6 Jan 2020
Edited: ADSW121365 on 15 Jun 2020
The associated geometry for my problem is given below, where cell 1 is the current containing region and cell 2 is the surrounding space. The mesh is produced via gmsh and imported to MATLAB to deal with the limitations noted here:
An example code to do this is given below, please excuse the terrible use of global variables in this piece of demo code:
clear,close all; clc;
N = 3; %Number of Equations
model = createpde(N); %Value = #Variables
%% Import gmsh mesh:
elements = msh.TETS;
geom2 = geometryFromMesh(model,nodes,elements);
%% Variables:
global I_mag N_wire L_inner L_outer Z_height mu_o
I_mag = 20;
N_wire = 861;
Z_height = 8.89e-2;
L_inner = 10.42e-2;
L_outer = 15.24e-2;
mu_o = 4*pi*10^(-7);
%% Region 1:
c_coeff = zeros(9*N^2,1);
c_coeff = c_coeffassign_2v(c_coeff,N);
specifyCoefficients(model,'m',0,'d',0,'c',c_coeff,'a',0,'f',@f_coeffunction,'Cell',1); %Outer
%% Region 2:
c_coeff = zeros(9*N^2,1);
c_coeff = c_coeffassign_2v(c_coeff,N);
%% Solving:
results = solvepde(model);
vals = results.NodalSolution;
The code as given provides error message:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 7.084396e-18.
> In pde.EquationModel/solveStationary (line 49)
In pde.PDEModel/solvepde (line 74)
Other Attempts and Related Work:
The addition of a second boundary condition on this (the commented out one in the above) removes this singular warning however the solution is then nearly all zeros.
I have also tried using neumann conditions in various formats for the two regions to no avail. Combinations of dirichlet for one region and Neumann for the other have also been considered.
In the context of the PDE Toolbox, what does the singular warning actually mean? I'm assuming there is some error in my setup somewhere.

Accepted Answer

Ravi Kumar
Ravi Kumar on 7 Jan 2020
Thanks for taking time to explain the problem with such a detail and for providing the reproduction code. I tried to understand and reproduce the behavior. However, one function you have used in f_coeffunction_2v.m, quad_find(), is missing from the attachment. It would help if you can attach that.
While I still don’t fully understand the setup of f-coefficient, I don’t have access to the paper, I think I sort have a clue what is going on. First, we need to understand how the two volumes (subdomains C1 and C2) that form the problem domain are related. As per the current setup, I don’t see any coupling between C1 and C2. That is C1 will have its own set of elements and C2 will have its own. Refer to this mesh plot below that I obtained using the commands:
elementsSection = model.Mesh.findElements('box',[0.0,0.5],[-0.6,0.6],[-0.6,0.6]);
I guess this is not what you intend to model, right? I am guessing you want model the conductor at the center and volume of air around it to solve for A in that air domain. If so, then I think you need subdomains that don’t overlap but share interface boundaries. Would you have able to generate the mesh in gmsh such that two volumes stay separate?
JJC on 13 May 2020
How was the mesh issue solved?
ADSW121365 on 15 Jun 2020
Edited: ADSW121365 on 15 Jun 2020
The Coherence; command at the start of my GMSH script.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!