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.

How to get variable at a domain/boundary

Please login with a confirmed email address before reporting spam

Hi, I am running a thermal simulation. The variable is T. I want to use the average of T at a surface as a parameter in a function f(average(T_surface)) as an input for a temperature boundary condition. Can I do that? If so , how may I get the local T and what is the syntax for average it?

Thank you.


3 Replies Last Post 13 avr. 2023, 02:47 UTC−4
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 12 avr. 2023, 07:59 UTC−4

Hi Junfeng,

You can add an Average operator from the Definitions>Nonlocal Couplings menu. Then define it on the boundary (surface) where you want to compute the average. It will generate an operator with a name like aveop1. Use it somewhere in your model as aveop1(T) for the average temperature on that boundary.

Best regards,

Magnus

Hi Junfeng, You can add an **Average** operator from the **Definitions>Nonlocal Couplings** menu. Then define it on the boundary (surface) where you want to compute the average. It will generate an operator with a name like `aveop1`. Use it somewhere in your model as `aveop1(T)` for the average temperature on that boundary. Best regards, Magnus

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 12 avr. 2023, 19:46 UTC−4

Thank you so much! What if I directly use boundary probe. Will that automatically give me the average?

I did something before your answer. I defined two boundary probes (T_c, T_h) on two surfaces for T and then put into a variable in terms of f (T_c, T_h). When I used f as my input, I only defined on one of the surface. It ran through, but I am not sure whether that is what I wanted or not.

Thank you so much! What if I directly use boundary probe. Will that automatically give me the average? I did something before your answer. I defined two boundary probes (T_c, T_h) on two surfaces for T and then put into a variable in terms of f (T_c, T_h). When I used f as my input, I only defined on one of the surface. It ran through, but I am not sure whether that is what I wanted or not.

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 13 avr. 2023, 02:47 UTC−4

Hi Junfeng,

Yes, a boundary probe can be of an average type and would also work, but an average operator seems like a more flexible options. Probes are primarily intended for monitoring parts of the solution during a computation.

Best regards,

Magnus

Hi Junfeng, Yes, a boundary probe can be of an average type and would also work, but an average operator seems like a more flexible options. Probes are primarily intended for monitoring parts of the solution during a computation. Best regards, Magnus

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.