|
[Sponsors] |
Problem in Implementing a non-linear SGS model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 20, 2014, 00:00 |
Problem in Implementing a non-linear SGS model
|
#1 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Hi, all:
I want to implement a non-linear SGS model into OF. However, as I read from the source code that the GenSGSStress only works with linear model. Is there anyone who have similar experience about that? Any suggestion is OK. Xianbei |
|
November 20, 2014, 03:33 |
|
#2 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
After reading the source code, I think it's probably needed to modify the GenEddyVisc.C or GenSGSStress.C, the formula of devBeff,depending on which kind of model you want to solve. Because the solver will solve this part
|
|
November 20, 2014, 08:52 |
|
#3 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
it's actually the right way to modify the GenEddyVisc into GennonlinearSGS, the problem remains is that how to add a new namespace into OpenFoam, as in LESModel.C, nuSgs is transferred to GenEddyVisc, so I should modify this file to something like LESModelnonlinear.
However, when I copied LESModel.C and LESModel.H into a new folder(also the make folder), it returns that no rule to create .dep |
|
November 20, 2014, 21:44 |
|
#4 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Hi,all:
As nonlinear model is not compatible with the made-in code, I need to deal with the SGS stress instead of the eddy viscosity. So the nuSgs used in the conventional model should be replaced by a volTensorField representing the SGS stress. However, in the namespace of LESModel, there are too many places where nuSgs is used, so I'd like to create a new namespace called LESNonlinearModel However, when I compile, it returns that: Code:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::incompressible::LESNonlinearModel::correct(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&)': LESNonlinearModel.C:(.text+0x272): undefined reference to `Foam::incompressible::turbulenceModel::correct()' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::incompressible::LESNonlinearModel::LESNonlinearModel(Foam::word const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&)': LESNonlinearModel.C:(.text+0x867): undefined reference to `Foam::incompressible::turbulenceModel::turbulenceModel(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&)' LESNonlinearModel.C:(.text+0xba3): undefined reference to `Foam::LESdelta::New(Foam::word const&, Foam::fvMesh const&, Foam::dictionary const&)' LESNonlinearModel.C:(.text+0xbf7): undefined reference to `Foam::surfaceInterpolation::deltaCoeffs() const' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::incompressible::turbulenceModel::type() const': LESNonlinearModel.C:(.text._ZNK4Foam14incompressible15turbulenceModel4typeEv[Foam::incompressible::turbulenceModel::type() const]+0x3): undefined reference to `Foam::incompressible::turbulenceModel::typeName' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::fvPatchField<Foam::Tensor<double> >::type() const': LESNonlinearModel.C:(.text._ZNK4Foam12fvPatchFieldINS_6TensorIdEEE4typeEv[Foam::fvPatchField<Foam::Tensor<double> >::type() const]+0x3): undefined reference to `Foam::fvPatchField<Foam::Tensor<double> >::typeName' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::type() const': LESNonlinearModel.C:(.text._ZNK4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE4typeEv[Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::type() const]+0x3): undefined reference to `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::typeName' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::DimensionedField<Foam::Tensor<double>, Foam::volMesh>::type() const': LESNonlinearModel.C:(.text._ZNK4Foam16DimensionedFieldINS_6TensorIdEENS_7volMeshEE4typeEv[Foam::DimensionedField<Foam::Tensor<double>, Foam::volMesh>::type() const]+0x3): undefined reference to `Foam::DimensionedField<Foam::Tensor<double>, Foam::volMesh>::typeName' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::incompressible::turbulenceModel::addturbulenceModelConstructorToTable<Foam::incompressible::LESNonlinearModel>::~addturbulenceModelConstructorToTable()': LESNonlinearModel.C:(.text._ZN4Foam14incompressible15turbulenceModel36addturbulenceModelConstructorToTableINS0_17LESNonlinearModelEED2Ev[_ZN4Foam14incompressible15turbulenceModel36addturbulenceModelConstructorToTableINS0_17LESNonlinearModelEED5Ev]+0x1): undefined reference to `Foam::incompressible::turbulenceModel::destroyturbulenceModelConstructorTables()' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const': LESNonlinearModel.C:(.text._ZNK4Foam14objectRegistry12lookupObjectINS_14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x122): undefined reference to `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::typeName' LESNonlinearModel.C:(.text._ZNK4Foam14objectRegistry12lookupObjectINS_14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x1a5): undefined reference to `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::typeName' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::fv::gradScheme<Foam::Vector<double> >::New(Foam::fvMesh const&, Foam::Istream&)': LESNonlinearModel.C:(.text._ZN4Foam2fv10gradSchemeINS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE[Foam::fv::gradScheme<Foam::Vector<double> >::New(Foam::fvMesh const&, Foam::Istream&)]+0x1d): undefined reference to `Foam::fv::debug' LESNonlinearModel.C:(.text._ZN4Foam2fv10gradSchemeINS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE[Foam::fv::gradScheme<Foam::Vector<double> >::New(Foam::fvMesh const&, Foam::Istream&)]+0x3c): undefined reference to `Foam::fv::gradScheme<Foam::Vector<double> >::IstreamConstructorTablePtr_' LESNonlinearModel.C:(.text._ZN4Foam2fv10gradSchemeINS_6VectorIdEEE3NewERKNS_6fvMeshERNS_7IstreamE[Foam::fv::gradScheme<Foam::Vector<double> >::New(Foam::fvMesh const&, Foam::Istream&)]+0x234): undefined reference to `Foam::fv::gradScheme<Foam::Vector<double> >::IstreamConstructorTablePtr_' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::DimensionedField<Foam::Tensor<double>, Foam::volMesh> const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField const&)': LESNonlinearModel.C:(.text._ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryFieldC2ERKNS_16DimensionedFieldIS2_S4_EERKS6_[_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryFieldC5ERKNS_16DimensionedFieldIS2_S4_EERKS6_]+0x3c): undefined reference to `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::debug' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&)': LESNonlinearModel.C:(.text._ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEEC2ERKS5_[_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEEC5ERKS5_]+0xfe): undefined reference to `Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::debug' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::tmp<Foam::GeometricField<Foam::outerProduct<Foam::Vector<double>, Foam::Vector<double> >::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad<Foam::Vector<double> >(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)': LESNonlinearModel.C:(.text._ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EE[Foam::tmp<Foam::GeometricField<Foam::outerProduct<Foam::Vector<double>, Foam::Vector<double> >::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad<Foam::Vector<double> >(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)]+0xa5): undefined reference to `Foam::fvSchemes::gradScheme(Foam::word const&) const' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `Foam::fvPatchField<Foam::Tensor<double> >::snGrad() const': LESNonlinearModel.C:(.text._ZNK4Foam12fvPatchFieldINS_6TensorIdEEE6snGradEv[Foam::fvPatchField<Foam::Tensor<double> >::snGrad() const]+0x17): undefined reference to `Foam::fvPatch::deltaCoeffs() const' Make/linux64GccDPOpt/LESNonlinearModel.o: In function `_GLOBAL__sub_I_LESNonlinearModel.C': LESNonlinearModel.C:(.text.startup+0xaf): undefined reference to `Foam::incompressible::turbulenceModel::constructturbulenceModelConstructorTables()' LESNonlinearModel.C:(.text.startup+0xc7): undefined reference to `Foam::incompressible::turbulenceModel::turbulenceModelConstructorTablePtr_' collect2: ld |
|
November 21, 2014, 00:49 |
|
#5 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Problem solved
Here is the new class named LESNonlinearModel LESNonlinear.tar.gz Also, the GenEddyVisc is modified so that nuSgs here represents the SGS stress The problem remains that how to apply this to the nonlinear model |
|
November 21, 2014, 05:35 |
|
#6 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
update again!
I have checked the above code and didn't found anything wrong. Also, it's successfully compiled into the source of openfoam-2.1.1. So I go on with this~ In order to test it's ability in non-linear SGS stress modelling, I make a simple test I modified the Smagorinsky model, make nuSgs = 2*nu()*(S+Omega) S is the strain rate tensor and Omega is the rotation-rate tensor Here is the test model DNSM-forum.tar.gz After this , I do a simple test using channel395 tutorial with the modified Smagorinsky model, however, error occurs as following Code:
Create mesh for time = 0 Reading transportProperties Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting LES turbulence model DNSM #0 Foam::error::printStack(Foam::Ostream&) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigSegv::sigHandler(int) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::incompressible::LESNonlinearModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so" #4 in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/bin/channelRotate" #5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #6 in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/bin/channelRotate" Xianbei |
|
November 21, 2014, 23:07 |
|
#7 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
As I read from here https://openfoamwiki.net/index.php/HowTo_debugging
sigSegV is caused by an application accessing memory outside the allocated space. These are nearly always caused by a programming error.However, I still can't figure out the problem. The error appears at Foam::incompressible::LESNonlinearModel::New, however, this is a very common definition as a constructor |
|
November 23, 2014, 07:49 |
case run in debug mode, while crashes in opt mode,how?
|
#8 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Hi,all:
I tried to implement a nonlinear SGS model into OF as here http://www.cfd-online.com/Forums/ope...sgs-model.html When I turn to the debug mode, the case runs normally, however, if I turn to Opt mode, it crashes with the following errors: Code:
Reading transportProperties Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting LES turbulence model Smagorinsky #0 Foam::error::printStack(Foam::Ostream&) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigSegv::sigHandler(int) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::incompressible::LESNonlinearModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so" #4 in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/bin/channelRotate" #5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #6 in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/bin/channelRotate" |
|
November 23, 2014, 08:19 |
|
#9 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Another question is that the case can't be run in both modes,in Debug mode, it returns
Code:
huangxianbei@huangxianbei-MS-7673:/media/87771eb4-3e70-4aa9-b073-17fd62fd2c2a/huangxianbei/SM-non$ mpirunDebug -np 4 channelRotate -parallel -np channelRotate -parallel nProcs=4 exec=channelRotate args="-parallel" Constructed gdb initialization file /media/87771eb4-3e70-4aa9-b073-17fd62fd2c2a/huangxianbei/SM-non/gdbCommands Choose running method: 0)normal 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind: 2 Run all processes local or distributed? 1)local 2)remote: 1 **sourceFoam:FOAM_INST_DIR=/home/huangxianbei/OpenFOAM . /home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc tail -f processor0.log tail -f processor1.log tail -f processor2.log tail -f processor3.log Constructed /media/87771eb4-3e70-4aa9-b073-17fd62fd2c2a/huangxianbei/SM-non/mpirun.schema file. mpirun -app /media/87771eb4-3e70-4aa9-b073-17fd62fd2c2a/huangxianbei/SM-non/mpirun.schema </dev/null Press return to execute. -------------------------------------------------------------------------- Sorry! You were supposed to get help about: find-available:not-valid But I couldn't open the help file: /home/huangxianbei/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/openmpi-1.5.3/share/openmpi/help-mca-base.txt: No such file or directory. Sorry! -------------------------------------------------------------------------- [huangxianbei-MS-7673:09097] *** Process received signal *** [huangxianbei-MS-7673:09097] Signal: Segmentation fault (11) [huangxianbei-MS-7673:09097] Signal code: Address not mapped (1) [huangxianbei-MS-7673:09097] Failing at address: 0x28 [huangxianbei-MS-7673:09097] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f6cc5deacb0] [huangxianbei-MS-7673:09097] [ 1] /usr/lib/libopen-pal.so.0(mca_base_select+0x108) [0x7f6cc601a518] [huangxianbei-MS-7673:09097] [ 2] /usr/lib/libopen-pal.so.0(opal_crs_base_select+0x7e) [0x7f6cc602c90e] [huangxianbei-MS-7673:09097] [ 3] /usr/lib/libopen-pal.so.0(opal_cr_init+0x31e) [0x7f6cc600b0ee] [huangxianbei-MS-7673:09097] [ 4] /usr/lib/libopen-pal.so.0(opal_init+0x159) [0x7f6cc600aa59] [huangxianbei-MS-7673:09097] [ 5] /usr/lib/libopen-rte.so.0(orte_init+0x4d) [0x7f6cc625ca0d] [huangxianbei-MS-7673:09097] [ 6] mpirun() [0x402fe5] [huangxianbei-MS-7673:09097] [ 7] mpirun() [0x402b34] [huangxianbei-MS-7673:09097] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f6cc5a3c76d] [huangxianbei-MS-7673:09097] [ 9] mpirun() [0x402a59] [huangxianbei-MS-7673:09097] *** End of error message *** |
|
November 23, 2014, 08:38 |
|
#10 |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
I tried http://www.cfd-online.com/Forums/ope...tml#post417690
And fixed the above error in Debug mode However, when run in parallel, the error appears the same as in Opt mode Code:
Selecting incompressible transport model Newtonian Selecting LES turbulence model Smagorinsky Program received signal SIGSEGV, Segmentation fault. 0x00007ffff62e3d5e in Foam::incompressible::LESNonlinearModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) () from /home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so #0 0x00007ffff62e3d5e in Foam::incompressible::LESNonlinearModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) () from /home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so #1 0x000000000044d5e0 in main (argc=2, argv=0x7fffffffced8) at createFields.H:43 (gdb) quit A debugging session is active. Inferior 1 [process 21505] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal] |
|
November 23, 2014, 16:53 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Xianbei,
I'll be moving these posts to the other thread you've mentioned 3 posts ago, because the problem can only be diagnosed with the code provided there. The problem is this piece of code: Code:
DNSM::DNSM ( const volVectorField& U, const surfaceScalarField& phi, transportModel& transport, const word& turbulenceModelName, const word& modelName ) : LESNonlinearModel(modelName, U, phi, transport, turbulenceModelName), GennonlinearSGS(U, phi, transport), Code:
DNSM::DNSM ( const volVectorField& U, const surfaceScalarField& phi, transportModel& transport, const word& turbulenceModelName, const word& modelName ) : GennonlinearSGS(U, phi, transport), This is odd, because the compiler should have complained about this right away. Best regards, Bruno
__________________
|
|
November 23, 2014, 21:04 |
|
#12 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
Thank you very much for your reply. In the above package, I realize something could cause problem when I use a SymmTensor + Tensor I make a modification and upload the following new code here LESNonlinear-update.tar.gz Also, I modified the Smagorinsky model SM-non.tar.gz There should be no problem in the mathematical expression then I tried your method, however, the compiler complains that Code:
Smagorinsky.C: In constructor 'Foam::incompressible::LESNonlinearModels::Smagorinsky::Smagorinsky(const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&, const Foam::word&)': Smagorinsky.C:74:5: error: no matching function for call to 'Foam::incompressible::LESNonlinearModel::LESNonlinearModel()' Smagorinsky.C:74:5: note: candidates are: /home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/LESNonlinear/lnInclude/LESModel.H:133:9: note: Foam::incompressible::LESNonlinearModel::LESNonlinearModel(const Foam::word&, const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&) /home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/LESNonlinear/lnInclude/LESModel.H:133:9: note: candidate expects 5 arguments, 0 provided /home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/LESNonlinear/lnInclude/LESModel.H:101:9: note: Foam::incompressible::LESNonlinearModel::LESNonlinearModel(const Foam::incompressible::LESNonlinearModel&) /home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/LESNonlinear/lnInclude/LESModel.H:101:9: note: candidate expects 1 argument, 0 provided make: *** [Make/linux64GccDPDebug/Smagorinsky.o] Error 1 Code:
LESNonlinearModel(modelName, U, phi, transport, turbulenceModelName), Also, in the original source in Smagorinsky.C Code:
Smagorinsky::Smagorinsky ( const volVectorField& U, const surfaceScalarField& phi, transportModel& transport, const word& turbulenceModelName, const word& modelName ) : LESModel(modelName, U, phi, transport, turbulenceModelName), GenEddyVisc(U, phi, transport), I recompiled the whole code in Opt mode and then run the case in Debug mode in parallel using mpirun -np 4 channelFoam -parallel it goes well. However, it's still a problem that the case crashes in Opt mode with the same error returns in the former post, or if we run the case like this: mpirunDebug -np 4 channelFoam -parallel The error remains because the program will load libso from Opt instead of Debug as following Code:
Selecting incompressible transport model Newtonian Selecting LES turbulence model Smagorinsky [0] #0 Foam::error::printStack(Foam::Ostream&) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" [0] #1 Foam::sigSegv::sigHandler(int) in "/home/huangxianbei/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" [0] #2 in "/lib/x86_64-linux-gnu/libc.so.6" [0] #3 Foam::incompressible::LESNonlinearModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so" [0] #4 [0] at ~/OpenFOAM/huangxianbei-2.1.1/applications/channelRotate/createFields.H:56 [0] #5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" [0] #6 [0] in "/home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPDebug/bin/channelRotate" [huangxianbei-MS-7673:18884] *** Process received signal *** [huangxianbei-MS-7673:18884] Signal: Segmentation fault (11) [huangxianbei-MS-7673:18884] Signal code: (-6) [huangxianbei-MS-7673:18884] Failing at address: 0x3e8000049c4 [huangxianbei-MS-7673:18884] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7ff111a604a0] [huangxianbei-MS-7673:18884] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7ff111a60425] [huangxianbei-MS-7673:18884] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7ff111a604a0] [huangxianbei-MS-7673:18884] [ 3] /home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPOpt/lib/libLESNonlinearModels.so(_ZN4Foam14incompressible17LESNonlinearModel3NewERKNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEERKNS2_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERNS_14transportModelERKNS_4wordE+0x18e) [0x7ff112f5bd5e] [huangxianbei-MS-7673:18884] [ 4] /home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPDebug/bin/channelRotate() [0x44d5e0] [huangxianbei-MS-7673:18884] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ff111a4b76d] [huangxianbei-MS-7673:18884] [ 6] /home/huangxianbei/OpenFOAM/huangxianbei-2.1.1/platforms/linux64GccDPDebug/bin/channelRotate() [0x44cbe9] [huangxianbei-MS-7673:18884] *** End of error message *** Last edited by huangxianbei; November 23, 2014 at 23:33. |
||
January 2, 2015, 10:48 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Xianbei,
I've finally managed to look into this. Here's what I've found:
I've attached the tarball "nonlinearLESkit-v1.tar.gz" that has the working folder structure I built based on your files, in addition to adding more of the necessary files and example case. Note: This is meant to be used with OpenFOAM 2.1.1. To use:
Oh, the missing important detail is that this line: Code:
constructdictionaryConstructorTables(); ------------------ edit: OK, I've figured it out. When optimized, there are some-things that aren't called because it's non-optimal to call something that isn't going to be used in the first place. This might not be the exact situation in this case, but it's probably very close to the truth. So, if the example simulation case has this entry in the "controlDict" file: Code:
libs ( "libSmagorinsky.so" ); Code:
addToRunTimeSelectionTable(LESNonlinearModel, Smagorinsky, dictionary); ----------------- Best regards, Bruno
__________________
Last edited by wyldckat; February 8, 2015 at 09:28. Reason: see "edit:" and "Note:" |
|
January 6, 2015, 07:08 |
|
#14 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
Thank you very much for the details. You mean that Code:
libs ( "libSmagorinsky.so" ); I will try it latter. Xianbei |
||
January 10, 2015, 10:40 |
|
#15 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Xianbei,
Quote:
Code:
libs ( "libSmagorinsky.so" ); //.... libs ( "libOpenFOAM.so" ); Code:
libs ( "libSmagorinsky.so" "libOpenFOAM.so" ); Bruno |
||
January 11, 2015, 00:02 |
|
#16 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
|
||
January 11, 2015, 13:38 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: It's not a question of order. The problem is really that two occurrences of "libs" will result in failure to load the other libraries, because the parser will not care about them.
|
|
January 11, 2015, 21:40 |
|
#18 | |
Senior Member
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14 |
Quote:
The testcase provided is used as Code:
libs ( "libOpenFOAM.so" "libdynamicSmagorinskyModel.so" ) ; |
||
January 18, 2015, 16:07 |
|
#19 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer - the error might happen if you do the following by accident:
Code:
libs ( "libOpenFOAM.so" ); libs ( "libdynamicSmagorinskyModel.so" ); |
|
February 3, 2015, 19:30 |
|
#20 |
New Member
karar
Join Date: Feb 2013
Posts: 13
Rep Power: 13 |
Hi
Did you solve your problem. because I also, deal with the SGS stress instead of the eddy viscosity. i have try to compiled yours nonlinearLEskit. but it gave me compalition error (error 1) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Two way Fsi Problem- Non linear problem | kmgraju | CFX | 4 | April 28, 2015 12:15 |
the combustion model problem | hanshandiaoke | STAR-CD | 7 | December 2, 2011 04:47 |
the combustion model problem | hanshandiaoke | Siemens | 0 | November 25, 2011 21:37 |
Problem in Buoyancy Model? | dhrubo | CFX | 3 | June 5, 2010 06:32 |
solution diverges when linear upwind interpolation scheme is used | subash | OpenFOAM | 0 | May 29, 2010 02:23 |