OF/groovyBC: 2nd derivative or power BC
It recently occurred to me that I have no idea how to impose a BC of the following two sorts:
i) d^2 (X) / dn^2 = 0 ii) d(X) / dn = X^2 Even though they appear rarely, they are used in the literature. Is there a way to impose them natively in OF or in groovyBC? |
Quote:
Power: that is easy: the "pow(X,2)". Although that is "only" explicit as it uses the current value of X to set a gradient for the "next" X |
Thanks! I should have imagined the second one, seems obvious now.
|
Quote:
I was wondering if implementing a convective bc like this: dU/dt + Un*dU/dn = 0, is possible by using groovy bc. Could you help me?? Thanks in advance!! Best, |
Quote:
Also does the behaviour of oldTime depend on the solver storing the last time-step value. You'll have to experiment |
Quote:
This is what I have tried but my code blows up at the 3rd time step: type groovyBC; refValue uniform (1 0 0); refGradient uniform (1 0 0); valueFraction uniform 0; value uniform (1 0 0); gradientExpression "-(U-oldTime(U))/deltaT()"; fractionExpression "0"; Would you know what is wrong?? It is supposed that gradientExpression calculates the field derivative normal to the domain... Thank you! Best! |
Quote:
The problem is not groovyBC per se (it gets to the 3rd timestep) but the physics or the implementation of it. My time is limited and I limit myself to problems with swak itself. Just some hints: check the sign, try under-relaxation, but first write out all timesteps (its only three after all) and try to figure out what goes wrong (my guess is: the BC leads to oszillations because of overcorrection) |
Hello maalan! Have you managed to make the BC work? I've tryied the one that you wrote and my code also blows up on the third time step!
I'm new to OF so I have no ideia how to fix it :confused: Thank you |
All times are GMT -4. The time now is 06:07. |