CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   how i can solve this unsteady problem (http://www.cfd-online.com/Forums/main/92137-how-i-can-solve-unsteady-problem.html)

sarmadi September 3, 2011 07:05

how i can solve this unsteady problem
 
i want to solve unsteady flow around a airfoil, i solved steady viscous flow by psay and omega with iterative method before, now i want to change steady to unsteady.........please help me

cfdnewbie September 4, 2011 07:06

are you asking for help programming an unsteady solver or using an existing one??

sarmadi September 4, 2011 09:25

reply
 
yes i want an unsteady solver for finite diffrences method,thanks

cfdnewbie September 4, 2011 14:10

Quote:

Originally Posted by sarmadi (Post 322837)
yes i want an unsteady solver for finite diffrences method,thanks

So if I understand you correctly, you already have an explicit FD solver which you use to do pseudo timestepping to steady state? if that's the case, you are almost already there...

sarmadi September 5, 2011 02:41

ok
 
ok, i have a code that solve steady state flow FD , but now i want to solve unsteady state flow with FD and be expllicit,thank you, do you have it?

cfdnewbie September 5, 2011 03:10

No, I don't, but if you already HAVE a FD code which solves the time integration in a pseudo timestepping, you are done....that's why you need to state what time integration you use in your steady state solver!
Two options:
a) pseudo time stepping in an explicit way -> you are done
b) implicit i.e. matrix solver -> you need to post back and I will try to help you!

sarmadi September 5, 2011 03:20

ok, i use iterative method like LSOR or gous method for solving psi and omega in steady state

cfdnewbie September 5, 2011 03:30

Quote:

Originally Posted by sarmadi (Post 322878)
ok, i use iterative method like LSOR or gous method for solving psi and omega in steady state


I guess you mean "Gauss" ;) Could you tell me what psi and omega are? I'm not familiar with that notation....

Here is what you have to do: the equation you want to solve is/must be written in differential form, sth like:

du/dt + a du/dx + b du/dy = s, where u can be a (x,y) vector). Explicit timestepping goes as follows: Write the above equation as

du/dt +R(u) = 0, where R(u) is called the residual, i.e. the spatial operator. Now use your code and identify the parts where R(u) is evaluated. Note that R(u) must be evaluated at t=n, so at the given/known time step.

so evaluate R(u) at u=u(n) and plug that into du/dt=-R(u). At that time, you have turned your PDE into an ODE.
Now just integrate the ODE in time, the simplest would be by an Euler approach:

du/dt = (u(n+1)-u(n))/delta t

That gives you u(n+1)!

clear so far? :)
Cheers!

sarmadi September 5, 2011 03:51

ok, it s time that i clear my mean for you
i have navier stokes equation for solving
that includes: momentum and continuety eqn.
one method for solving them is using vortisity yhat is du/dy-dv/dx=w;
and using psi that have gradiant^2(psi)=-w;
so i have two elliptic eqn for steady state manner that should solve together;
when i chang it to unsteady manner i have an elliptic eqn and a parabolic eqn and i need to solve them together but i dont know how??????
thank you

cfdnewbie September 5, 2011 05:37

Well, you have to write your equations in that form (just 1d, scalar example):

du/dt + R(u)=0, where all the spatial derivatives go into R(u). That can be first, second, or any order derivatives..... just group them all together, and approximate them with your finite differences in the way you know!

Then, you get an ODE in time (for psi and vorticity e.g.). You can solve that ODE in a time stepping way, like an Euler or standard Runge-Kutta approach (given that your whole discretization is stable!).

sarmadi September 6, 2011 02:37

thank you for trying, my problem is that my both eqn are dependent to each other

cfdnewbie September 6, 2011 04:00

Quote:

Originally Posted by sarmadi (Post 323043)
thank you for trying, my problem is that my both eqn are dependent to each other

uh...:confused::confused::confused:... Navier Stokes equations or Euler equations are also dependent on one another... so I guess I don't understand your problem??

sarmadi September 6, 2011 07:43

dont be confused
 
please calm down,
it is not confusing problem
so consider you want to solve unsteady flow around an airfoil(Naca 12) and this flow is viscous and incompressible and laminar
before that i solve steady flow for cavity

cfdnewbie September 6, 2011 07:53

Quote:

Originally Posted by sarmadi (Post 323084)
please calm down,
it is not confusing problem
so consider you want to solve unsteady flow around an airfoil(Naca 12) and this flow is viscous and incompressible and laminar
before that i solve steady flow for cavity


ok, I'm all relaxed again :=)

I guess I don't understand your remark from above:

my problem is that my both eqn are dependent to each other

If you solve the NS equations in standard formulation (rho, u,p...), your equations are (of course) dependent on each other, as for example the rho-equation contains terms with u,v,w in them. If you reformulate the NS equations in terms of vorticity and other quantities, the equations are again dependent on each other...

So that doesn't introduce any new problem, right? You can solve your NS equations in your formulation in the same way you would solve them in any other formulation....if you use explicit timestepping, that's easier than for implicit...

sarmadi September 6, 2011 08:16

yeah
now plz answer me???
how i can impose time step and solve iterative????

cfdnewbie September 6, 2011 08:25

Ok, I will try again:

Write your equation as du/dt +R(u)=0. R(u) contains all spatial derivatives. U is your vector of solution variables, so vorticity and whatever else for you.

1) You start at timelevel 0 with your initial solution/projection. So you know U at t=0. compute R(U(t=t0)) with that information.

2) Now look at du/dt = -R(U(t=0)). Compute du/dt from 1) (trivial, just minus)

3) discretize du/dt in any way you choose. Look up ODE solvers, but standard are Runge Kutta schemes. Let's say you picked du/dt = (u(n+1)-u(n))/delta t. n+1 = solution at NEW time step, n= solution at time step t=0, the one you know from your initial condition.

4) so you have: u(n+1)=u(n)-delta t * R(u(n)). Compute u(n+1) from that -> that's your new timestep

5) repeat this procedure till you reached your final time...

Did this help?

cheers!

sarmadi September 6, 2011 08:34

yes, i know what you say and it is completly true.
so in U i have pressure how i update it????

cfdnewbie September 6, 2011 08:54

Quote:

Originally Posted by sarmadi (Post 323094)
yes, i know what you say and it is completly true.
so in U i have pressure how i update it????

Ok, good question...you would have to compute the pressure from your state variables, so vorticity and the other thing in each step. I haven't done this before, there might be an easier way. I suggest you ask your professor, he or she should know!


All times are GMT -4. The time now is 13:15.