CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

Automatic integration COMSOL

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   November 19, 2012, 14:33
Question Automatic integration COMSOL
New Member
Diego Ubeda
Join Date: Mar 2009
Posts: 7
Rep Power: 8
Diego is on a distinguished road

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:


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?
Diego is offline   Reply With Quote

Old   November 20, 2012, 07:04
New Member
Diego Ubeda
Join Date: Mar 2009
Posts: 7
Rep Power: 8
Diego is on a distinguished road
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', ...

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 "" instruction.

Anybody knows how to do it??
Diego is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 07: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

All times are GMT -4. The time now is 16:41.