|
[Sponsors] |
October 22, 2005, 01:34 |
non-linear BC and source
|
#1 |
Guest
Posts: n/a
|
Hi,
Does anybody know how to program a non-linear boundary condition for a user-defined scalar ? Consider this example: d^c dc --- + (--)^2 = 0 dx^2 dx With boundary condition: @x=0 C=0 dC @x=1 -- = C^2 -----> Non- linear boundary condition dx The analytical solution of this is : e(1-exp(-x)) ------------ (e-1)^2 SORSCA with POSDAT works fine for modeling source terms. But how to model a non-linear BC ? It seems to be not working through BCDEFW and POSDAT. I tried to put it as source in the last cell, but it fails too. Please let me know. |
|
October 22, 2005, 07:37 |
Re: non-linear BC and source
|
#2 |
Guest
Posts: n/a
|
But what is you problem ? Howe are you set the BC ? And what is not working ?
|
|
October 22, 2005, 14:18 |
Re: non-linear BC and source
|
#3 |
Guest
Posts: n/a
|
My problem is as follows:
BCDEFW is the subroutine where we set user defined scalar value. since my boundary condition is non-linear I have to use POSDAT to calculate the non-linear value and pass this value to BCDEFW. i.e in BCDEFW I would have some code like: Code in POSDAT: =============== COMMON /MYSCALAR/SCALVAL IF (IBND .EQ. -42) THEN SCALVAL = T(ICELL,1+1)^2 END IF (IBND is the boundary number) Code in BCDEFW: ============== COMMON /MYSCALAR/SCALVAL IF (IBSTAR .EQ. 42) THEN SCALAR(01) = SCALVAL END IF The SCALVAL is originally calcualted using POSDAT at level 1 and passed by COMMON block to BCDEFW. SOmehow, this does not seem to yield proper results (convergence is attained though). Is there anything more to do when I write non-linear boundary conditions ? |
|
October 24, 2005, 14:49 |
Re: non-linear BC and source
|
#4 |
Guest
Posts: n/a
|
Whay You are not write:
Code in BCDEFW: ============== COMMON /MYSCALAR/SCALVAL IF (IBSTAR .EQ. 42) THEN SCALAR(01) = TC^2 END IF or something else like this ? why you use POSDAT ? what function you want to calculate ? may be you write what are you want to do. You must set function on boundary type f(Temperature) ? |
|
October 25, 2005, 19:01 |
Re: non-linear BC and source
|
#5 |
Guest
Posts: n/a
|
Dear Denizen,
When I tried that it is always diverging. Can you do a favor ? Can you just send me a small (working) example of STAR-CD subroutine code where you have succesfully implemented a non-linear Bouncary condition. say for example dc/dx = c^2 please ? It will be must appreciated. |
|
October 27, 2005, 08:29 |
Re: non-linear BC and source
|
#6 |
Guest
Posts: n/a
|
I have'not prepeared code to you situation. But i do not see any problem to calculfnt you BC.
Code in BCDEFW: ============== COMMON /MYSCALAR/SCALVAL IF (IBSTAR .EQ. 42) THEN SCALAR(01) = e(1-exp(-x))/(e-1)^2 END IF but you are must set offset to you BC this analitical solution means x=from 0 to .... but you BC is located somwhere x=from 45.54 to 99.34 ensure that it is all fine |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
linear and areal pollutant source | Riccardo Buccolieri | FLUENT | 1 | February 27, 2014 08:57 |
contribution of convective source in total source? | Antony | Phoenics | 4 | July 30, 2008 06:15 |
high positive linear source term using FEM | Isi | Main CFD Forum | 0 | June 11, 2008 04:46 |
Linear Solvers | Sachin | Main CFD Forum | 0 | May 6, 2006 13:07 |
where do I find a source code to solve a linear ma | Wang | Main CFD Forum | 2 | May 6, 2004 14:28 |