Unsteady flow code - Problem with space loop

Click For Summary

Discussion Overview

The discussion revolves around a coding issue related to unsteady flow simulations, specifically focusing on the implementation of space loops in the context of numerical methods for solving ordinary differential equations (ODEs). Participants explore the necessity of boundary conditions and initial conditions in their formulations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a loop structure where the velocity at each element depends on the previous element, raising concerns about the lack of values at the first element (i=1).
  • Another participant suggests that a boundary condition should define the variable at i=1.
  • A different participant proposes that the values at i-1 could be set equal to the values at the walls of the elements when applicable, questioning the sensibility of this approach.
  • One participant emphasizes the need for initial conditions at the start time, while another insists that boundary conditions are also essential for accurately modeling fluid behavior.
  • Another participant reiterates that both boundary and initial conditions are necessary, particularly for understanding flow behavior near surfaces and at infinity.
  • One participant expresses frustration about being stuck and reiterates the need for guidance on handling the space loop.
  • A later reply indicates that without more information on boundary and initial conditions, it is challenging to provide further assistance.

Areas of Agreement / Disagreement

Participants generally agree that both boundary conditions and initial conditions are important for the problem at hand. However, there is disagreement on how to specifically implement these conditions in the context of the space loop, and the discussion remains unresolved regarding the best approach to take.

Contextual Notes

Participants express uncertainty about the specific boundary and initial conditions required for the problem, indicating that the effectiveness of proposed solutions may depend on these definitions.

hoomanya
Messages
86
Reaction score
0
Hi all,
I have discretized my equations in a way that for example the velocity depends on the velocity of the previous neighboring element so:

h = number of elements
t = 0: 0.5 : 10
for j= 1 : length(t)
for i = 2: h
v(i,j) = v(i-1,j) + b
p(i,j) = p(i,j) +b
end
end


This is not my actual formulations(codes) but the idea is that I need the value of the variable at the previous element so I start my loop from 2 to avoid getting i=0. But then this means that I don't have any values when I have i = 1 in the code. Is the only way to deal with this using boundary conditions. For example setting the value of the variable at i = 1 to be equal to that at i =2 ?

I hope I am clear enough.

Thanks.
 
Physics news on Phys.org
You should have a boundary condition that defines your variable at i=1.
 
Looking at my equations again, I think a possibility would be to make the values at i-1 equal to the values at the walls of the elements/ cells when possible. Is that a sensible thing to do?
 
No I don't think that's doable. ...hmmm .. .still stuck!
my equations are a set of ODEs of the form:

dy/dt = f(y,t)
 
You need an initial condition at whatever your start time is.
 
my problem is with space loop . I have initial conditions. I think I need boundary conditions...
 
Well it is a fluid problem, so you obviously need both. You will need boundary conditions to get the physical nature of the flow as far as what happens when it approaches surfaces, or infinity and you will need initial conditions to get a time history.
 
I know that. Like I said I have my initial conditions sorted. I need to know how to deal with this space loop...
 
Well without knowing more I suppose we can't really help you. You need to set velocities to zero at walls and free stream at infinity or whatever else your system requires. We don't know your BCs or ICs, so I don't know what you expect with so little information.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K