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

Setting time varying flow field in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2017, 11:01
Default Setting time varying flow field in OpenFOAM
  #1
New Member
 
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 11
Tings_ is on a distinguished road
Hello everyone,

I'm a newbie in OpenFoam. There is a problem which I have already searched from the internet for many days and still have not been solved.

The problem is : whether OpenFOAM is able to achieve the velocity like the following

U=sin(2*pi*y)*sin(pi*x)*cos(pi*t/T)

pi = 3.14
T is the period
t is the current time

Thanks
Tings
Tings_ is offline   Reply With Quote

Old   April 26, 2017, 12:22
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Guess, you need this velocity at the inlet boundary and x, y denote centres of faces. Use codedFixedValue BC. You can find an example in $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H.

Access to time is shown in example, you can access to face centres using patch().Cf() vector field.
alexeym is offline   Reply With Quote

Old   May 5, 2017, 06:48
Default
  #3
New Member
 
Francesco
Join Date: May 2012
Location: italy
Posts: 8
Rep Power: 14
phemt84 is on a distinguished road
Hi to all,
i'm also interested on this topic. I trying to impose an internal (non bc!!), non-uniform, time varying, velocity field.

specifically the field will should be

Ux = 2sin^2(pi*x)*sin(2*pi*y)*sin(2*pi*z)*cos(2*pi*t/T)
Uy = -sin(2*pi*x)*sin^2(pi*y)*sin(2*pi*z)*cos(2*pi*t/T)
Uz = -sin(2*pi*x)*sin(2*pi*y)*sin^2(pi*z)*cos(2*pi*t/T)

Any idea?

Thanks
Francesco
phemt84 is offline   Reply With Quote

Old   May 6, 2017, 06:01
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

@phemt84

It depends. If it is your own solver: just set velocity, cycle through cells, get centres, calculate velocity. If you need this velocity in standard solver, you can use codedFunctionObject (you add code to codeExecute section, so you set velocity on every runTime++).
alexeym is offline   Reply With Quote

Old   May 8, 2017, 10:37
Default
  #5
New Member
 
Francesco
Join Date: May 2012
Location: italy
Posts: 8
Rep Power: 14
phemt84 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

@phemt84

It depends. If it is your own solver: just set velocity, cycle through cells, get centres, calculate velocity. If you need this velocity in standard solver, you can use codedFunctionObject (you add code to codeExecute section, so you set velocity on every runTime++).
Hi alexeym,
first of all thanks for your answer. I will should use it with interFoam solver, specifically the result that i would like to obtain is this:

https://www.youtube.com/watch?v=tW0S6V6tg9E

I'm quite new in openFoam programming. Could you better explain the use of codedFunctionObject??

Thanks
phemt84 is offline   Reply With Quote

Old   May 8, 2017, 11:21
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
interFoam solves NS for get velocity. You want to impose internal field. It looks a little bit bizarre. If you need something calculated with isoAdvector, why don't you got to isoAdvector repository and just download case files?

Quote:
Could you better explain the use of codedFunctionObject??
Pardon?
alexeym 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
Setting boundary conditions for simple pipe flow with flow direction changing in time Sipher FLUENT 1 May 4, 2015 21:05
Flow around cube and cube natural convection Mirage12 OpenFOAM Running, Solving & CFD 5 June 15, 2013 12:20
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 23:40
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 05:03


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