|
[Sponsors] |
Compilation problems adapting setFields for multiregionsolver |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Michael Jensen
Join Date: May 2022
Posts: 31
Rep Power: 4 ![]() |
Following forum rules, new thread for slightly different problem.
I've been trying to implement the solution proposed here: how to use setFields in multiregionsolver. As can be seen from my post here: how to use setFields in multiregionsolver, it didn't work. I've finally did what I said I would do, reversed what I did (the instructions) and did it instead for the other directory. It seems like this was the correct thing to do, because wmake worked this time. yay! ..however, it found a whole bunch of problems: Code:
eriadar@eriadar-Latitude-E7440:~/OpenFOAM/eriadar-9/applications/utilities/preProcessing/mysetFields$ wmake Making dependency list for source file mysetFields.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam9/src/finiteVolume/lnInclude -I/opt/openfoam9/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam9/src/OpenFOAM/lnInclude -I/opt/openfoam9/src/OSspecific/POSIX/lnInclude -fPIC -c mysetFields.C -o Make/linux64GccDPInt32Opt/mysetFields.o In file included from mysetFields.C:37: /opt/openfoam9/src/OpenFOAM/lnInclude/addRegionOption.H:2:1: error: expected constructor, destructor, or type conversion before ‘(’ token 2 | ( | ^ mysetFields.C: In function ‘int main(int, char**)’: mysetFields.C:399:62: error: no matching function for call to ‘setCellField::iNew::iNew(Foam::polyMesh&, Foam::labelList)’ 399 | setCellField::iNew(mesh, labelList(mesh.nCells())) | ^ mysetFields.C:152:9: note: candidate: ‘setCellField::iNew::iNew(const Foam::fvMesh&, const labelList&)’ 152 | iNew(const fvMesh& mesh, const labelList& selectedCells) | ^~~~ mysetFields.C:152:28: note: no known conversion for argument 1 from ‘Foam::polyMesh’ to ‘const Foam::fvMesh&’ 152 | iNew(const fvMesh& mesh, const labelList& selectedCells) | ~~~~~~~~~~~~~~^~~~ mysetFields.C:145:11: note: candidate: ‘constexpr setCellField::iNew::iNew(const setCellField::iNew&)’ 145 | class iNew | ^~~~ mysetFields.C:145:11: note: candidate expects 1 argument, 2 provided mysetFields.C:145:11: note: candidate: ‘constexpr setCellField::iNew::iNew(setCellField::iNew&&)’ mysetFields.C:145:11: note: candidate expects 1 argument, 2 provided mysetFields.C:433:63: error: no matching function for call to ‘setCellField::iNew::iNew(Foam::polyMesh&, Foam::List<int>)’ 433 | setCellField::iNew(mesh, selectedCellSet.toc()) | ^ mysetFields.C:152:9: note: candidate: ‘setCellField::iNew::iNew(const Foam::fvMesh&, const labelList&)’ 152 | iNew(const fvMesh& mesh, const labelList& selectedCells) | ^~~~ mysetFields.C:152:28: note: no known conversion for argument 1 from ‘Foam::polyMesh’ to ‘const Foam::fvMesh&’ 152 | iNew(const fvMesh& mesh, const labelList& selectedCells) | ~~~~~~~~~~~~~~^~~~ mysetFields.C:145:11: note: candidate: ‘constexpr setCellField::iNew::iNew(const setCellField::iNew&)’ 145 | class iNew | ^~~~ mysetFields.C:145:11: note: candidate expects 1 argument, 2 provided mysetFields.C:145:11: note: candidate: ‘constexpr setCellField::iNew::iNew(setCellField::iNew&&)’ mysetFields.C:145:11: note: candidate expects 1 argument, 2 provided mysetFields.C:454:63: error: no matching function for call to ‘setFaceField::iNew::iNew(Foam::polyMesh&, Foam::List<int>)’ 454 | setFaceField::iNew(mesh, selectedFaceSet.toc()) | ^ mysetFields.C:343:9: note: candidate: ‘setFaceField::iNew::iNew(const Foam::fvMesh&, const labelList&)’ 343 | iNew(const fvMesh& mesh, const labelList& selectedFaces) | ^~~~ mysetFields.C:343:28: note: no known conversion for argument 1 from ‘Foam::polyMesh’ to ‘const Foam::fvMesh&’ 343 | iNew(const fvMesh& mesh, const labelList& selectedFaces) | ~~~~~~~~~~~~~~^~~~ mysetFields.C:336:11: note: candidate: ‘constexpr setFaceField::iNew::iNew(const setFaceField::iNew&)’ 336 | class iNew | ^~~~ mysetFields.C:336:11: note: candidate expects 1 argument, 2 provided mysetFields.C:336:11: note: candidate: ‘constexpr setFaceField::iNew::iNew(setFaceField::iNew&&)’ mysetFields.C:336:11: note: candidate expects 1 argument, 2 provided make: *** [/opt/openfoam9/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/mysetFields.o] Error 1 eriadar@eriadar-Latitude-E7440:~/OpenFOAM/eriadar-9/applications/utilities/preProcessing/mysetFields$ Edit: ..Realizing that it might be something stupid like where it says to include "# include "addRegionOption.H"", maybe instead of "Region", I should put the name of the actual region.. like "Fluid".. I'll check where these included files are supposed to come from, see what -can- be included.. Last edited by mikethe1wheelnut; June 13, 2022 at 02:19. Reason: added solution possibilities |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 ![]() ![]() |
Not really sure what you are trying to do. If I check out the help, it should probably just work as-is:
Code:
$ setFields -help Usage: setFields [OPTIONS] Options: -case <dir> Specify case directory to use (instead of cwd) -decomposeParDict <file> Use specified file for decomposePar dictionary -dict <file> Alternative setFieldsDict -parallel Run in parallel -region <name> Specify alternative mesh region -doc Display documentation in browser -help Display short help and exit -help-full Display full help and exit Set values on a selected set of cells/patch-faces via a dictionary Using: OpenFOAM-v2112 (2112) - visit www.openfoam.com Build: 7b5cfbd1b0-20220609 (patch=220310) Arch: LSB;label=32;scalar=64 Or are you trying to implement an '-allRegions' option (wasn't really sure). |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Member
Michael Jensen
Join Date: May 2022
Posts: 31
Rep Power: 4 ![]() |
Quote:
Excellent question. Maybe I can provide enough information for the answer to become clear. I'm working off of the following tutorial: https://www.youtube.com/channel/UCux...RihBaHRWzgjuJA, where the lady splits her simulation between two regions, fluid, and solid. The solid is immersed in a flow of air. I want to set a section of the wall containing the flow to a higher temperature. So presumably that means I want to apply setFields to the fluid. I just tried Code:
setFields -fluid Code:
--> FOAM FATAL ERROR: Invalid option: -fluid ![]() Edit: Compiling explanation of what I was doing, and whole vistas of understanding are opening themselves. The Allrun file provided is: Code:
#!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh runApplication topoSet runApplication splitMeshRegions -cellZones -defaultRegionName fluid -overwrite paraFoam -region fluid -touch paraFoam -region solid -touch runApplication $(getApplication) #------------------------------------------------------------------------------ Code:
topoSet ..Edit 2: My setFieldsDict is in the "system" folder. That folder contains two other folders, 'fluid', and 'solid'. I don't know if that's relevant to the question. I run the following commands successfully: Code:
blockMesh topoSet splitMeshRegions -cellZones -defaultRegionName fluid -overwrite paraFoam -region fluid -touch paraFoam -region solid -touch Edit 3: Ok, maybe getting closer.. Ignored different regions, just called the file directly: Code:
eriadar@eriadar-Latitude-E7440:~/OpenFOAM/eriadar-9/run/tutorials/heatTransfer/chtMultiRegionFoam/heatFunnel2D$ setFields /*---------------------------------------------------------------------------*\ ... // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading "setFieldsDict" Setting field default values --> FOAM Warning : From function bool setCellFieldType(const Foam::word&, const Foam::fvMesh&, const labelList&, Foam::Istream&) [with Type = double; Foam::labelList = Foam::List<int>] in file setFields.C at line 120 Field T not found Setting field region values Adding faces with centre within boxes 1((0 -10 -10) (10 -0.03 10)) --> FOAM Warning : From function bool setFaceFieldType(const Foam::word&, const Foam::fvMesh&, const labelList&, Foam::Istream&) [with Type = double; Foam::labelList = Foam::List<int>] in file setFields.C at line 311 Field T not found End ..so T is a problem.. [..continuing research..] Last edited by mikethe1wheelnut; June 14, 2022 at 16:51. Reason: ..more information.. |
||
![]() |
![]() |
![]() |
![]() |
#4 | |
Member
Michael Jensen
Join Date: May 2022
Posts: 31
Rep Power: 4 ![]() |
Quote:
Just in case somebody happens along and happens to spot the problem, this thread is not dead. In the sense that I haven't yet solved the problem, and still do want to solve it. I've merely shifted back to another part of the project, waiting to see what will happen here. When that part is significantly advanced, I'll come back to this issue and see if I can figure it out. If I can't, I'll either hand the problem over to somebody else, or use another software. (that I'll have to learn) ![]() |
||
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 ![]() ![]() |
If you take a quick look at heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D you will see the following:
This might give you something to work with. |
|
![]() |
![]() |
![]() |
![]() |
#6 | |
Member
Michael Jensen
Join Date: May 2022
Posts: 31
Rep Power: 4 ![]() |
Quote:
..dude, thanks so much. The time I expected to spend on this just went from months to days. (..I was bracing myself for a deep dive into openFoam source-code.. ..still might happen, I suppose.. ![]() ![]() |
||
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 ![]() ![]() |
||
![]() |
![]() |
![]() |
Tags |
multiregionsolver, setfields, wmake error |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems in personal library compilation | shrina | OpenFOAM | 3 | February 23, 2009 11:12 |
UDF compilation problems | MateuszZb | FLUENT | 4 | October 20, 2008 02:46 |
PROBLEMS WITH THE COMPILATION | oscar_j | OpenFOAM Running, Solving & CFD | 6 | July 18, 2007 21:41 |
Changes in OF 14 and compilation issues | alberto | OpenFOAM Running, Solving & CFD | 13 | May 13, 2007 15:21 |
Compilation problems and file locations | Joel | Siemens | 3 | February 11, 2003 12:42 |