CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   non-linear BC and source (http://www.cfd-online.com/Forums/cd-adapco/54951-non-linear-bc-source.html)

Murali October 22, 2005 00:34

non-linear BC and source
 
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.

DenizeN October 22, 2005 06:37

Re: non-linear BC and source
 
But what is you problem ? Howe are you set the BC ? And what is not working ?

Murali October 22, 2005 13:18

Re: non-linear BC and source
 
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 ?

DenizeN October 24, 2005 13:49

Re: non-linear BC and source
 
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) ?

Murali October 25, 2005 18:01

Re: non-linear BC and source
 
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.


DenizeN October 27, 2005 07:29

Re: non-linear BC and source
 
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


All times are GMT -4. The time now is 16:24.