|
[Sponsors] |
July 31, 2017, 10:09 |
Initialize a field with function
|
#1 |
New Member
Oğuzhan Demir
Join Date: Dec 2016
Posts: 19
Rep Power: 10 |
Hi,
I would like to initialize my velocity field (U) with a function, for example a sine function depending on x-coordinate of the cell. Is there a way to do that? I am using OF-4.0.x version. Thanks in advance. Oguzhan |
|
July 31, 2017, 10:34 |
|
#2 |
New Member
Join Date: Mar 2015
Posts: 16
Rep Power: 11 |
Hi,
You can use funkySetFields from swak4foam to do that. |
|
July 31, 2017, 10:44 |
|
#3 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
To add to that, here is a small example to initialise a spherical bubble in interFoam:
Code:
funkySetFields -latestTime -keepPatches -field alpha.water -expression "sqr(pos().x-0)+sqr(pos().y-0)+sqr(pos().z-.00150)<sqr(0.0005)?0:1" |
|
July 31, 2017, 12:06 |
|
#4 |
New Member
Oğuzhan Demir
Join Date: Dec 2016
Posts: 19
Rep Power: 10 |
Thanks for your advise. But I am unable to install swak4Foam for my current OpenFOAM 4.xx version. Any tips?
Oguz |
|
July 31, 2017, 12:07 |
|
#5 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
||
July 31, 2017, 12:09 |
|
#6 | |
New Member
Oğuzhan Demir
Join Date: Dec 2016
Posts: 19
Rep Power: 10 |
Quote:
https://openfoamwiki.net/index.php/I...opment_version and https://openfoamwiki.net/index.php/I...tion/swak4Foam but couldn't install and compile it. I know that it may be a simple problem but could you help on that? Thanks a lot man. |
||
July 31, 2017, 12:23 |
|
#7 | ||
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
Quote:
Quote:
Where exactly does it fail? What is the error? |
|||
August 1, 2017, 05:31 |
|
#8 |
New Member
Oğuzhan Demir
Join Date: Dec 2016
Posts: 19
Rep Power: 10 |
I have installed swak4Foam correctly and solved my problem. Thanks.
Oguz |
|
August 1, 2017, 11:50 |
|
#9 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
Hello Oğuzhan,
How did you install it swak4Foam? can you post the link? Thanks |
|
August 1, 2017, 11:54 |
|
#10 | |
New Member
Oğuzhan Demir
Join Date: Dec 2016
Posts: 19
Rep Power: 10 |
Quote:
https://openfoamwiki.net/index.php/I...opment_version https://openfoamwiki.net/index.php/C...m/Installation You may have problems regarding to bison, you can install it using the instructions also. Oguzhan |
||
Tags |
function, nonuniform, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
cannot find grid field function in custom field function | mehdiataei | FLUENT | 0 | March 19, 2017 05:53 |
[snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 15:07 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 05:37 |