|
[Sponsors] |
October 16, 2017, 15:18 |
how to change boundaryType in volScalarField
|
#1 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Hi All,
In constructor of GeometricField class we have Code:
GeometricField ( const IOobject & io, const Mesh & mesh, const dimensioned< Type > & dt, const word & patchFieldType = PatchField<Type>::calculatedType() ) How can I define GeometricField with zeroGradient patchFieldType??
__________________
best regards pblasiak |
|
October 17, 2017, 15:41 |
|
#2 |
Senior Member
|
Hi,
You can use just "zeroGradient" string or zeroGradientFvPatchField<Type>::typeName if you would like to be sure your modification survives rename of zeroGradient. |
|
October 19, 2017, 15:30 |
|
#3 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Quote:
It tells me that zeroGradient was not declared in this scope...
__________________
best regards pblasiak |
||
October 19, 2017, 17:24 |
|
#4 |
Senior Member
|
Hi,
To use zeroGradientFvPatchField you have to include zeroGradientFvPatchFields.H. If you do not want to bother, use string "zeroGradient". |
|
October 20, 2017, 05:20 |
|
#5 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Hi Alexeym,
I added zeroGradientFvPatchFields.H but it still tells that zeroGradient was not declared in this scope. My code is (in constructor) Code:
A ( IOobject ( "A", U.mesh().time().timeName(), IOobject::NO_READ, IOobject::NO_WRITE ), U.mesh(), dimensionedScalar("A", dimTemperature, 0.0), zeroGradient ),
__________________
best regards pblasiak |
|
October 20, 2017, 07:16 |
|
#6 |
Senior Member
|
Hi,
You could try to use more conventional C++ syntax (first one uses string, second uses static field): Code:
A ( IOobject ( "A", U.mesh().time().timeName(), IOobject::NO_READ, IOobject::NO_WRITE ), U.mesh(), dimensionedScalar("A", dimTemperature, 0.0), "zeroGradient" ), Code:
A ( IOobject ( "A", U.mesh().time().timeName(), IOobject::NO_READ, IOobject::NO_WRITE ), U.mesh(), dimensionedScalar("A", dimTemperature, 0.0), zeroGradientFvPatchScalarField::typeName ), |
|
October 20, 2017, 07:35 |
|
#7 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Now it works
Thank you so much Alexeym.
__________________
best regards pblasiak |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 09:21 |
Can a solver change the type of a boundary/patch ? | fredo490 | OpenFOAM Programming & Development | 6 | June 24, 2021 11:14 |
if-loop, volScalarField comparison | volker | OpenFOAM | 7 | March 6, 2020 20:03 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 17:11 |
dimensionedScalar + volScalarField is evaluated elementwisely ? | tianyikillua | OpenFOAM Programming & Development | 1 | March 30, 2012 03:12 |