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

[swak4Foam] Problem with swak4Foam and OpenFOAM 2.3.1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2017, 09:16
Default Problem with swak4Foam and OpenFOAM 2.3.1
  #1
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Rafael,

Wow, I wasn't aware about this issue in OpenFOAM 2.2... I've reported this and provided a fix for swak4Foam 0.3.2 just now: https://sourceforge.net/p/openfoam-e...swak4foam/228/

The file in attachment should help, as it's the patch provided in the bug report. To apply it, do the following steps:
  1. Download the attached file "writeFieldsGeneralFunctionObject.C.patch".
  2. In the terminal, go to the folder where you have the swak4Foam source code and run the following command:
    Code:
    patch -p1 < ~/Downloads/writeFieldsGeneralFunctionObject.C.patch
    Where I'm assuming you downloaded the file into the folder "~/Downloads/", so change it to your need
  3. Now you can run "Allwmake" once again, as you did before.
Best regards,
Bruno
Hi Bruno,

I have same problem with installing SWAK 0.4.0 on OF-2.3.1. First i installed the SWAK and didn't noticed the error in end of the log file i attached here.
Code:
Previously compiled for OpenFOAM 2.3.1

/home/behzad/OpenFOAM/behzad-2.3.1/swak4Foam/privateRequirements/bin existing. Prepending to PATH-variable (private version of Bison)

Reading variables from 'swakConfiguration'
swakConfiguration: line 13: [: : integer expression expected
Checking swak4Foam-version and generating file
abort: no repository found in '/home/behzad/OpenFOAM/behzad-2.3.1/swak4Foam' (.hg not found)!
Swak version is 0.4.0
Bison is version 2.7.12-4996
Flex is version 2.5.39 (Minor version: 39)
OpenFOAM-version: Major 2 Minor 3 Patch 1 (-1 == x / 1) Fork: openfoam
No change to swak4FoamParsers/foamVersion4swak.H
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakLagrangianParser.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libgroovyBC.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakFunctionObjects.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libsimpleFunctionObjects.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libsimpleLagrangianFunctionObjects.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libsimpleSearchableSurfaces.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libsimpleSwakFunctionObjects.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakTopoSources.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakSourceFields.so' is up to date.
Compiling swakFvOptions
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakFvOptions.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libgroovyStandardBCs.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakPythonIntegration.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakChemistryModelFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakDynamicMeshFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakFvcSchemesFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakLagrangianCloudSourcesFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakLocalCalculationsFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakMeshQualityFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakMeshWaveFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakMRFFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakRadiationModelFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakRandomFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakSurfacesAndSetsFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakThermoTurbFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakTransportTurbFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakVelocityFunctionPlugin.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/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

'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libsimpleCloudFunctionObjects.so' is up to date.
'/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib/libswakCloudFunctionObjects.so' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkyPythonPostproc' is up to date.
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IMake/linux64GccDPOpt  -I/opt/openfoam231/src/finiteVolume/lnInclude -I/opt/openfoam231/src/sampling/lnInclude -I/opt/openfoam231/src/meshTools/lnInclude -I../../Libraries/simpleFunctionObjects/lnInclude/ -I../../Libraries/swak4FoamParsers/lnInclude/  -IlnInclude -I. -I/opt/openfoam231/src/OpenFOAM/lnInclude -I/opt/openfoam231/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/fieldReport.o -L/opt/openfoam231/platforms/linux64GccDPOpt/lib \
         -lfiniteVolume     -lmeshTools     -L/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/lib     -lswak4FoamParsers -lOpenFOAM -ldl   -lm -o /home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/fieldReport
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/calcNonUniformOffsetsForMapped' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkyDoCalc' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkySetBoundaryField' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkySetFields' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkySetLagrangianField' is up to date.
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/replayTransientBC' is up to date.
Make/linux64GccDPOpt/fieldReport.o: In function `void reportValues<double>(Foam::word const&, Foam::fvMesh const&, Foam::CommonValueExpressionDriver&, Foam::string const&)':
fieldReport.C:(.text._Z12reportValuesIdEvRKN4Foam4wordERKNS0_6fvMeshERNS0_27CommonValueExpressionDriverERKNS0_6stringE[_Z12reportValuesIdEvRKN4Foam4wordERKNS0_6fvMeshERNS0_27CommonValueExpressionDriverERKNS0_6stringE]+0x55): undefined reference to `Foam::CommonValueExpressionDriver::addAlias(Foam::word const&, Foam::word const&, bool)'
Make/linux64GccDPOpt/fieldReport.o: In function `void reportValues<Foam::Vector<double> >(Foam::word const&, Foam::fvMesh const&, Foam::CommonValueExpressionDriver&, Foam::string const&)':
fieldReport.C:(.text._Z12reportValuesIN4Foam6VectorIdEEEvRKNS0_4wordERKNS0_6fvMeshERNS0_27CommonValueExpressionDriverERKNS0_6stringE[_Z12reportValuesIN4Foam6VectorIdEEEvRKNS0_4wordERKNS0_6fvMeshERNS0_27CommonValueExpressionDriverERKNS0_6stringE]+0x55): undefined reference to `Foam::CommonValueExpressionDriver::addAlias(Foam::word const&, Foam::word const&, bool)'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/fieldReport] Error 1
make: *** [fieldReport] Error 2
make[1]: `/home/behzad/OpenFOAM/behzad-2.3.1/platforms/linux64GccDPOpt/bin/funkyWarpMesh' is up to date.
make: Target `application' not remade because of errors.


If you want to use swakCoded-function object or compile software based on swak set the environment variable SWAK4FOAM_SRC to /home/behzad/OpenFOAM/behzad-2.3.1/swak4Foam/Libraries (most people will be fine without setting that variable)
When i tried to run decomposePar i got warnings attached:

Although your patch was for previous version, i applied it and nothing changed.

Thanks in advance,
Attached Files
File Type: txt decomposPar Error.txt (15.0 KB, 4 views)
behzad-cfd is offline   Reply With Quote

Old   March 2, 2017, 05:58
Default Problem with swak4Foam and OpenFOAM 2.3.1
  #2
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
Hi dear forumers,

I want to calculate falling droplet velocity using swak expresions. but when I want to decompose the domain or execute the solver i get error.
my bison version is:
Code:
bison (GNU Bison) 2.7.12-4996
my swak version is 0.4.0. I use OF-2.3.1.
My controlDict added codes for swak:
Code:
libs (
    "libOpenFOAM.so" // keeps paraFoam happy
    "libtwoPhaseProperties.so"
    "libtwoPhaseInterfaceProperties.so"
    "libinterfaceProperties.so"
    "libsimpleSwakFunctionObjects.so"
    "libswakFunctionObjects.so"
);

functions
(

    DropY
    {
        aliases {
        alphawater alpha.water;
        }
       ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType internalField;
        verbose true;
        variables (
        "Vol= sum (alphawater < 0.5 ? vol() : 0);"
        "VolY= sum (alphawater < 0.5 ? pos().y*vol() : 0);"
            );
        expression "VolY/Vol";
        accumulations (

            min
        );        
    }
   
   createInterface
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type createSampledSurface;
        outputControl timeStep;
        outputInterval 1;
        surfaceName interface;
        surface {
            type isoSurface;
            isoField alphawater;
            isoValue 0.5;
            interpolate true;
        }
}
    
    height
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "pos().y";
        accumulations (
            min
            max
        );
    }
  
    surface
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "area()";
        accumulations (
            sum
        );
    }
    deviation
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "pow(pos().y-yAvg,2)*area()/sum(area())";
        variables "yAvg=sum(pos().y*area())/sum(area());";
        accumulations (
            sum
        );
    }
    velocity
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "mag(U)";
        accumulations (
            max
        );
    }
    swakSurfInterface
    {
        ignore_unimplemented_simpleFunctionObject::movePoints true;
        type surfaces;
        outputControl outputTime;
        //        outputControl timeStep;
        outputInterval 1;
        fields ( U );
        surfaceFormat vtk;
        surfaces (
            interface {
                type swakRegistryProxy;
                surfaceName interface;
            }
        );
        interpolationScheme nix;
    }
   
    DropDownVelocity
    {
        
      aliases {
        alphawater alpha.water;
        }

        type swakExpression;
        valueType internalField;
        variables (
             "downDirection=vector(0,-1,0);"//select the downwards direction
             "thres=0.5;"//which cells to keep
             "liquidVol= sum(alphawater > thres ? vol() : 0);" //calculates the volume of the drop
             "downVel= alphawater > thres ? (U & downDirection) : 0;" //a & b:inner vector product. Keep the y component of U.
        );
        expression "downVel*vol()/liquidVol";//vol():vol of the cell
        accumulations (
           sum
        );
        
        verbose true;
    }
    
);
I attached swak make log and solver execution error below.

any comment is appreciated,
regards,
Attached Files
File Type: txt log.txt (7.3 KB, 7 views)
File Type: txt Error.txt (8.8 KB, 11 views)
behzad-cfd is offline   Reply With Quote

Old   March 7, 2017, 08:31
Default
  #3
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
According to attached Error.txt file, the shared object libtwoPhaseInterfaceProperties.so isn't exist in openFoam library any more. maybe there was in older versions, now i have two questions:

1- Do i need libtwoPhaseInterfaceProperties.so for creating and tracking droplet interface or only libinterfaceProperties.so will suffice?
2- If i need libtwoPhaseInterfaceProperties.so, can i add this to openFoam library? and how?

Any comment is appreciated,
Kind regards,

Last edited by behzad-cfd; March 7, 2017 at 17:01.
behzad-cfd is offline   Reply With Quote

Old   March 16, 2017, 09:22
Default
  #4
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
No one have an idea?
behzad-cfd is offline   Reply With Quote

Old   March 25, 2017, 16:19
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 Behzad,

I've finally managed to take a quick look into this and I have to say that I'm a bit confused, mostly because I'm not familiar with the reason why you're loading all of those libraries in the "libs" list within "controlDict".

As for the log file from the installation, only fieldReport didn't build, so this shouldn't affect your case.

Therefore, to address the problem, I suggest that you change the "libs" entry to this:
Code:
libs (
    "libsimpleSwakFunctionObjects.so"
    "libswakFunctionObjects.so"
);
I suggest this because I don't see any reason why you need to load any other libraries than the ones that swak4Foam needs for the function objects to work as intended.

Of course this also means that you must only use these with the correct multiphase solver and do not try to use these function objects with an application such as execFlowFunctionObjects.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply


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
[swak4Foam] swak4foam >>>> INSTALLATION PROBLEM steven123 OpenFOAM Community Contributions 35 January 11, 2021 16:53
[swak4Foam] Problem to calculate grad(U) using swak4Foam Hugoles OpenFOAM Community Contributions 12 November 24, 2020 10:28
[swak4Foam] [OpenFOAM plus] [v1612+] swak4Foam installation problem in Windows (Allwmake) LThomes OpenFOAM Community Contributions 7 October 6, 2020 13:36
[swak4Foam] Installing swak4Foam with openFoam v3.0+ RebelLion OpenFOAM Community Contributions 0 March 11, 2016 19:10
[swak4Foam] swak4foam 0.3.2 installation problem on Ubuntu 15.04 with OpenFOAM 2.4.0 ptsxx OpenFOAM Community Contributions 1 January 10, 2016 17:48


All times are GMT -4. The time now is 10:46.