|
[Sponsors] |
[swak4Foam] funkySetFields and funkySetBoundaryFields |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 24, 2012, 12:08 |
funkySetFields and funkySetBoundaryFields
|
#1 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
Hello everyone,
I am a beginning user of funkySetFields utility. I want to set the cyclic velocity BC from the inlet to outlet with pressure gradient. I have questions: 1. Can I define the patch type as cyclic or the general patch in the blockMeshDict? 2. If I want to set the U and P field using the funkySetFields utility, is it necessary to set these first in '0' directory. Then using funkySetFields. 3. What about funkySetBoundayFields? http://openfoamwiki.net/index.php/Co...funkySetFields 4. Is there any tutorials about the funkySetFields or sample cases of it? |
|
February 24, 2012, 17:11 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
@2: Your question is "Do I have to create an U-file before setting the initial condition with FSF?", right? Answer: You don't have to (use the -create-option), but then you'll probably have to edit the resulting file to get decent boundary conditions @3: that can be used to set arbitrary static boundary conditions (if you don't want to use groovyBC). There is an example file in the swak-Distro. Also see @4 @4: The only thing that resembles a tutorial is the presentation found at http://openfoamwiki.net/index.php/Co...er_information (also with a usage example of funkySetBoundaryFields if I remember it correctly) Concerning your "cyclic U and jump in p": there is a boundary condition "fan" in OF that can be used for that, I think. Never had to use it yet, so you'll have to see yourself. There is also a similar BC called groovyBCJump in swak4Foam |
||
February 27, 2012, 16:18 |
|
#3 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
Many thanks for your reply.
I have tried FSF to set the initial field. But I met a problem: funkySetFields -create -field U -expression "vector(log((pos().y-10+0.0003)/0.0003),0,0)" -time 0 -condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20" -dimension "[0 1 -1 0 0 0 0]" /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.0-0bc225064152 Exec : funkySetFields -create -field U -expression vector((0.02/0.0003)*log((pos().y-10+0.0003)/0.0003),0,0) -time 0 -condition pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20 -dimension [0 1 -1 0 0 0 0] Date : Feb 27 2012 Time : 20:02:08 Host : "zxj160-laptop" PID : 1818 Case : /home/zxj160/pisolestest nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Time = 0 Using command-line options Creating field U Putting "vector((0.02/0.0003)*log((pos().y-10+0.0003)/0.0003),0,0)" into field U at t = "0" if condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20" is true #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #2 Uninterpreted: #3 log in "/lib/tls/i686/cmov/libm.so.6" #4 Foam::log(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::log<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/lib/libswak4FoamParsers.so" #6 parserField::FieldValueExpressionParser:arse() at FieldValueExpressionParser.C:0 #7 Foam::FieldValueExpressionDriver:arse(std::strin g const&) in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/lib/libswak4FoamParsers.so" #8 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" #9 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" #10 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #11 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" Floating point exception zxj160@zxj160-laptop:~/pisolestest$ funkySetFields -create -field U -expression "vector(log((pos().y-10+0.0003)/0.0003),0,0)" -time 0 -condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20" -dimension "[0 1 -1 0 0 0 0]" Create time Create mesh for time = 0 Time = 0 Using command-line options Creating field U Putting "vector(log((pos().y-10+0.0003)/0.0003),0,0)" into field U at t = "0" if condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20" is true #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #2 Uninterpreted: #3 log in "/lib/tls/i686/cmov/libm.so.6" #4 Foam::log(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam210/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::log<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/lib/libswak4FoamParsers.so" #6 parserField::FieldValueExpressionParser:arse() at FieldValueExpressionParser.C:0 #7 Foam::FieldValueExpressionDriver:arse(std::strin g const&) in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/lib/libswak4FoamParsers.so" #8 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" #9 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" #10 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #11 in "/home/zxj160/OpenFOAM/zxj160-2.1.0/platforms/linuxGccDPOpt/bin/funkySetFields" Floating point exception But when I run: funkySetFields -create -field U -expression "vector((pos().y-10+0.0003)/0.0003,0,0)" -time 0 -condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20" -dimension "[0 1 -1 0 0 0 0]" , it is OK. I want to know the error of my previous expression: vector(log((pos().y-10+0.0003)/0.0003),0,0). |
|
February 27, 2012, 17:41 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
February 28, 2012, 07:10 |
|
#5 | |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
Quote:
Yes, that may be the problem, but I has defined the conditions? How can I do achieve that log expression? I also want to set : funkySetFields -field U -expression "(0,0,0)" -time 0 -keepPatches -condition "pos().x>0 && pos().x<30 && pos().y>10 && pos().y<20". |
||
February 28, 2012, 09:12 |
|
#6 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
Another question is that "can funkySetFields be used to create a uniform field". I want to keep the velocity in the some parts of the domain uniforma.
|
|
February 28, 2012, 10:11 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
log(max((pos().y-10+0.0003)/0.0003),1),0,0) |
||
February 28, 2012, 10:14 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Of what do you mean with "keep uniform"? |
||
February 28, 2012, 13:34 |
|
#9 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
||
February 28, 2012, 13:39 |
|
#10 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
||
February 28, 2012, 14:41 |
|
#11 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
- the swakFunctionObjects-library has a functionObject manipulateField. Field is reset at the end of each time-step. This requires no modification of the solver. As you've mastered FSF you'll be comfortable with the expression/condition-semantics - the forceEquation-class in the swakSourceFields allows fixing a field in certain regions. This requires modifications of the solver. See the example-solver interFoamWithFixed and discussions about expressionSource elsewhere here on the forum |
||
February 29, 2012, 11:01 |
|
#12 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
Actually, I want to make the velocity outcome like the attached picture (from website). The upper region of the canyon is uniform. The inlet and outlet is cyclic. I do not know how to do that. Is it possible to calculate the different region with different turbulent model (laminar and LES)? Could you suggest me some ideas? Many thanks.
|
|
February 29, 2012, 19:20 |
|
#13 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
I don't think that the laminar/LES-questions fits the topic of this thread |
||
October 3, 2013, 13:42 |
|
#14 |
New Member
sasan
Join Date: Sep 2013
Posts: 28
Rep Power: 13 |
Hi all
I want simulate two phase flow and I have Non-uniform initial conditions,I know,should use funkySetFields for this, and I read http://openfoamwiki.net/index.php/Co...funkySetFields but I have problem,I attach my equation (that show interface two phase) any body know how Write this equation with funkySetFields. |
|
October 3, 2013, 13:52 |
|
#15 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
February 7, 2018, 04:13 |
set a boundary condition with funky
|
#16 |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Hi
consider a 3D box that I want to put a circular input on that with U=(0,5,0) boundary condition(on one of my walls that is rectangular) If I want to use funkySetFields: funkySetFields -case hotRoom -time 0 -field U -keepPatches -valuePatches "pipe" -condition "...." -expression 'vector(0,5,0)' I put it just in time=0 ! however I want to use it as a boundary condition in my all timeSteps. plz help me if you know what should I do. Thank you |
|
February 7, 2018, 20:32 |
|
#17 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
But if you want a real calculated boundary condition look at groovyBC
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
February 9, 2018, 13:00 |
|
#18 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
Yes, that is fixedValue. In fact I want to have this boundary condition till end time of problem, like the other boundary conditions. But I didn't get what you said. I put fixedValue front of internalField in 0/U and made it like boundary conditions. But it gave me an error! could you plz explain more? Thanks |
||
February 12, 2018, 08:58 |
|
#19 | |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Quote:
My question was: Dear Bernhard Yes, that is fixedValue. In fact I want to have this boundary condition till end time of problem, like the other boundary conditions. But I didn't get what you said. I put fixedValue front of internalField in 0/U and made it like boundary conditions. But it gave me an error! could you plz explain more? Thanks |
||
February 14, 2018, 20:07 |
|
#20 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
Tags |
funkysetfields |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC and funkySetFields married and got a kid named swak4Foam | gschaider | OpenFOAM Community Contributions | 169 | August 10, 2023 10:01 |
[swak4Foam] how to use funkySetFields function in muliregion case | bryant_k | OpenFOAM Community Contributions | 15 | October 15, 2021 03:50 |
[swak4Foam] funkySetFields: problem with processor boundary | nmikhailov | OpenFOAM Community Contributions | 4 | May 26, 2015 10:48 |
[swak4Foam] Problem with funkySetFields: How to set field on patch? | DanielPT | OpenFOAM Community Contributions | 4 | May 6, 2011 10:45 |
[swak4Foam] funkySetFields | Chrisi1984 | OpenFOAM Community Contributions | 10 | June 17, 2010 04:26 |