Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 428

Accessing individual variables (source term, convection coeffs...) for coefficient of PDE form using MATLAB livelink

$
0
0
Hi,
I am using COMSOL Coefficient of PDE form. I want to implement Gauss Quadrature for Discrete ordinates method (discretization in angular space). The way I am doing it is:
Each PDE equation represents a particular direction.
a. Extract solution vectors in Matlab . The size of the vectors is [1,number_mesh_in_x]. For 4 'angular' directions the , the size will be [4,mesh_in_x].
b. Implment gauss quadrature by taking this array as the input.
c. Return this to COMSOL PDE Coefficient 'f' -> Source term.
I am stuck here as I am unable to access this variable from Matlab.
I tried using:
a. model.physics('I').feature('cfeq1').set('f', 'I_guess',pass_array here_for_a_direction**);
b. model.param.set('I_guess',{pass_cell here_for_a_direction**}, 'W/(m^2)');
** -> After computing values of I_guess (defined as a parameter in COMSOL) by quadrature function in MATLAB,

1. Could you please tell how to access the individual coefficients for a particular PDE.
2. Is it possible to pass an array as a coefficient in the coefficient of PDE form?

Viewing all articles
Browse latest Browse all 428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>