# Discussion Forum

Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

## computing accurate fluxes with periodic boundary conditions?

Hi everybody,

does anyone know if I can compute the fluxes accurately, as described in the user guide on page 308 ff. and file 0973 from the knowdledge database etc, when using periodic boundary conditions on the respective boundaries? In the descriptions, it is explained only for Dirichlet boundary conditions :( And if you think it should work, should I then use the weak constraint option? (and, how, if you have time to explain?) I model in the PDE mode of version 4.1. with matlab.

All best,
Sabine

2 Replies Last Post Jan 25, 2013, 7:42 PM EST
Posted: 5 years ago
Hi Sabine,

well.. if you know (at least you know where to look for) how to deal with Diriclet BC's, then you have just 2 options left:

- Neumann BC's: in this case what you look for is exactly what you prescribed (trivial)

- Robin BC's: write as follow: ( a*x + b*d(x) ) = f(x)
this is nothing but a combination of the two previous cases. of course you know somehow a, b, f(x). On the boundary you know x from the solution vector, so immediately comes d(x) which is the flux that you want.

since you're working with Matlab this shouldn't require a big effort. I didn't read thourgh the manual, but this is something that you can write yourself directly in Matlab!

Hope it helps!
Mattia

Posted: 5 years ago
Hi

another point I have noticed, is that to get good flux values along boundaries, you should ensure your mesh is fine while getting close to this boundary, by using edge pre-seeds, or even a boundary mesh (sometimes the latter requires further tweaking)

--
Good luck
Ivar

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.