CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problems with equations discretization? (https://www.cfd-online.com/Forums/main/6695-problems-equations-discretization.html)

Pr October 14, 2003 07:24

Problems with equations discretization?
 
I have problem with discretizing the following equation.

u_t+(x**(1/3))u_x=c(t)

where u_t and u_x is the partial differentials of u w.r.t t and x respectively. and c is the time varycoeffcints let us say it is equal to sin(wt). I am using finite difference CN my solution blows up. So Is there anybody who had already encountered such a problem. Please advice me.

Praveen October 14, 2003 11:25

Re: Problems with equations discretization?
 
  1. What is your domain ?
  2. What are the boundary conditions ?
  3. What is the finite difference formula used ?
  4. Does CN = Crank Nicholson ?

Pr October 15, 2003 02:51

Re: Problems with equations discretization?
 
Yes thanks Praveen. 1)What is your domain ? It is simple one dimensional rectangular tube. # What are the boundary conditions ? when c(t)>=0 and u(a,t)=0,u_t=0 when c(t)<0 or u(a,t)<0 u_x=0 where x=a is at the wall. # What is the finite difference formula used ? I am uisng forward difference in time and backward difference in space(1-dimenisonal). # Does CN = Crank Nicholson ? yes it is I also checked with fully implict scheme.

IF it is enough if you need some more information . I can provide you. Pr


Tom October 15, 2003 05:06

Re: Problems with equations discretization?
 
CN is not (always) a good method for hyperbolic problems and this may be part of your problem. Have you tried using Lax-Wendroff?

Also have you compared your results with the exact solution which is

u = f(X) + C(t)

where C(t) = int_0^t c(s).ds, X=( t +x^2/3 )^3/2 and u(x) = f(x) at t=0.

You should also check whether your "boundary conditions" are consistent with the equation!

hope this helps,

Tom.

Pr October 15, 2003 05:15

Re: Problems with equations discretization?
 
Thanks tom,

Thanks for the sloution now I did not tried Lax wendroff method. But I want to know how did you obtain the exact solution for this problem.

Pr

Praveen October 15, 2003 05:37

Re: Problems with equations discretization?
 
Please see here for the derivation of exact solution. I think you are not applying correct initial and boundary conditions. Please let me know if this helps. Also I feel that a finite volume method would be more appropriate.

Tom October 15, 2003 05:51

Re: Problems with equations discretization?
 
It's called the method of characteristics. Basically along a characteristic curve a pde degenerates to system of odes which in your particular problem is

dx/dt = x^1/3, du/dt = c(t)

You can solve any first order pde (even nonlinear) using this method. In the above you have that du/dt = c along the curve (3/2)x^(2/3) = t + (3/2)X^(2/3) where X is a 'constant' of integration ( chosen sho that x=X at t=0) and so

u = f(X) + C(t) with X = ( x^2/3 - 2t/3 )^3/2

(I miss typed this last equation in the original post).

Any elementary book on pdes will cover this. The characteristics are very important in determining the types of boundary conitions (and numerical method used) to properly define a problem; e.g. if initial data is prescribed on a characteristic curve then it will be impossible to solve the pde.

Tom.

P.S. the corrected equation above indicates why the solution may be blowing up!

Pr October 15, 2003 06:03

Re: Problems with equations discretization?
 
Hi Thanks pravin and tom this was helpful I am just going thru it.

But I have certain msitakes in the equation let me specify it correctly.

I have problem with discretizing the following equation.

u_t+(x**(1/3))[1+(u_x)^2]^{1/2}=c(t) yes for larger value of u_x the equation will reduce to u_t+(x**(1/3))u_x=c(t)

where u_t and u_y is the partial differentials of u w.r.t t and y respectively. and c is the time varycoeffcints let us say it is equal to sin(wt). I am using finite difference CN my solution blows up. So Is there anybody who had already encountered such a problem. Please advice me.


Pr October 16, 2003 04:16

Re: Problems with equations discretization?
 
Hi Tom and Pravin. Please help me will there be any change with new equations then probabaly I will use the exact sloution and confirm the boundary conditions. Alo any suggestion with numerical schemes. I tried lax wendroff id does not work out for me. Thanks in advance Pr

Tom October 16, 2003 06:23

Re: Problems with equations discretization?
 
Your changed equation changes the form of the exact solution some what. If you define

p=u_t and q=u_x

then your equation becomes

F = p + x^(1/3).[ 1 + q^2 ]^(1/2) -c(t) = 0

you can then write down odes for x,p,q,u; e.g.

dp/dt = -dc/dt, dx/dt = x^(1/3)q.( 1 + q^2 )^(-1/2),

dq/dt = -(1/3)x^(-2/3).( 1 + q^2 )^(1/2)

du/dt = p + x^(1/3).q.( 1 + q^2 )^(-1/2)

at t=0 you will have x=s, u=f(s) => q = f'(s) => p from the governing equation. (Note that the p equation can be integrated exactly).

You can solve the above system using a standard time integration scheme (you can also reduce the number of equations by doing some/all of the integrations by hand) such as a 4th order Runge-Kutta for each initial point x=s.

Tom.

peter October 16, 2003 23:49

Re: Problems with equations discretization?
 
If your spatial domain includes any piece of the negative x-axis then your backward differencing is incorrect.

Pr October 17, 2003 03:11

Re: Problems with equations discretization?
 
I want to decise here clearly

The equation I have given is

u_t+(x**(1/3))[1+(u_x)^2]^{1/2}=c(t)

so basic it is like convection equation where convection of the wave is determined by (x**(1/3))[1+(u_x)^2]^{1/2},c(t) they are competing with each other c(t) is trying to move it from left to right and other term is trying to move it to right to left. As long as c(t) is greater than the other term the solution will be be positve and moving forwards. But as i said c(t) is a sin function so when it less than the other term the solution move back. This where I get some problem I do not understand peter what you meant by piece of negative x-axis.Can you elaborate. Thanks anyways. Pr

Tom October 17, 2003 04:33

Re: Problems with equations discretization?
 
Your interpretation of the behaviour of the pde is incorrect read my earlier post which explains how to solve the full nonlinear problem!

Pr October 17, 2003 05:07

Re: Problems with equations discretization?
 
Actually I will clarify with that I have already discretized the following equations with boundary conditions already specified u_t+A[1+(u_x)^2]^{1/2}=c(t) Where A is constant where the I used Backward difference and CN scheme which works perfectly well. When I took this problem u_t+(x**(1/3)[1+(u_x)^2]^{1/2}=c(t) where A is =x**(1/3) Uisng the same scheme sa above the solution blows up.And hence the problem.

Tom thanks for the help but I want to clearly write the full equation beacsuse the method of characteristics is somehwat new for me. Thnaks again


Peter October 19, 2003 14:17

Re: Problems with equations discretization?
 
if A is ever negative then your discretization violates the flow of information along characteristics. That would be a reason for the blow-up.

Pr October 20, 2003 04:31

Re: Problems with equations discretization?
 
Thanks peter, But A is never negative for my case. One more suggestion. If you suggesting something please try to be up to the point be more clear. Please do not take it otherwise. Pr

Peter October 20, 2003 20:38

Re: Problems with equations discretization?
 
>with boundary conditions already specified
:u_t+A[1+(u_x)^2]^{1/2}=c(t) Where A is constant
:I used Backward difference and CN scheme which works
:perfectly well. When I took this problem
:u_t+(x**(1/3)[1+(u_x)^2]^{1/2}=c(t) where A is
:=x**(1/3) Uisng the same scheme sa above the solution
:blows up.

Is your computational domain the interval x\in [0,a] ? If it is then the curve x=0, t\geq 0 (i.e., the time axis) is a characteristic boundary (since there x^{1/3} vanishes).

You should state your problem clearly if you expect anyone to help you.


All times are GMT -4. The time now is 17:56.