CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing & Mesh Conversion

Compile boundary condition as a new dynamic library

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

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   May 23, 2010, 13:06
Default Compile boundary condition as a new dynamic library
  #1
New Member
 
Mohan
Join Date: Jan 2010
Posts: 4
Rep Power: 6
mohanphy is on a distinguished road
Dear All,

I am trying to Compile boundary condition as a new dynamic library. I following this tutorials: http://openfoamwiki.net/index.php/Tu....28OF-1.4.1.29

I have done the following steps :

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived$ svn checkout http://openfoam-extend.svn.sourcefor...bolicVelocity/
A parabolicVelocity/parabolicVelocityFvPatchVectorField.C
A parabolicVelocity/parabolicVelocityFvPatchVectorField.H
U parabolicVelocity
Checked out revision 1738.

I have downloaded it :

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived$ cd parabolicVelocity/


openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity$ ls
parabolicVelocityFvPatchVectorField.C parabolicVelocityFvPatchVectorField.H

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity$ mkdir Make

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity$ ls
Make parabolicVelocityFvPatchVectorField.H
parabolicVelocityFvPatchVectorField.C

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity$ cd Make/

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity/Make$ vim files

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity/Make$ vim options

wmake will show the following message :

openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity/Make$ wmake libso

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file parabolicVelocityFvPatchVectorField.C
SOURCE=parabolicVelocityFvPatchVectorField.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/openfoam/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/openfoam/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/openfoam/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/parabolicVelocityFvPatchVectorField.o
'/home/openfoam/OpenFOAM/openfoam-1.6/lib/linuxGccDPOpt/libmyBCs.so' is up to date.
openfoam@Mohan:~/OpenFOAM/openfoam-1.6/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity$ ls
lnInclude parabolicVelocityFvPatchVectorField.C parabolicVelocityFvPatchVectorField.H
Make parabolicVelocityFvPatchVectorField.dep

It has successfully creates "libmyBCs.so" in /home/openfoam/OpenFOAM/openfoam-1.6/lib/linuxGccDPOpt/libmyBCs.so

The tutorials saying that I need to add the following line in system/controlDict file: libs ("libmyBCs.so");

The problem is I don't know where is the system/controlDict file (absolute path). some one please explain me to find system/controlDict file.

Thanks & Rg
Mohan L
mohanphy is offline   Reply With Quote

Old   March 22, 2013, 10:42
Default
  #2
Senior Member
 
starter
Join Date: Sep 2012
Posts: 106
Rep Power: 6
sihaqqi is on a distinguished road
Mohan

I am after this parabolic velocity patch .C and .H. I use openFoam 2.1. the link you have given does not have these files. Can you please post these. The need is very urgent because first I have to understand them as a beginner in OpenFoam and then I shall have to convert in 1/7th power law.

I shall be grateful

regards
sihaqqi is offline   Reply With Quote

Old   March 24, 2013, 15:01
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings sihaqqi,

They are available here: https://github.com/ogoe/OpenFOAM-1.6...bolicVelocity/

Direct links:
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   March 24, 2013, 19:26
Default
  #4
Senior Member
 
starter
Join Date: Sep 2012
Posts: 106
Rep Power: 6
sihaqqi is on a distinguished road
Dear Bruno

Many thanks for this.
Thanks & Regards

Sihaqqi
sihaqqi is offline   Reply With Quote

Old   March 25, 2013, 03:26
Default
  #5
Senior Member
 
starter
Join Date: Sep 2012
Posts: 106
Rep Power: 6
sihaqqi is on a distinguished road
Bruno

Can you please advise where I can get Make files and options from for this thing

Regards
sihaqqi is offline   Reply With Quote

Old   March 25, 2013, 16:57
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Quote:
Originally Posted by sihaqqi View Post
Can you please advise where I can get Make files and options from for this thing
It's explained in the first link on this thread: http://openfoamwiki.net/index.php/Tu....28OF-1.4.1.29
wyldckat is offline   Reply With Quote

Old   July 25, 2013, 06:22
Default
  #7
Member
 
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 4
nadine is on a distinguished road
Hello,

I don't know if I am really unlucky, but none of the links refering to parapolicVelocity are working!!!

Can someone help me and post a valid link so I can add this condition and compile it?

Thanks a lot,
Nadine
nadine is offline   Reply With Quote

Old   July 25, 2013, 09:48
Default
  #8
Member
 
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 4
nadine is on a distinguished road
Re-Hello,

Finally i found source files using this link:

https://github.com/Unofficial-Extend...eld.H.svn-base

I saved both the .C and .H in a file outside openfoam and followed the instructions givin in wiki to add my library and linked it dynamically by adding libs ("libmyBCs.so"); in my controlDict.

Than I ran the simulation but I got an error message, indicating that there is no such a boundary condition and giving me choices between the classical boundaries found in openfoam!!!

what did I do wrong and how can I fix it!
Help!

Waiting for your answers, even if it s summer time

Nadine,
nadine is offline   Reply With Quote

Old   July 25, 2013, 11:17
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 553
Rep Power: 10
alexeym is on a distinguished road
Quote:
Originally Posted by nadine View Post
Re-Hello,

Finally i found source files using this link:

https://github.com/Unofficial-Extend...eld.H.svn-base

I saved both the .C and .H in a file outside openfoam and followed the instructions givin in wiki to add my library and linked it dynamically by adding libs ("libmyBCs.so"); in my controlDict.

Than I ran the simulation but I got an error message, indicating that there is no such a boundary condition and giving me choices between the classical boundaries found in openfoam!!!

what did I do wrong and how can I fix it!
Help!

Waiting for your answers, even if it s summer time

Nadine,
Can you, please, post your case files?
alexeym is offline   Reply With Quote

Old   August 18, 2013, 12:21
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings to all!

@Nadine: I don't know if you've fixed the problem you reported about, but here is summary and updated building instructions, based on 1.6-ext and http://openfoamwiki.net/index.php/Tu....28OF-1.4.1.29 - edit: and yes it should work for almost any version of OpenFOAM!

Run these commands:
Code:
mkdir -p $FOAM_RUN
cd $FOAM_RUN/..
mkdir parabolicVelocity
cd parabolicVelocity

wget "http://sourceforge.net/p/openfoam-extend/OpenFOAM-1.6-ext/ci/master/tree/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity/parabolicVelocityFvPatchVectorField.C?format=raw" -O parabolicVelocityFvPatchVectorField.C
wget "http://sourceforge.net/p/openfoam-extend/OpenFOAM-1.6-ext/ci/master/tree/src/finiteVolume/fields/fvPatchFields/derived/parabolicVelocity/parabolicVelocityFvPatchVectorField.H?format=raw" -O parabolicVelocityFvPatchVectorField.H

mkdir Make
echo 'parabolicVelocityFvPatchVectorField.C'  > Make/files
echo 'LIB = $(FOAM_USER_LIBBIN)/libmyBCs'  >> Make/files

echo 'EXE_INC =  -I$(LIB_SRC)/finiteVolume/lnInclude'  > Make/options
echo 'EXE_LIBS = '  >> Make/options

wmake libso
The I used the tutorial "incompressible/simpleFoam/pitzDaily" as basis and edited the files:
  • "system/controlDict" - Added the line:
    Code:
    libs ("libmyBCs.so");
  • "0/U" - changed the BC "inlet" to this:
    Code:
        inlet
        {
            type            parabolicVelocity;
            n               (1 0 0);
            y               (0 1 0);
            maxValue        1;
            value           (0 0 0); // Dummy for paraFoam, which will NOT show a correct profile at time 0.
        }
Then to run the case, I simply run:
Code:
blockMesh
simpleFoam
Best regards,
Bruno
mgg likes this.

Last edited by wyldckat; January 2, 2014 at 18:18. Reason: see
wyldckat is offline   Reply With Quote

Old   January 2, 2014, 10:29
Default
  #11
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 2
wzx1989221 is on a distinguished road
Dear Bruno,

I find your post very useful. Just want to know if it is possible to do the parabolic inlet in that way using OF 2.1? Or is it only applicable in OF 1.6-ext version?

Looking forward to your reply. Thank you very much.

Best regards,
Tony
wzx1989221 is offline   Reply With Quote

Old   January 2, 2014, 18:22
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Tony,

Quote:
Originally Posted by wzx1989221 View Post
I find your post very useful. Just want to know if it is possible to do the parabolic inlet in that way using OF 2.1? Or is it only applicable in OF 1.6-ext version?
Good question! I've updated post #10 to add a note about that.

I forgot to mention back then, but it's sort-of implied that these instructions are for any OpenFOAM version, but rely on the source code of OpenFOAM-1.6-ext. Actually, now it's foam-extend 3.0, but this boundary condition is pretty much the same .

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 2, 2014, 19:02
Default
  #13
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 2
wzx1989221 is on a distinguished road
Dear Bruno,

Thank you very much for the reply. Actually I have checked out that it works well with OF 2.1.

One thing is that I tried to use it for 3D pipe flow, but the profile turned out to be varying in only one direction like in channel. Any suggestions on making it work for pipe?

Best regards,
Tony
wzx1989221 is offline   Reply With Quote

Old   January 2, 2014, 19:40
Default
  #14
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Tony,

Mmm... what you are looking for is a paraboloid: http://en.wikipedia.org/wiki/Paraboloid
But this boundary condition from 1.6-ext is only "parabolic"

The idea is that you need to modify the source code of the method "updateCoeffs()". Essentially, you need to modify these two lines of code:
Code:
 // Calculate local 1-D coordinate for the parabolic profile
scalarField coord = 2*((c - ctr) & y_)/((bb.max() - bb.min()) & y_);

vectorField::operator=(n_*maxValue_*(1.0 - sqr(coord)));
Right now I don't have much time to look into this. But let me know if you don't manage to solve this by yourself. And if you are able to, do share the solution!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 3, 2014, 08:34
Default
  #15
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 2
wzx1989221 is on a distinguished road
Hi Bruno,

Many thanks for the tips. I will look into that to see if I can resolve it. I will share the solution if I make it.

Regards,
Tony
wzx1989221 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile errors of boundary condition "expDirectionMixed" liying02ts OpenFOAM Bugs 2 February 1, 2010 20:11
how to set up a wall boundary condition according to calculated wall shear stress? gameoverli OpenFOAM Pre-Processing 1 May 21, 2009 08:28
How to define a dynamic Boundary Condition? abrahamgx CFX 2 March 10, 2009 00:03
How to define a dynamic Boundary Condition? (New) abrahamgx CFX 2 March 9, 2009 08:43
Dynamic Temperature Boundary Condition Kshitij FLUENT 0 October 12, 2005 13:40


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