at8i
Forum Replies Created
-
AuthorPosts
-
at8iParticipant
Dear Mathias,
The solution works for me thank you. There was no problem.
Best regards,
Amirat8iParticipantHello Adrian,
Thank you for your reply Adrian. I did export env variable in my shell. but the macOS gave me weird errors regarding accessibility and such. (was not able to access that specific compiler I installed and etc. I used sudo too.).
I was trying to compile everything. I was silly not to try and run make from example folders duh!. Most likely should have been enough to generate the file I needed.I will try that. I am using Multipass to compile and run everything in openLB folder which is the only folder shared with Virtual Ubuntu.
Just install GCC and openmpi dependencies and you should be able to compile everything. I am using compiledb to generate compile_commands.json and using to hop around the library.Of course, there is no need for you to do so if your IDE can do it for you. But mine does not so I usually need that. Afterwards for me it takes a long time to write something which is worth trying running it. But I compile it on Multipass to make sure the changes I made were correct compile-error wise. Nothing more than that. I don’t have access to workstations to give you any information about the compatibility of them and Multipass. I hope this answer is of use.
Best regards,
Amirat8iParticipantHello,
This is the error I get when I try compiling without any change in configuration.
‘
make -C zlib
cc -c -o build/adler32.o ./adler32.c
cc -c -o build/crc32.o ./crc32.c
cc -c -o build/deflate.o ./deflate.c
cc -c -o build/infback.o ./infback.c
cc -c -o build/inffast.o ./inffast.c
cc -c -o build/inflate.o ./inflate.c
cc -c -o build/inftrees.o ./inftrees.c
cc -c -o build/trees.o ./trees.c
cc -c -o build/zutil.o ./zutil.c
cc -c -o build/compress.o ./compress.c
cc -c -o build/uncompr.o ./uncompr.c
cc -c -o build/gzclose.o ./gzclose.c
cc -c -o build/gzlib.o ./gzlib.c
cc -c -o build/gzread.o ./gzread.c
cc -c -o build/gzwrite.o ./gzwrite.c
ar rc build//libz.a ./build/adler32.o ./build/crc32.o ./build/deflate.o ./build/infback.o ./build/inffast.o ./build/inflate.o ./build/inftrees.o ./build/trees.o ./build/zutil.o ./build/compress.o ./build/uncompr.o ./build/gzclose.o ./build/gzlib.o ./build/gzread.o ./build/gzwrite.o
cp zlib/build/libz.a lib/
make -C tinyxml
c++ -c tinystr.cpp -o build/tinystr.o
In file included from tinystr.cpp:32:
./tinystr.h:82:50: error: use of undeclared identifier ‘nullptr’
TiXmlString ( const TiXmlString & copy) : rep_(nullptr)
^
./tinystr.h:89:58: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(nullptr)
^
./tinystr.h:96:72: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(nullptr)
^
3 errors generated.
make[2]: *** [build/tinystr.o] Error 1
make[1]: *** [tinyxml] Error 2
make: *** [dependencies] Error 2
‘Changing the default compiler path to other ones and also installing tinyxml, zlib and GCC and setting ‘USE_EMBEDDED_DEPENDENCIES := OFF’ resulted in the same error. I think I am not correctly making adjustment to compiler path.
I will try and solve the problem if I have the time, right now the Multipass is just another terminal which I compile everything after making changes, a bit of a hassle but not a really annoying one.
at8iParticipantDear Mathias,
Thank you for replying. I will certainly do that.Kind regards,
Amirat8iParticipantHello,
I could not set everything properly in mine for tinyxml.(I did do all that was suggested. I am pretty sure I am messing up something). An alternative that is working for me is Multipass. Use primary to install what is necessary and compile. (Share your Open LB directory).at8iParticipantHey Mathias,
Maybe I was not clear about my question, we might have a misunderstanding here.
Examples don’t have a problem.
This is what happened:
I changed one of the thermal examples according to my problem and changed the boundaries of the examples into circular ones.
Now the avEnergy is zero while the code is compiling and running.
I think my problem has 3 cases:
1- Boundary condition that I have changed causes all of this. (I changed into Bouzidi based on Cylinder2D) but because it is thermal case, I might be changing something else too. ( I need a 2D circular boundary Bouzidi example for this if possible)
2- Coupling has a problem. ( I did change it a bit base on one other example, it helped it compile)
3- I am defining boundary condition incorrectly which is highly unlikely. I have checked it with multiple examples and they all seem to be correct and they function as intended I believe, based on the Paraview showing correct boundaries.at8iParticipantTo another OpenLB and LBM lost soul who wanders here, hey what’s upp? road is long and we have to continue. SO if you are like me , a person who is casually interested in LBM and simulation world with superficial knowledge in cpp and LBM and simulation in general; take note of 3 things:
1- Have better knowledge of Cpp RAII and smart pointers in general . I never cared for smart pointers and I always managed my memory manually. So you better start learning. (de-referencing does work on these folks)
2- I am summarizing and taking notes of everything as I am going through them and will put them in repo
and post it here after I am done. I hope it will be slightly better userguide for less fortunate ones like myself.
3- If you are interested in learning from each other as we go along , please contact me : amir.tusi@gmail.com and my github repo : github.com/at8iat8iParticipantThanks, Adrian. After the points you and Stephan made , I realized I need to study OpenLB step by step while I am studying OpenLB’s user guide and sometimes hacking into the examples and changing parameters and etc. to get a better understanding of it.
My end project is simulating a melting solid in a chamber (cylinder) . I wanted to make it simpler for myslef so I decided to look at a 2D circle first. So right now, I am changing a bit ofexamples/thermal/galliumMelting2d/galliumMelting2d.cpp
.
I decided to change geometry of the said example as below:
`
superGeometry.rename(0,4);
`std::vector<T> center(2,T());
center[0]= lx + converter.getPhysLength(1);
center[1]= lx + 0.5 * converter.getPhysLength(1);
IndicatorCircle2D<T> circle(center,lx);
superGeometry.rename(4,1,circle);``std::vector<T> extendwallleft(2,T(0));
extendwallleft[0] = converter.getPhysLength(1);
extendwallleft[1] = 2 * lx + converter.getPhysLength(1);
std::vector<T> originwallleft(2,T(0));
originwallleft[0] = 0.0;
originwallleft[1] = 0.0;
IndicatorCuboid2D<T> wallleft(extendwallleft, originwallleft);``std::vector<T> extendwallright(2,T(0));
extendwallright[0] = converter.getPhysLength(1);
extendwallright[1] = 2 * lx + converter.getPhysLength(1) ;
std::vector<T> originwallright(2,T(0));
originwallright[0] = 2 * lx + converter.getPhysLength(1);
originwallright[1] = 0.0;
IndicatorCuboid2D<T> wallright(extendwallright, originwallright);``superGeometry.rename(4,2,1,wallleft);
superGeometry.rename(4,3,1,wallright);`
`
lx is radius of the circle and is 2.5 cm (25e-3).
And I also changed lx in ThermalUniConverter converter declaration in main from lx to 2 * lx.
And also prepared geometry in main as below:
`
std::vector<T> extend(2,T()); extend[0] = 2 * lx + 2*converter.getPhysLength(1); extend[1] = 2 * lx + converter.getPhysLength(1); std::vector<T> origin(2,T()); IndicatorCuboid2D<T> cuboid(extend, origin);
`
The last part I changed was coupling declaration, I changed lx to 2*lx also ly to 2*lx.I get no error when I am compiling the programm and programm is getting executed as well. The problem is avEnergy value is always zero and is not changing .
I know that walls are not really optimal to initiate the boundaries for a circle 2d but I wanted to make sure that I ma going in the right path? or do I need to change the way I look at the problem?
I would appreciate it if you could point out my mistakes.
Kind Regards
Amir Toosi- This reply was modified 3 years, 3 months ago by at8i. Reason: code
at8iParticipantThanks Adrian, with this I was able to run my test run without any problems. I have to say OpenLB’s ways and methods are so generic that is really simple that is very simple to use even for a new person like me.
Last question : I want to simulate all my experiments in weightless conditions. Is there any way for me to not add new methods and dynamics to OpenLB ( which will require quite a bit of time to study and learn structure of OpenLB due to lack c++ knowledge) and still be able to simulate such conditions?
For example : Create an extForce equal to -g and make the force field act as a negator?
Seems feasible just wanted to see if you have experimented with such a thing.Kind Regards,
Amir Toosiat8iParticipantThanks Adrian for your answers. It did solve the problem of creating and manipulating the primitive geometries.
Is there any of using these with rename function.For example:
superGeometry.rename(4,1,unified_box);
(unified_box is from you sample code).
Thanks in advance for your advises.
Kind Regards,
Amir Toosiat8iParticipantUpdate to Previous Question:
I can confirm that the operations on Indicators mentioned in the UserGuide-1.4 section
12.7.5- venturi3d is not working at my end to be exact (lslisting) the code in page 148 of
the document.
1-Are these operators on geometries removed from OpenLB or is it an error on my end?
2-If they are removed, are there any alternatives?
3-If these errors are related to my implementing them since I am using the official userguide, if
possible, I would like to a see a simple working example of these operation by any of the OpenLB users.
4-If there are new or other ways of manipulating 2D primitive geometries in OpenLB, please teach me.King Regards,
Amir Toosiat8iParticipantAnother Question popped up today .Is below code a valid operation in OpenLB:
IndicatorCircle2D<T> Circle1(center , radius);
IndicatorCircle2D<T> Circle2(center , radius2);
IndicatorIdentity2D<T> shell(Circle2 - / + / . Circle1);
I get an error if I do any of these operations and I am trying to use venturi3d’s approach in
User-guide to set up my geometry.
Now let’s say after solving the problem and the getting a “shell”. Will this code work(using shell as a condition indicator in rename method):SuperGeometry.rename(4,2,1,shell);
Kind Regards,
Amir Toosiat8iParticipantDear Stephan,
Is there a way in OpenLB to remove gravity from the dynamics and implement them ?Kind Regards,
Amirat8iParticipantThanks Stephan for your answer.
The answers were complete and satisfactory. Doing this LBM project is a self-interest rather than a project at work or university and of course a self-study. The code in the question is from the examples in OpenLB and I will definitely try to avoid including any code in questions in future and make it minimal.
Regarding the origin, I thought it was the left bottom corner of the rectangle but I could not make sense of the rest of the code. I need to study a bit more I guess.
I use vim+xolox’s easytags + ctags for finding relevant data/tags/files in a project but I did make the doxygen doc and it has helped me a couple times.
The facilities in OpenLB makes it an attractivbe choice for doing my project.
I do not know the rules of the forum but if you think this question is redundant or unnecessary please remove it.
And again, thank you for the answers.
Kind Regards,
Amir Toosiat8iParticipantThe first part of the question is not clear: I do not know what origin does. What is it exactly indicating?
-
AuthorPosts