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

sourcesProperties with Openfoam to create swirl

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2015, 01:57
Default sourcesProperties with Openfoam to create swirl
  #1
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello,

I am trying to create a vortex.

The setting is in a square box with an inlet of flow on the left side and an outflow on the right side. The box has points (-10,-10) (10,-10) (-10,10) and (10,10) all with z=0. It also has four more points at the same x and y but with z=0.001. The program uses the function pimpleFoam and I have written another case for pisoFoam.

I am trying to use the sourcesProperties to create the swirl/radial velocity/axial velocity. In Figure A attached below is the script for the sourcesProperties. From my understanding it should create a swirl at the point (0.05,0,0) with a speed of 100000000 with a radius of 5 meters. When I run the program nothing happens. I use the functions in this order: blockMesh - checkMesh - pimpleFoam - paraFoam or blockMesh - checkMesh - pisoFoam - paraFoam. Is there some other function I have to identify first for the program to use the sourcesProperties script? If not can someone help me learn what the problem is and how to initiate this swirling motion?

Thank you,
~Michu
Attached Images
File Type: jpg FigureA.jpg (32.8 KB, 134 views)

Last edited by michu; August 1, 2015 at 19:19.
michu is offline   Reply With Quote

Old   August 1, 2015, 19:19
Default
  #2
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Can anyone help please?

I also tried to run the example pitzDailyWithSwirl and I realized that the simpleFoam command wasn't telling the program to use the SourceProperties script. If the simpleFoam command was telling the program to use the SourceProperties script, it should have shown up in the pictures below. Does this mean its a mistake in my installation or is this some other error?

Thanks ~Michu
Attached Images
File Type: png 1.PNG (28.0 KB, 54 views)
File Type: png 2.PNG (26.5 KB, 43 views)

Last edited by michu; August 4, 2015 at 02:42.
michu is offline   Reply With Quote

Old   August 5, 2015, 08:28
Default
  #3
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hi All,

I am trying to use swak4Foam with openfoam. I installed Openfoam 2.3 and the most recent swak4Foam. I try to run the example pitzDailyWithSwirl and as shown in the images below, the program does not read the swirl from the sourceProperties script.

I ran ./Allwmake and I attached the output
below:

Code:
goodswak@goodswak-VirtualBox:~/OpenFOAM/OpenFOAM-2.3.0/swak4Foam_2.x$ ./Allwmake
Previously compiled for OpenFOAM 2.3.0

/home/goodswak/OpenFOAM/OpenFOAM-2.3.0/swak4Foam_2.x/privateRequirements/bin existing. Prepending to PATH-variable (private version of Bison)

Reading variables from 'swakConfiguration'
swakConfiguration: line 1: python-config: command not found
swakConfiguration: line 2: python-config: command not found
swakConfiguration: line 13: [: : integer expression expected
Checking swak4Foam-version and generating file
abort: no repository found in '/home/goodswak/OpenFOAM/OpenFOAM-2.3.0/swak4Foam_2.x' (.hg not found)!
Swak version is 0.3.2
Bison is version 2.7.12-4996
Flex is version 2.5.35 (Minor version: 35)
OpenFOAM-version: Major 2 Minor 3 Patch 0 (-1 == x / 0)
No change to swak4FoamParsers/foamVersion4swak.H
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakLagrangianParser.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libgroovyBC.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakFunctionObjects.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libsimpleFunctionObjects.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libsimpleLagrangianFunctionObjects.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libsimpleSearchableSurfaces.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libsimpleSwakFunctionObjects.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakTopoSources.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakSourceFields.so' is up to date.
Compiling swakFvOptions
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakFvOptions.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libgroovyStandardBCs.so' is up to date.

SWAK_PYTHON_INCLUDE not defined .... no Python-Integration. Most people are fine without it

'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakChemistryModelFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakFvcSchemesFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakLagrangianCloudSourcesFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakLocalCalculationsFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakMeshQualityFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakMeshWaveFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakRadiationModelFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakRandomFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakSurfacesAndSetsFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakThermoTurbFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakTransportTurbFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakVelocityFunctionPlugin.so' is up to date.
'/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/lib/libswakCoalCloudAdaptor.so' is up to date.

If you have your own function-plugins you can specify them using the SWAK_USER_PLUGINS environment variable and they would be compiled now. If you don't know what this means: don't bother. You propably don't need it


SWAK_PYTHON_INCLUDE not defined .... no Python-Integration. Utility funkyPythonPostproc not compiled

make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/calcNonUniformOffsetsForMapped' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/fieldReport' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/funkyDoCalc' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/funkySetBoundaryField' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/funkySetLagrangianField' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/replayTransientBC' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/funkySetFields' is up to date.
make[1]: `/home/goodswak/OpenFOAM/goodswak-2.3.0/platforms/linux64GccDPOpt/bin/funkyWarpMesh' is up to date.
goodswak@goodswak-VirtualBox:~/OpenFOAM/OpenFOAM-2.3.0/swak4Foam_2.x$
End of Output

I was wondering if something did not properly install and if so can anyone help me fix the error?

Thank you,
~Michu
Attached Images
File Type: png 1.PNG (28.0 KB, 16 views)
File Type: png 2.PNG (26.5 KB, 15 views)

Last edited by wyldckat; August 10, 2015 at 09:10. Reason: Added [CODE][/CODE] markers
michu is offline   Reply With Quote

Old   August 10, 2015, 00:59
Default
  #4
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Or if anyone has any ideas on other tests that I could do that would show me what went wrong or what section of the program is causing a problem?

Thanks,
~Michu
michu is offline   Reply With Quote

Old   August 10, 2015, 10:23
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Michu,

The problem is that the tutorial "pitzDailyWithSwirl" was created for an older OpenFOAM version, at least as far as I can figure out.
If you look at the tutorial "incompressible/simpleFoam/turbineSiting" that is available in OpenFOAM, there are a few things missing from the "pitzDailyWithSwirl" tutorial:
Therefore, you need to study the tutorial "incompressible/simpleFoam/turbineSiting" for versions 2.1 and 2.3, before proceeding with trying to get "pitzDailyWithSwirl" to work.

In addition, you need to study the "README" file in swak4Foam's folder, and look for the occurrences of "fvOptions", so that you can learn more about how the current swak4Foam version uses it.


Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 12, 2015, 00:50
Default
  #6
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello Bruno,

Thank you so much for your help. I greatly appreciate it. I am currently looking into how to define the list of cells and then I will also look at the fvOptions and turbine example.

Just a really quick question. When I type in ./Allwmake there is one section of the code that I think may be causing problems.

Quote:
Reading variables from 'swakConfiguration'
swakConfiguration: line 1: python-config: command not found
swakConfiguration: line 2: python-config: command not found
swakConfiguration: line 13: [: : integer expression expected
Checking swak4Foam-version and generating file
abort: no repository found in '/home/goodswak/OpenFOAM/OpenFOAM-2.3.0/swak4Foam_2.x' (.hg not found)!
Lines 1, 2 and 13 in "swakConfiguration" I think are causing problems with running swak4Foam and I was wondering if I need to update the python version or do something else to get rid of these errors. I took a look in swakConfiguration and your swakConfiguration example on github. On your example you specify python 2.7, while in the swakConfiguration I have it has the experssion:

Quote:
export SWAK_PYTHON_INCLUDE="$(python-config --cflags)"
export SWAK_PYTHON_LINK="$(python-config --ldflags)"
I was wondering if you knew how I could fix the errors in lines 1, 2, and 13. I was thinking if I changed the cflags and the ldflags maybe that would fix those problems at least. Can you offer any advice on how to fix those 3 errors?

Thank you so much,
~Michu

Update:
For anyone having trouble with:
Quote:
swakConfiguration: line 1: python-config: command not found
swakConfiguration: line 2: python-config: command not found
Just go into the swakConfiguration file and copy the first line:
Quote:
export SWAK_PYTHON_INCLUDE="$(python-config --cflags)"
then paste that into a terminal. I received the message that python-config was not installed and instructions on how to install it. That removed the problem lines 1 and 2 were giving me.

As for line 13, I think my swakConfiguration may be missing a number or something. I attached my swakConfiguration file below. If possible could I see yours swakConfiguration file Bruno?

Quote:
export SWAK_PYTHON_INCLUDE="$(python-config --cflags)"
export SWAK_PYTHON_LINK="$(python-config --ldflags)"

# List separated by : with directories to user plugins
# export SWAK_USER_PLUGINS=../Examples/UserPlugins/swakTestFunctionPlugins

# Compile the parsers with a lower optimization use only if the
# compilation of the grammar takes too long (possibly due to memory
# restrictions on the machine)

export SWAK_COMPILE_GRAMMAR_OPTION="-O1"

if [ "$WM_USE_HOMEBREW" -eq "1" ]
then
export SWAK_BISON=/usr/local/opt/bison27/bin/bison
fi

# If enabled, uses a 30 delay for building Bison generated files.
# Useful only for checking if there are any race conditions.
# export SWAK_TEST_RACE_CONDITIONS=1
Thank you so much,
~Michu

Last edited by michu; August 12, 2015 at 14:17.
michu is offline   Reply With Quote

Old   August 12, 2015, 15:54
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: "swakConfiguration" is optional and it's not needed unless you do need Python integration into swak4Foam

I'll try to write instructions about this today or tomorrow.
wyldckat is offline   Reply With Quote

Old   August 12, 2015, 17:39
Default
  #8
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hi Bruno,

That would be awesome, I really appreciate your help in this matter greatly!

Thank you so much,
~Michu
michu is offline   Reply With Quote

Old   August 21, 2015, 17:18
Default
  #9
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello Bruno,

I really appreciate your help in this matter. I am still getting the

Quote:
swakConfiguration: line 13: [: : integer expression expected
error and swak4Foam is still not working. ( I created a sourcePropertiesTest case, it is just a square with 4 walls (no slip conditions), 2-dimensional, with a swirl in the center and the swirl is from the sourceProperties; however, the swirl does not form.)

I just want to say I appreciate your answer from before greatly and am looking forward to seeing what you are going to say about the swakConfiguration issue.

Thank you,
~Michu
michu is offline   Reply With Quote

Old   August 30, 2015, 03:17
Default
  #10
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello Bruno,

I am looking forward to your response, but to help better describe what is going wrong, I made a short 2 minute video on the issue I have.

https://www.youtube.com/watch?v=YmwIOLTzcmk

I have been working on this for nearly two months and still cannot figure out what is going wrong. I am desperate for help. I really need to solve this problem. Any help you can provide will be greatly appreciated and I will owe you big time!

Thank you,
~Michu
michu is offline   Reply With Quote

Old   August 30, 2015, 17:21
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Michu,

Quote:
Originally Posted by michu View Post
I am still getting the error and swak4Foam is still not working.
Delete the file "swakConfiguration". It's not explicitly needed for building swak4Foam.
The issue about ".hg" is normal and can be ignored.

Quote:
Originally Posted by michu View Post
I am looking forward to your response, but to help better describe what is going wrong, I made a short 2 minute video on the issue I have.

https://www.youtube.com/watch?v=YmwIOLTzcmk
Sorry, but my vacations have ended on Wednesday last week and my time is now a lot more limited.
Nonetheless, although the video does help explain a few things, please attach the test case folder you created:
  1. In the case folder, run:
    Code:
    foamCleanTutorials
    which will erase the mesh that was created. This is for keeping the case as small as possible.
  2. Then compress the folder with ZIP or tar. For example:
    Code:
    cd ..
    tar -czf sourcetest.tar.gz sourcetest
    then attach the file "sourcetest.tar.gz" to your next post.
I ask this because it will make a lost easier for me to do some trial and error.




As for the problem with funkySetFields (shown in the video), that's a normal response, because you're not running inside a case folder. Please check the section "Further information" on the wiki page: http://openfoamwiki.net/index.php/Co...er_information - and follow the presentations.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 30, 2015, 21:44
Default
  #12
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello Bruno,

Thank you so much. I deleted the swakConifugration folder, but the problem persists.

Attached below is the test case after running the foamCleanTutorials command.

As for funkySetFields, I just believe that the message meant that the swak4Foam fully installed, but I wasn't 100% sure if thats what it meant.

Thank you so much for your help. I really greatly appreciate it! If I can help you in any way please let me know. Thank you so much!

Thank you,
~Michu
Attached Files
File Type: gz sourcetest.tar.gz (3.9 KB, 11 views)
michu is offline   Reply With Quote

Old   September 1, 2015, 17:29
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Michu,

Regarding the build of swak4Foam, my only guess is that perhaps you removed the wrong file.

I don't have much more time to go into details for the case itself, so here's in a nutshell:
  • Attached is the package "sourcetest_v240.tar.gz", which contains a working test case for OpenFOAM 2.4.0, based on your case and based on the details you only provided in the video.
  • The file "constant/sourceProperties" is removed and the new respective file is "system/fvOptions". This is a result of the instructions I gave you in post #5.
  • An additional change had to be made, because the expression for U also needs units. See the file "system/fvOptions" for more details.
  • I had to change the speed down from 1000 to 10, otherwise it was not possible to simulate.
  • I had to change from pisoFoam to pimpleFoam, because pisoFoam does not support the "fvOptions" feature.
  • This mean that "system/controlDict" and "system/fvSolution" also had to be adapted accordingly.
Best regards,
Bruno
Attached Files
File Type: gz sourcetest_v240.tar.gz (2.8 KB, 42 views)
__________________
wyldckat is offline   Reply With Quote

Old   September 2, 2015, 18:10
Default
  #14
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hi Bruno,

Thank you so much for your help! It is working wonderfully now. I greatly appreciate your help.

Thank you so much,
~Michu
michu is offline   Reply With Quote

Reply

Tags
axial velocity, openfoam, radial velocity, sourcesproperties, swirl


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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 11:58
How to Create .msh file so that when converted to OpenFOAM will have some BC jaypatel OpenFOAM 13 November 9, 2017 07:44
Create an script for a Local Application of OpenFOAM RTom OpenFOAM Programming & Development 3 November 11, 2013 05:36
how to create cyclic from 2 boundaries in Openfoam 1.7.1 vsflap OpenFOAM 4 April 26, 2013 03:30
how to create the sediment transport using openfoam hxxxmu OpenFOAM 0 April 2, 2013 22:49


All times are GMT -4. The time now is 23:14.