|
[Sponsors] |
November 19, 2012, 13:33 |
Automatic integration COMSOL
|
#1 |
New Member
Diego Ubeda
Join Date: Mar 2009
Posts: 7
Rep Power: 17 |
Hello,
I have a COMSOL 3.5 3D simulation in which I would like to calculate the integral of a specific variable over just a portion of a boundary, not over the whole boundary. I know that I can do this by simply specifying the x and y coordinates that define the region I want to deal with as follows: f(x,y)*(x>A)*(x<B)*(y>C)*(y<D) My problem is that I want to divide this boundary in 100 portions and to calculate the integral of the function f(x,y) in all of them. Doing the same thing (only changing the coordinates) 100 times and for many different files seems really irksome to me, so I was wondering if there is a way to do this automatically. I had thought about writing the necessary commands in a *.m file and executing it, but I don't see how I can export the values of the integrals to a *.txt file or similar. Does anybody have a clue? |
|
November 20, 2012, 06:04 |
|
#2 |
New Member
Diego Ubeda
Join Date: Mar 2009
Posts: 7
Rep Power: 17 |
Well, I could figure it out. With the command xlswrite('filename.xls', data), I can get a xls file with the data resulting from the integration. That would be:
vJ=postint(fem,'f(x,y)*(x>J)*(y>J)', ... 'unit','units', ... 'recover','off', ... 'dl',[Boundaries] xlswrite('filename.xls', vJ) My problem now is that J takes 100 different values, so I would like to define a counter variable in order to use something similar to a "for...next" instruction. Anybody knows how to do it?? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How are the integration constants for the JANAFthermo class derived? | tomf | OpenFOAM Running, Solving & CFD | 2 | May 15, 2015 07:47 |
Fluent Integration Numerics | RodriguezFatz | FLUENT | 11 | February 21, 2013 06:35 |
Pros and Cons for CFX, CFdesign, COMSOL | Val | Main CFD Forum | 3 | June 10, 2011 02:20 |
pressure distribution in water flow, differences in icoFoam and COMSOL | deniggo | OpenFOAM Running, Solving & CFD | 14 | September 30, 2010 03:48 |
transient simulation of a rotating rectangle | icesniffer | CFX | 1 | August 8, 2009 07:25 |