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

[swak4Foam] Problem using swak4Foam in a modiefied solver

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2011, 03:39
Default Problem using swak4Foam in a modiefied solver
  #1
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Dear experts,

I have written a slightly modified solver and I have problems to load the swak4Foam-Library into it. I get the following warning:

Code:
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
    could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
    could not load "libswakFunctionObjects.so"
Afterwards, swak4Foam cannot be used. I ensured that the missing libraries are placed in $FOAM_USER_LIBBIN and that $FOAM_USER_LIBBIN is in $LD_LIBRARY_PATH. This is the case and I have no further ideas.
The basic solver does not have this problem. Ideas are welcome. Thanks.

Regards Bastian

Last edited by bastil; December 2, 2011 at 05:02.
bastil is offline   Reply With Quote

Old   December 2, 2011, 07:26
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bastil View Post
Dear experts,

I have written a slightly modified solver and I have problems to load the swak4Foam-Library into it. I get the following warning:

Code:
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
    could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
    could not load "libswakFunctionObjects.so"
Afterwards, swak4Foam cannot be used. I ensured that the missing libraries are placed in $FOAM_USER_LIBBIN and that $FOAM_USER_LIBBIN is in $LD_LIBRARY_PATH. This is the case and I have no further ideas.
The basic solver does not have this problem. Ideas are welcome. Thanks.

Regards Bastian
Hmm. The dynamic loader. Hours of endless fun

No idea. Just some pointers (not necessarily in the correct order):
- try adding libswak4FoamParsers.so to libs to see if that fails too (preferably before the other libs)
- check with "file $FOAM_USER_LIBBIN/libswak4FoamParsers.so" etc that these are really libraries
- make sure there are none in $FOAM_LIBBIN and $FOAM_SITE_LIBBIN (from old installations for instance)
- Check if a utility that uses the swak-libraries (funkySetFields for instance) works correctly
- do a complete recompile of swak4Foam (yeah. The old "programmer repairs a car"-joke)
ztnuaa likes this.
gschaider is offline   Reply With Quote

Old   July 27, 2013, 14:05
Default
  #3
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Hi there!! I have the same problem as bastil. I have a slightly modified solver and I have problems to load "libsimpleSwakFunctionObjects.so".

I post here the whole error message:

Quote:
Create time

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libswakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libswakFunctionObjects.so"
Create mesh for time = 0

Reading field X

--> FOAM FATAL ERROR:
Unknown function type swakExpression

Valid functions are :

5
(
initSwakFunctionObject
patchProbes
probes
sets
surfaces
)
I have followed without success the steps posted by gschaider. Any hint will be appreciated! Thanks!
maalan is offline   Reply With Quote

Old   July 29, 2013, 14:07
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
Hi there!! I have the same problem as bastil. I have a slightly modified solver and I have problems to load "libsimpleSwakFunctionObjects.so".

I post here the whole error message:



I have followed without success the steps posted by gschaider. Any hint will be appreciated! Thanks!
At first: for output use the CODE-tag not QUOTE. Because the second will be removed when somebody quotes your message.

Have you checked whether the libraries in question are in $FOAM_USER_LIBBIN (or $FOAM_SITE_LIBBIN or $FOAM_LIBBIN)? If not then swak is not properly installed (usual compilation generates these libraries in $FOAM_USER_LIBBIN)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

Last edited by gschaider; July 29, 2013 at 14:09. Reason: Message warped by connection interruption
gschaider is offline   Reply With Quote

Old   July 30, 2013, 16:39
Default
  #5
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Thanks for your reply!! I installed swak4foam in an older OF release and it works!!
Now, as I said I have a slightly modified solver which writes my field and their gradients (written in my write.H code library), and would like to operate between fields... for instance, solve the volume integral of p*U and write this field for each time step! I had a look to the swak4foam examples but I don't know how to write the operation and probably my code writes my function gradients after than swak4foam needs them to operate. So, I am thinking of doing everything with swak4foam... could you tell me briefly how to proceed??

Thanks so much!
Best!
maalan is offline   Reply With Quote

Old   July 31, 2013, 09:00
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
Thanks for your reply!! I installed swak4foam in an older OF release and it works!!
So the problem was that you didn't install it in the new OF release?

Quote:
Originally Posted by maalan View Post
Now, as I said I have a slightly modified solver which writes my field and their gradients (written in my write.H code library), and would like to operate between fields... for instance, solve the volume integral of p*U and write this field for each time step! I had a look to the swak4foam examples but I don't know how to write the operation and probably my code writes my function gradients after than swak4foam needs them to operate. So, I am thinking of doing everything with swak4foam... could you tell me briefly how to proceed??
If you want to evaluate the expressions only for postprocessing (your solver will not use them in any way) then I'd recommend using functionObjects in controlDict. Don't burden the solver with stuff that he doesn't need

If you want to evaluate an expression and use the field later on I'd recommend the expressionSource-class in swakSourceFields. For an example of the usage see InterFoamWithSources. Basically you only have to create an option. Every time you call the ()-operator on it it gets evaluated and returns a field
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 4, 2013, 08:17
Default
  #7
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Thanks for your reply, although late...
I have already used some functionObjects both of OF and swak4foam. So, I would like to integrate an expression and regarding your pdf's on swak4foam I tried:

integral
{
type swakExpression;
valueType internalField;
accumulations (
sum
);
expression "U^curl(U)";
verbose true;
}

I want to calculate the volume integral in a transient simulation, just spatial not temporal, Am I right??

Thanks again!
Best!
maalan is offline   Reply With Quote

Old   September 4, 2013, 09:18
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
Thanks for your reply, although late...
The reply was a day after your question. Why is that late? Or do you mean your reply?
Quote:
Originally Posted by maalan View Post
I have already used some functionObjects both of OF and swak4foam. So, I would like to integrate an expression and regarding your pdf's on swak4foam I tried:

integral
{
type swakExpression;
valueType internalField;
accumulations (
sum
);
expression "U^curl(U)";
verbose true;
}

I want to calculate the volume integral in a transient simulation, just spatial not temporal, Am I right??
Sum simply adds the values in the cells. So for a volume integral your expression would have to be "vol()*U^curl(U)". Then sum takes care of the "integration". The development version has a accumulation weightedSum that does this for you
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 4, 2013, 13:11
Default
  #9
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Quote:
The reply was a day after your question. Why is that late? Or do you mean your reply?
I meant my reply. Your reply was really prompt.

Quote:
Sum simply adds the values in the cells. So for a volume integral your expression would have to be "vol()*U^curl(U)". Then sum takes care of the "integration". The development version has a accumulation weightedSum that does this for you
Yes!! You are right: 'vol()' would be the 'dV' term inside the integral. It works!!

Now, my question is how could I multiply the term "U^curl(U)" by a steady and vectorial solution that I have obtained from another field (e.g., K ) in a different case?? I would like to do the operation "(U^curl(U))&grad(K)*vol()" and accumulate the sum for integration for every time step...

Thanks so much!!
BEst!
maalan is offline   Reply With Quote

Old   September 4, 2013, 13:54
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
I meant my reply. Your reply was really prompt.



Yes!! You are right: 'vol()' would be the 'dV' term inside the integral. It works!!

Now, my question is how could I multiply the term "U^curl(U)" by a steady and vectorial solution that I have obtained from another field (e.g., K ) in a different case?? I would like to do the operation "(U^curl(U))&grad(K)*vol()" and accumulate the sum for integration for every time step...

Thanks so much!!
BEst!
You can use the foreign-meshes feature. Have a look at Examples/FunkyDoCalc/drivenCavity.compareWithGraded. The feature is also available in funkySetFields with the -other-options

Mind: this only gives you access to a mapped version of the foreign mesh no calculations are possible on it. So either calculate the gradient beforehand in the other case or calculate the gradient of the mapped data (which might give loss of precision/weird results)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 4, 2013, 15:16
Default
  #11
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Quote:
You can use the foreign-meshes feature. Have a look at Examples/FunkyDoCalc/drivenCavity.compareWithGraded. The feature is also available in funkySetFields with the -other-options
I forgot to tell the mesh is the same in both cases, so no need to map anything. Then, should I use FunkyDoCalc anyway or could I finish my calculations by using functionObjects?? I have no idea how to use FunkyDoCalc and I don't find anything about it...

Quote:
Mind: this only gives you access to a mapped version of the foreign mesh no calculations are possible on it. So either calculate the gradient beforehand in the other case or calculate the gradient of the mapped data (which might give loss of precision/weird results)
And yes, I have also calculated the gradient in the other case by using functionObjects as well.
maalan is offline   Reply With Quote

Old   September 4, 2013, 16:27
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
I forgot to tell the mesh is the same in both cases, so no need to map anything.
That doesn't matter. Then the mapping algorithm has to work less
Quote:
Originally Posted by maalan View Post
Then, should I use FunkyDoCalc anyway or could I finish my calculations by using functionObjects?? I have no idea how to use FunkyDoCalc and I don't find anything about it...
Admittedly the description in the README (you read that before you asked?) is not much
Code:
*** =funkyDoCalc=
    Evaluates expressions that are listed in a dictionary using data
    that is found on the disc and prints summarized data (min, max,
    average, sum) to the screen
but together with the two files in Examples/FunkyDoCalc and the general description of expressions in Documentation/swak4FoamReference (which nobody seems to read. That's why I don't feel too motivated to invest more time it) it shouldn't be too hard to get it too work

Quote:
Originally Posted by maalan View Post
And yes, I have also calculated the gradient in the other case by using functionObjects as well.
As the mesh is the same the easiest solution is to just copy the field files into the case you're investigating
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 5, 2013, 12:43
Default
  #13
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 15
maalan is on a distinguished road
Quote:
As the mesh is the same the easiest solution is to just copy the field files into the case you're investigating
Finally, I have coupled both solvers into one and then integrated by using functionObjects. It has been the easiest solution.

Thanks a lot, bernhard!
maalan is offline   Reply With Quote

Old   April 18, 2020, 16:17
Default problems with modified solver
  #14
New Member
 
Elisa
Join Date: Jul 2018
Location: Genova, Italy
Posts: 1
Rep Power: 0
EliB is on a distinguished road
Dear Foamers,
I have created a new solver called interTRFoam and, since I wish to use groovyBC, I have installed swak4Foam. Probably I did some mistakes during the installation and now I can't use my solver interTRFoam with swak4Foam.

I have installed both OpenFOAM v1912 and swak4Foam with Docker, and for swak4Foam I've followed
https://bitbucket.org/bgschaid/swak4...ile/src/v1906/

When I start swak4Foam I have no problem, I can move to my case folder, get blockMesh and setFields with no problem, but I cannot call my solver, only interFoam.

Do you have any ideas to fix this problem?
EliB 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
mesh.update problem in a new FSI solver ICL OpenFOAM 0 October 8, 2011 15:16
Compilation problem after modifying a solver. PetSul OpenFOAM Running, Solving & CFD 2 October 1, 2009 18:28
patching problem unsteady solver yellow-stuff Main CFD Forum 0 September 25, 2009 02:26
Coupled solver energy equation problem lucioantonio FLUENT 0 April 3, 2009 11:21
Mashing Problem? ji CFX 2 April 4, 2002 06:03


All times are GMT -4. The time now is 15:30.