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

[swak4Foam] GroovyBC: trying to set a logarithmic BC

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2015, 12:23
Default GroovyBC: trying to set a logarithmic BC
  #1
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Hello to everyone.

I am trying to set a logarithmic BC for inlet. I read in different post that it is being done by type groovyBC. The idea is that let say two regions A and B ar conected with a path and a pump, where at the inlent for the pump I want to set as a diferent profile. The velocity at the inlet is 0.5 m/s, so I tried to do this like this:
Code:
inlet
    {
        type               groovyBC;
        variables          "ul=log(0.5)*normal();";
        valueExpression "ul";
    }
The error I am getting is this:

Code:
--> FOAM FATAL IO ERROR:
Unknown patchField type groovyBC for patch type patch
and then it gives me the valid patchField types. I tried to look at OpenFoam wiki how to update, but it did not do that as well.

What am I doing wrong?

Thank you in advance.

Cheers

Raitis
rietis is offline   Reply With Quote

Old   February 19, 2015, 13:13
Default
  #2
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Hello,

You have to add this to your controlDict file
Code:
libs (
    "libgroovyBC.so"
    "libgroovyStandardBCs.so"
);
Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 19, 2015, 15:07
Default
  #3
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Dear, Alex, thank you for you reply. I did dowload the swak4Foam for my version 2.2.0 with this:

Code:
svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam
I did put the lib at the end of dict file and it did help, but this error came up saying that it can not find any files needed.

Code:
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libgroovyBC.so: cannot open shared object file: No such file or directory
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libgroovyBC.so"
--> FOAM Warning : 
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libgroovyStandardBCs.so: cannot open shared object file: No such file or directory
--> FOAM Warning : 
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libgroovyStandardBCs.so"
Is there anything else I am doing wrong?

Cheers
Raitis
rietis is offline   Reply With Quote

Old   February 19, 2015, 16:05
Default
  #4
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Did you compile swak4foam after downloading it?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 19, 2015, 16:06
Default
  #5
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
No I did not. How is it done?
rietis is offline   Reply With Quote

Old   February 19, 2015, 16:09
Default
  #6
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
READ IT!
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 19, 2015, 16:53
Default
  #7
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Thank you for your answer.

It is compiling now hopefully it will go. Tommor I need to do that again but with OpenFOAM 1.6. WIll there be any difference?

Are you willing to give me an advise for a snappyhexMesh problem I can not figure it out. I am sorry if I do not get things at first, I am new to Linux and OpenFOAM. Thank you for your time.

if you are interested in the snappyHexMesh here is the link:
http://www.cfd-online.com/Forums/ope...esh-walls.html

Cheers
Raitis
rietis is offline   Reply With Quote

Old   February 19, 2015, 17:04
Default
  #8
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by rietis View Post
Thank you for your answer.
You're welcome!

Quote:
Originally Posted by rietis View Post
It is compiling now hopefully it will go. Tommor I need to do that again but with OpenFOAM 1.6. WIll there be any difference?
It should work after it is compiled!

Regarding the compilation in OF 1.6, yes, it must be the same but with the proper swak4foam version downloaded from the page I posted above.

Quote:
Originally Posted by rietis View Post
Are you willing to give me an advise for a snappyhexMesh problem I can not figure it out. I am sorry if I do not get things at first, I am new to Linux and OpenFOAM. Thank you for your time.

if you are interested in the snappyHexMesh here is the link:
http://www.cfd-online.com/Forums/ope...esh-walls.html

Cheers
Raitis
I haven't ever used snappyHexMesh yet so I cannot help you in this matter, I'm sorry. If you are new with this don't get desperate, be patient and try and try and try again untill you get what you want!

Cheers,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 19, 2015, 17:40
Default groovyBC inoperant
  #9
New Member
 
Loïc Dagnas
Join Date: Jan 2015
Location: France
Posts: 9
Rep Power: 11
loic_d is on a distinguished road
Hi all,
I am very new to openFoam, and I am trying to use time dependant boundary-conditions with shallowWater model.

In order to do that, I am trying to use "type groovyBC", but unsuccessfully at the moment.

I achieved the installation and the following code don't return error but the expression I gave to velocity with the "valueExpression" key word seems to be ignored and the velocity value seems fixed to value

Here is a minimal example, with a constant value:

Code:
Sea
    {
        type groovyBC;
        variables (
        "Uu=vector(0.1,0.1,0);"
        )
        valueExpression "Uu";
        value           uniform (0 0 0);
    }
Then the velocity value is fixed to zero and not (0.1 0.1 0)

Thank you very much
loic_d is offline   Reply With Quote

Old   February 19, 2015, 18:12
Default
  #10
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Maybe the problem are the commas in the definition of Uu
Code:
        "Uu=vector(0.1,0.1,0);"
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 20, 2015, 01:10
Default
  #11
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Thank you ALex it did work, of course now I need to fix this problem:
Code:
--> FOAM Warning : 
    From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(const fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
    in file groovyBCFvPatchField.C at line 131
    No value defined for U on inlet therefore using 1500{(0 0 0)}
Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LESModel
Selecting LES turbulence model oneEqEddy
Selecting LES delta type cubeRootVol
bounding k, min: 0 max: 0 average: 0
oneEqEddyCoeffs
{
    ce              1.048;
    ck              0.094;
}


Starting time loop

fieldAverage fieldAverage:
    Starting averaging at time 0

Time = 0.0005

Courant Number mean: 1.40731e-06 max: 0.00192308
swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 7.94015e-09, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 8.11108e-09, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 2.85247e-08, No Iterations 2


--> FOAM FATAL ERROR: 
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux              : 0.000173225
Specified mass inflow   : 0.124766
Specified mass outflow  : 0.09
Adjustable mass outflow : 0
But at least I know how to solve this, I have had it before and now have to work on this.

Yes it did work, and thank you again Alex. Nice to have this kind of place where people are interested in the same kind of problems.

Cheers.

Raitis.
rietis is offline   Reply With Quote

Old   February 20, 2015, 08:11
Question groovyBC
  #12
New Member
 
Loïc Dagnas
Join Date: Jan 2015
Location: France
Posts: 9
Rep Power: 11
loic_d is on a distinguished road
Thank you very much Alex,
but it still doesn't work: velocity is not affected.
In my opinion, the comas have to be used in swak4Foam vector syntax.

Best regards
Loïc
loic_d is offline   Reply With Quote

Old   February 20, 2015, 09:06
Default
  #13
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Should there be bracets after variables?

Try like this:

Code:
Sea     {         type groovyBC;         variables "Uu=vector(0.1,0.1,0);"; //this ; here and no bracets plus try remove the comma if does not work like this.         valueExpression "Uu";         value           uniform (0 0 0);     }
rietis is offline   Reply With Quote

Old   February 20, 2015, 09:07
Default
  #14
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Code:
Sea     
{         
type groovyBC;         
variables "Uu=vector(0.1,0.1,0);";         
valueExpression "Uu";         
value           uniform (0 0 0);     
}
rietis is offline   Reply With Quote

Old   February 20, 2015, 09:22
Default
  #15
New Member
 
Loïc Dagnas
Join Date: Jan 2015
Location: France
Posts: 9
Rep Power: 11
loic_d is on a distinguished road
Hi Raitis,
thank you for your answer, but I still have the same problem:
with your code my velocity seems fixed to < value uniform (0 0 0)>
with or without the comas

Regards
Loïc
loic_d is offline   Reply With Quote

Old   February 22, 2015, 12:24
Default
  #16
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by loic_d View Post
Thank you very much Alex,
but it still doesn't work: velocity is not affected.
In my opinion, the comas have to be used in swak4Foam vector syntax.

Best regards
Loïc
Hello Loïc,

It's not a matter of opinion but it's a fact, the commas seem to be correctly used according to the documentation. I think that the problem may be that you missed something
Code:
Sea
    {
        type groovyBC;
        variables (
        "Uu=vector(0.1,0.1,0);");
        valueExpression "Uu";
        value           uniform (0 0 0);
    }
Can you find out what you missed?

Let us know if now it works or not.

Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 22, 2015, 12:33
Default
  #17
Member
 
Raitis Lebdevs
Join Date: Feb 2015
Location: Latvia
Posts: 37
Rep Power: 11
rietis is on a distinguished road
Send a message via Skype™ to rietis
Dear Alex.

If I want to get a velocity profile of coordinates like this:

Code:
inlet     
{         
type               groovyBC;         
variables          "ul=log(y)+x;";         
valueExpression "ul";
        
 }
Can I simple write y and x in?

Cheers
Raitis
rietis is offline   Reply With Quote

Old   February 22, 2015, 13:16
Default
  #18
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by rietis View Post
Dear Alex.

If I want to get a velocity profile of coordinates like this:

Code:
inlet     
{         
type               groovyBC;         
variables          "ul=log(y)+x;";         
valueExpression "ul";
        
 }
Can I simple write y and x in?

Cheers
Raitis
I'm not sure if I understood weel what you need, it's sunday But if what I understood is that you need to define a velocity profile depending on the position of the cell center, then, if I'm not wrong, the specification would be something like
Code:
inlet     
{         
type               groovyBC;         
variables          "ul=log(pos().y)+pos().x;";         
valueExpression "ul";
        
 }
I think it should work to suit your needs.
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   February 23, 2015, 08:51
Default groovyBC
  #19
New Member
 
Loïc Dagnas
Join Date: Jan 2015
Location: France
Posts: 9
Rep Power: 11
loic_d is on a distinguished road
Hi Alex,
Thank you very much for your time.
It still doesn't work for my case, and I also tried your code with icoFoam cavity
and shallowWater squareBump tutorials, and I obtain the same mysterious result: a velocity of (0 0 0) everywhere ...
I have no idea what could be my error.

Thanks

Loïc


PS: I attach the file 0/U I used for shallowWater squareBump case
Attached Files
File Type: txt U.txt (1.3 KB, 9 views)
loic_d is offline   Reply With Quote

Old   February 27, 2015, 13:59
Default groovyBC inoperant
  #20
New Member
 
Loïc Dagnas
Join Date: Jan 2015
Location: France
Posts: 9
Rep Power: 11
loic_d is on a distinguished road
Hi all,
I am very new to openFoam, and I am trying to use time dependant boundary-conditions with shallowWater model.

In order to do that, I am trying to use "type groovyBC", but unsuccessfully at the moment.

I achieved the installation and the following code don't return error but the expression I gave to velocity with the "valueExpression" key word seems to be ignored and the velocity value seems fixed to value

Here is a minimal example, with a constant value:

Code:
Sea
    {
        type groovyBC;
        variables ("Uu=vector(0.1,0.1,0);");
        valueExpression "Uu";
        value           uniform (0 0 0);
    }
Then the velocity value is fixed to zero and not (0.1 0.1 0)


I also tried this code with icoFoam cavity
and shallowWater squareBump tutorials, and I obtain the same mysterious result: a velocity of (0 0 0) everywhere ...
I have no idea what could be my error.


Thank you very much

PS: I attach the file 0/U I used for shallowWater squareBump case
PS2: it might unrelevant, but I am using OpenFoam2.3
Attached Files
File Type: txt U.txt (1.3 KB, 3 views)
loic_d is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[ICEM] ICEM Scripting Issues tylerplowright ANSYS Meshing & Geometry 33 September 27, 2021 17:35
[swak4Foam] groovyBC set an initial unknown guess constant ancolli OpenFOAM Community Contributions 2 June 15, 2016 14:46
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 09:00
set BC mass-flow-inlet via UDF and via GUI perform different result sawa25 FLUENT 1 February 25, 2015 01:51
[ICEM] Question about the use of ICEM tcl scripting lnk ANSYS Meshing & Geometry 9 January 16, 2013 10:24


All times are GMT -4. The time now is 03:24.