CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

How to define in inlet boundary condition a time-varying and non-uniform condition

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By piu58

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2017, 15:48
Exclamation How to define in inlet boundary condition a time-varying and non-uniform condition
  #1
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Hi,

I am trying to set an inlet boundary condition for a simulation similar to wind tunnel testing.

The inlet boundary condition for the velocity should be a table or list (that I have already generated using some numerical models)

The table has the velocities as a matrix that has a number of rows equal to the inlet cells or faces, and a number of columns equals to the number of time steps for the LES simulation.

I will be using the pisoFoam model and I wonder what type of boundary condition to map these list that varies with location and time step.

I tried to use nonuniform List<vector>, but it only varies with location and doesn't vary with time

Also, the timevaryingmappedfixedvalue varies with time and doesn't vary with location

Can anyone help me with this please?
ahmyaser is offline   Reply With Quote

Old   June 3, 2017, 01:08
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
> and doesn't vary with time

There may be more advanced techniques, but there is also an easy way: Stop the simulation after each time step, use a script to change the b.c. and start the next time step.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 3, 2017, 22:35
Default
  #3
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Quote:
Originally Posted by piu58 View Post
> and doesn't vary with time

There may be more advanced techniques, but there is also an easy way: Stop the simulation after each time step, use a script to change the b.c. and start the next time step.

Thank you very much piu58, Can you give me a quick guidance on how to to change the b.c each time step ???

Thanks again
ahmyaser is offline   Reply With Quote

Old   June 4, 2017, 00:01
Default
  #4
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
I don't konw in which form your b.c. exists. The easiest way is to prepare pattern files for all the b.c. objects in your 0 directory in the form
Code:
internalField   nonuniform List<scalar> 
32336
(
#0
#1
#2
:
)
You may replace the #0 and so on by a sed script which you generate from your list:

Code:
's/#0/myBoundaryCondition_0/'
's/#1/myBoundaryCondition_1/'
:
ahmyaser likes this.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 5, 2017, 11:48
Default
  #5
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Quote:
Originally Posted by piu58 View Post
I don't konw in which form your b.c. exists. The easiest way is to prepare pattern files for all the b.c. objects in your 0 directory in the form
Code:
internalField   nonuniform List<scalar> 
32336
(
#0
#1
#2
:
)
You may replace the #0 and so on by a sed script which you generate from your list:

Code:
's/#0/myBoundaryCondition_0/'
's/#1/myBoundaryCondition_1/'
:
Thank you very much, piu58. for your great help and sorry for asking so many questions as I am new somehow to openFoam. I just wonder how can I let the solver know that this list is assigned to that time step? in other words, how do I link each time step to a certain list of inflow?

Your help is so much appreciated !!
ahmyaser is offline   Reply With Quote

Old   June 5, 2017, 12:43
Default
  #6
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
The solver read what it is in the <timestep> directory. At the beginning this is the 0 folder. You have to manipulate / replace the files in the directory of the last timestep.
Of course you have to set the startFrom entry in the controlDict file to latestTime.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 5, 2017, 12:45
Default
  #7
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Quote:
Originally Posted by piu58 View Post
The solver read what it is in the <timestep> directory. At the beginning this is the 0 folder. You have to manipulate / replace the files in the directory of the last timestep.
Of course you have to set the startFrom entry in the controlDict file to latestTime.
That is a great idea!! thanks a lot. you are a lifesaver
ahmyaser is offline   Reply With Quote

Old   June 5, 2017, 12:48
Default
  #8
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Quote:
Originally Posted by piu58 View Post
The solver read what it is in the <timestep> directory. At the beginning this is the 0 folder. You have to manipulate / replace the files in the directory of the last timestep.
Of course you have to set the startFrom entry in the controlDict file to latestTime.
just a last (hopefully) question to make this replacement for each time step. where should I do a script for that? is it at the controlDict derctory?
ahmyaser is offline   Reply With Quote

Old   June 5, 2017, 15:10
Default
  #9
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
You need to let the simulation run by a shell script in the form
loop:
- prepare the b.c. with sed
- start pimpleFoam or what solver you want to have (needs to stop after one time step)
endloop
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 5, 2017, 15:18
Default
  #10
New Member
 
Ahmed Elshaer
Join Date: May 2014
Posts: 6
Rep Power: 11
ahmyaser is on a distinguished road
Quote:
Originally Posted by piu58 View Post
You need to let the simulation run by a shell script in the form
loop:
- prepare the b.c. with sed
- start pimpleFoam or what solver you want to have (needs to stop after one time step)
endloop
Thanks, can you let me know what is (sed) ?
ahmyaser is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 23:19.