|
[Sponsors] |
April 26, 2017, 11:01 |
Setting time varying flow field in OpenFOAM
|
#1 |
New Member
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 11 |
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 |
|
April 26, 2017, 12:22 |
|
#2 |
Senior Member
|
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. |
|
May 5, 2017, 06:48 |
|
#3 |
New Member
Francesco
Join Date: May 2012
Location: italy
Posts: 8
Rep Power: 14 |
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 |
|
May 6, 2017, 06:01 |
|
#4 |
Senior Member
|
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++). |
|
May 8, 2017, 10:37 |
|
#5 | |
New Member
Francesco
Join Date: May 2012
Location: italy
Posts: 8
Rep Power: 14 |
Quote:
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 |
||
May 8, 2017, 11:21 |
|
#6 | |
Senior Member
|
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:
|
||
|
|
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 |