|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
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? |
|
|
|
|
|
|
|
|
#2 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
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 |
||
|
|
|
||
|
|
|
#3 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
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). |
|
|
|
|
|
|
|
|
#4 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
Quote:
|
||
|
|
|
||
|
|
|
#5 | |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
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". |
||
|
|
|
||
|
|
|
#6 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
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.
|
|
|
|
|
|
|
|
|
#7 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
Quote:
log(max((pos().y-10+0.0003)/0.0003),1),0,0) |
||
|
|
|
||
|
|
|
#8 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
Quote:
Of what do you mean with "keep uniform"? |
||
|
|
|
||
|
|
|
#9 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
||
|
|
|
|
|
|
|
#10 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
||
|
|
|
|
|
|
|
#11 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
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 |
||
|
|
|
||
|
|
|
#12 |
|
Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 91
Rep Power: 3 ![]() |
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.
|
|
|
|
|
|
|
|
|
#13 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,121
Rep Power: 30 ![]() ![]() |
Quote:
I don't think that the laminar/LES-questions fits the topic of this thread |
||
|
|
|
||
![]() |
| Tags |
| funkysetfields |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| groovyBC and funkySetFields married and got a kid named swak4Foam | gschaider | OpenFOAM | 153 | May 15, 2013 09:32 |
| funkySetFields and OF1.7.0 | rcastilla | OpenFOAM Running, Solving & CFD | 5 | November 6, 2012 03:33 |
| funkySetFields and multiple sets and fields | mturcios777 | OpenFOAM Pre-Processing | 1 | January 7, 2012 17:51 |
| numerical beach with funkySetFields?! | maxonline | OpenFOAM | 6 | June 17, 2011 04:59 |
| swak4Foam - funkySetFields - not recognizing turbulent wall BC | gonpe | OpenFOAM Pre-Processing | 2 | January 10, 2011 10:30 |