Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Boundary Intergration Coupling Variables

Please login with a confirmed email address before reporting spam

Hello,

For my problem, i need to define two boundary integration coupling variables. 1 calculating the force(integration of pressure), outside of a surface and the other calculating this force on the inside. Later i can use a global expression to calculate the difference between the two.
However i am having difficulties trying to scirpt this in Matlab. I've tried doing it in Comsol but to no affect. Problem is both coupling variables so up at each group of boundaries while only one of them should. I hope i can make this more clear by showing my Matlab code:

% Integration coupling variables
clear elem
elem.elem='elcplscalar';
elem.g={'1'};
elem.var={'FaIn','FaOut'};
elem.global={'1'};
elem.maxvars={'2'};
clear src;
src.ind={{'4','5','9'},{'17','18','22'}};
src.expr={{'p*nz'},{'p*nz'}};
src.ipoints={{'4'},{'4'}};
elem.src{1}={{},{},src};
fem.elemcpl=elem;

Thanks in advance,

AM

1 Reply Last Post Nov 5, 2009, 9:47 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 5, 2009, 9:47 a.m. EST
Ok, i have managed to get the boundary conditions the way i want them. However everytime i do a simulation the solver keeps on iterating and never seems to go pas 4e-3 convergence, after 4 iterations the stepsize doesnt decrease any further. Why does this happen?

My code:

% Coupling variable elements
clear elemcpl
% Integration coupling variables
clear elem
elem.elem = 'elcplscalar';
elem.g = {'1'};
src = cell(1,1);
clear bnd
bnd.expr = {{{},'p*nz',{}},{{},{},'p*nz'}};
bnd.ipoints = {{{},'4',{}},{{},{},'4'}};
bnd.frame = {{{},'ref',{}},{{},{},'ref'}};
bnd.ind = {{'1','2','3','6','7','8','10','11','12','13','14','15','16', ...
'19','20','21','23'},{'4','5','9'},{'17','18','22'}};
src{1} = {{},{},bnd,{}};
elem.src = src;
geomdim = cell(1,1);
geomdim{1} = {};
elem.geomdim = geomdim;
elem.var = {'FaIn','FaOut'};
elem.global = {'1','2'};
elem.maxvars = {};
elemcpl{1} = elem;
fem.elemcpl = elemcpl;

Thanks
Ok, i have managed to get the boundary conditions the way i want them. However everytime i do a simulation the solver keeps on iterating and never seems to go pas 4e-3 convergence, after 4 iterations the stepsize doesnt decrease any further. Why does this happen? My code: % Coupling variable elements clear elemcpl % Integration coupling variables clear elem elem.elem = 'elcplscalar'; elem.g = {'1'}; src = cell(1,1); clear bnd bnd.expr = {{{},'p*nz',{}},{{},{},'p*nz'}}; bnd.ipoints = {{{},'4',{}},{{},{},'4'}}; bnd.frame = {{{},'ref',{}},{{},{},'ref'}}; bnd.ind = {{'1','2','3','6','7','8','10','11','12','13','14','15','16', ... '19','20','21','23'},{'4','5','9'},{'17','18','22'}}; src{1} = {{},{},bnd,{}}; elem.src = src; geomdim = cell(1,1); geomdim{1} = {}; elem.geomdim = geomdim; elem.var = {'FaIn','FaOut'}; elem.global = {'1','2'}; elem.maxvars = {}; elemcpl{1} = elem; fem.elemcpl = elemcpl; Thanks

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.