CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Implement a non-orthogonal correction on the boundary snGrad

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2020, 05:37
Unhappy Implement a non-orthogonal correction on the boundary snGrad
  #1
New Member
 
anonymous
Join Date: Aug 2019
Posts: 4
Rep Power: 6
yyy155klt is on a distinguished road
Hi,
I’m a newbie to OpenFOAM, and have a problem with implementing a non-orthogonal correction on the boundary.

The reason why I wanted to do so is this forum.
(snGradCorrection)

I tried to modify fixedValueFvPatchField.C and make fixedValue to override snGrad, but a lot of error occurred.
I spent a lot of time on that, but I couldn’t solve it. (It should be involved to usage of member function.)
Does anyone know a solution to this?

I’m using OpenFOAM 6.

Thanks in advance.
Attached Files
File Type: gz testmyFixedValue200928.tar.gz (10.8 KB, 0 views)
File Type: gz log.tar.gz (42.4 KB, 0 views)
yyy155klt is offline   Reply With Quote

Old   September 28, 2020, 06:39
Default
  #2
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
In my version of FOAM, the fvPatchField<Type> class defiens the snGrad member, which is virtual:
Code:
 virtual tmp<Field<Type> > snGrad() const;
Which means you can write your version directly onto any other class derived from fvPatchField<Type>. I suggest you NOT TO MODIFY the fixedValue template class, but just create a copy, and work there.
Santiago is offline   Reply With Quote

Old   September 28, 2020, 08:04
Default
  #3
New Member
 
anonymous
Join Date: Aug 2019
Posts: 4
Rep Power: 6
yyy155klt is on a distinguished road
Hello Santiago.
I'm very grateful for your fast response.

Quote:
I suggest you NOT TO MODIFY the fixedValue template class, but just create a copy, and worked there.
I’m very sorry, but I forgot to mention.
I copied “fixedValue” to my src directory ($WM_PROJECT_USER_DIR/src) and work there.

Quote:
Which means you can write your version directly onto any other class derived from fvPatchField<Type>.
Do you mean that your recommendation is I revise snGrad (implement non-orthogonal correction) not in fixedValue but in fvPatchField?
Actually, I had tried to revise fvPatchField (copied it to my own directory), but I couldn’t compile it.

I replaced “fvPatchField” to “myFvPatchField” and implement non-orthogonal correction to snGrad() in myFvPatchField.C.
(Because “calculatedFvPatchField.H” is included in fvPatchField.H, I added “myCalculated” (copied from “calculated” ).)

Attached log is as shown in this.
Code:
wmake libso .
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file myCalculatedmyFvPatchFields.C
Making dependency list for source file myFvPatchFields.C
g++ -std=c++11 -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/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/finiteVolume/lnInclude  -IlnInclude -I. -I/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude -I/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OSspecific/POSIX/lnInclude   -fPIC -c myFvPatchField_withCorrection_200927/myFvPatchFields.C -o Make/linux64GccDPInt32Opt/myFvPatchField_withCorrection_200927/myFvPatchFields.o
g++ -std=c++11 -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/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/finiteVolume/lnInclude  -IlnInclude -I. -I/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude -I/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OSspecific/POSIX/lnInclude   -fPIC -c myCalculated/myCalculatedmyFvPatchFields.C -o Make/linux64GccDPInt32Opt/myCalculated/myCalculatedmyFvPatchFields.o
In file included from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/typeInfo.H:57:0,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/token.H:46,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/UListIO.C:28,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/UList.C:233,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/UList.H:484,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/List.H:43,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/wordList.H:42,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/patchIdentifier.H:38,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/polyPatch.H:42,
                 from /work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/finiteVolume/lnInclude/fvPatch.H:39,
                 from lnInclude/myFvPatchField.H:47,
                 from myCalculated/myCalculatedmyFvPatchField.H:50,
                 from myCalculated/myCalculatedmyFvPatchFields.H:29,
                 from myCalculated/myCalculatedmyFvPatchFields.C:26:
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:99:5: error: expected constructor, destructor, or type conversion before ‘template’
     template<>                                                                 \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:112:5: note: in expansion of macro ‘defineTemplateTypeNameWithName’
     defineTemplateTypeNameWithName(Type, Type::typeName_())
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:135:5: note: in expansion of macro ‘defineNamedTemplateTypeName’
     defineNamedTemplateTypeName(Type);                                         \
     ^
lnInclude/myFvPatchField.H:674:5: note: in expansion of macro ‘defineNamedTemplateTypeNameAndDebug’
     defineNamedTemplateTypeNameAndDebug                                        \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/fieldTypes.H:52:5: note: in expansion of macro ‘myMakeTemplatePatchTypeField’
     Macro(vector, __VA_ARGS__)                                                 \
     ^
lnInclude/myFvPatchField.H:686:5: note: in expansion of macro ‘FOR_ALL_FIELD_TYPES’
     FOR_ALL_FIELD_TYPES(myMakeTemplatePatchTypeField, type)
     ^
myCalculated/myCalculatedmyFvPatchFields.C:43:1: note: in expansion of macro ‘myMakePatchFields’
 myMakePatchFields(myCalculated);
 ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:99:5: error: expected constructor, destructor, or type conversion before ‘template’
     template<>                                                                 \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:112:5: note: in expansion of macro ‘defineTemplateTypeNameWithName’
     defineTemplateTypeNameWithName(Type, Type::typeName_())
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:135:5: note: in expansion of macro ‘defineNamedTemplateTypeName’
     defineNamedTemplateTypeName(Type);                                         \
     ^
lnInclude/myFvPatchField.H:674:5: note: in expansion of macro ‘defineNamedTemplateTypeNameAndDebug’
     defineNamedTemplateTypeNameAndDebug                                        \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/fieldTypes.H:53:5: note: in expansion of macro ‘myMakeTemplatePatchTypeField’
     Macro(sphericalTensor, __VA_ARGS__)                                        \
     ^
lnInclude/myFvPatchField.H:686:5: note: in expansion of macro ‘FOR_ALL_FIELD_TYPES’
     FOR_ALL_FIELD_TYPES(myMakeTemplatePatchTypeField, type)
     ^
myCalculated/myCalculatedmyFvPatchFields.C:43:1: note: in expansion of macro ‘myMakePatchFields’
 myMakePatchFields(myCalculated);
 ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:99:5: error: expected constructor, destructor, or type conversion before ‘template’
     template<>                                                                 \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:112:5: note: in expansion of macro ‘defineTemplateTypeNameWithName’
     defineTemplateTypeNameWithName(Type, Type::typeName_())
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:135:5: note: in expansion of macro ‘defineNamedTemplateTypeName’
     defineNamedTemplateTypeName(Type);                                         \
     ^
lnInclude/myFvPatchField.H:674:5: note: in expansion of macro ‘defineNamedTemplateTypeNameAndDebug’
     defineNamedTemplateTypeNameAndDebug                                        \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/fieldTypes.H:54:5: note: in expansion of macro ‘myMakeTemplatePatchTypeField’
     Macro(symmTensor, __VA_ARGS__)                                             \
     ^
lnInclude/myFvPatchField.H:686:5: note: in expansion of macro ‘FOR_ALL_FIELD_TYPES’
     FOR_ALL_FIELD_TYPES(myMakeTemplatePatchTypeField, type)
     ^
myCalculated/myCalculatedmyFvPatchFields.C:43:1: note: in expansion of macro ‘myMakePatchFields’
 myMakePatchFields(myCalculated);
 ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:99:5: error: expected constructor, destructor, or type conversion before ‘template’
     template<>                                                                 \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:112:5: note: in expansion of macro ‘defineTemplateTypeNameWithName’
     defineTemplateTypeNameWithName(Type, Type::typeName_())
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/className.H:135:5: note: in expansion of macro ‘defineNamedTemplateTypeName’
     defineNamedTemplateTypeName(Type);                                         \
     ^
lnInclude/myFvPatchField.H:674:5: note: in expansion of macro ‘defineNamedTemplateTypeNameAndDebug’
     defineNamedTemplateTypeNameAndDebug                                        \
     ^
/work/opt/local/apps/gcc/4.8.5/impi/2019.4.243/openfoam/6/OpenFOAM-6/src/OpenFOAM/lnInclude/fieldTypes.H:55:5: note: in expansion of macro ‘myMakeTemplatePatchTypeField’
     Macro(tensor, __VA_ARGS__)
     ^
lnInclude/myFvPatchField.H:686:5: note: in expansion of macro ‘FOR_ALL_FIELD_TYPES’
     FOR_ALL_FIELD_TYPES(myMakeTemplatePatchTypeField, type)
     ^
myCalculated/myCalculatedmyFvPatchFields.C:43:1: note: in expansion of macro ‘myMakePatchFields’
 myMakePatchFields(myCalculated);
 ^
myCalculated/myCalculatedmyFvPatchFields.C:43:32: error: expected constructor, destructor, or type conversion before ‘;’ token
 myMakePatchFields(myCalculated);
                                ^
make: *** [Make/linux64GccDPInt32Opt/myCalculated/myCalculatedmyFvPatchFields.o] Error 1
I’m not sure how to solve it.

Thank you very much.
yyy155klt is offline   Reply With Quote

Old   September 29, 2020, 21:33
Default
  #4
New Member
 
anonymous
Join Date: Aug 2019
Posts: 4
Rep Power: 6
yyy155klt is on a distinguished road
Hi,
I’m terribly sorry, I failed to attach the files (revised library and log(compile error)) on my last post.

Thanks in advance.
Attached Files
File Type: gz myFvPatchFields.tar.gz (36.5 KB, 0 views)
File Type: gz log.tar.gz (1.1 KB, 0 views)
yyy155klt is offline   Reply With Quote

Reply

Tags
boundary, fixedvalue, non-orthogonal correction, openfoam 6, sngrad


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
UDF for Automatic Solution Initialization for previous case data file gartz89 Fluent UDF and Scheme Programming 6 March 30, 2020 07:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 13:55
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 06:18


All times are GMT -4. The time now is 06:32.