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

Defining a parameter/variable/function that varies along a cutline on a 2D model to be used for a BC

$
0
0
Hi all,

I need to implement a boundary condition that will change as it's being applied. I'm not sure if this is possible, but it seems like it should be.

Specifically, I'm using the Poisson's equation solver and am implementing a flux/source BC. I need the BC to be a positive value if the electric potential at the point along the cut-line interface that it's being applied to is negative, and for the BC to be negative if the electric potential along the cut-line interface that it's being applied to is positive.

I already know how to make the BC a conditional, so now I just need to figure out how to make the conditional dependent on some sort of variable that will change as it's being calculated. The only experience I have with this is constant parameter values. For example, I make the BC = -5*(VBG>0) + 5*(VB<=0) where the VBG term is a parameter in a parametric sweep. This will apply the BC as a constant condition all the way across the line I specify. But, what I really need is some sort of parameter that will change as it's being applied based on the electric potential at each specific solution node such that if you were to start at the left of the line and move right, the BC would change in polarity depending on the electric potential as you move across the line.

Does anyone know if this is possible?

Thanks,

Buck

Viewing all articles
Browse latest Browse all 26527

Trending Articles