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

Set dimensionless in foam-extend-5.0

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By kilimanjaro2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2023, 03:47
Default Set dimensionless in foam-extend-5.0
  #1
Member
 
Nguyen Trong Hiep
Join Date: Aug 2018
Posts: 48
Rep Power: 7
hiep.nguyentrong is on a distinguished road
Hi all,
i want to create a volScalarField have dimensionless with zero initialization.

Code:
    volScalarField field
    (
        IOobject
        (
            "field",
            mesh.time().timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE,
            false 
        ),
        dimensionedScalar(dimless, Zero)
    );
but when i compile it, an error apear:
Code:
error: no matching function for call to ‘Foam::dimensioned<double>::dimensioned(const Foam::dimensionSet&, const Foam::zero&)’
         dimensionedScalar(dimless, Zero)
Can you help me to solve it?
hiep.nguyentrong is offline   Reply With Quote

Old   January 11, 2023, 04:22
Default
  #2
New Member
 
Join Date: Dec 2022
Posts: 14
Rep Power: 3
kilimanjaro2 is on a distinguished road
give it a name: dimensionedScalar("someName", dimless, Zero)
and the mesh also:
volScalarField field
(
IOobject
(
"field",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh

dimensionedScalar("someName",dimless, Zero)
);
hiep.nguyentrong likes this.
kilimanjaro2 is offline   Reply With Quote

Old   January 11, 2023, 04:30
Default
  #3
Member
 
Nguyen Trong Hiep
Join Date: Aug 2018
Posts: 48
Rep Power: 7
hiep.nguyentrong is on a distinguished road
Thank you very much
hiep.nguyentrong is offline   Reply With Quote

Reply


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[blockMesh] mergePatchPairs problem when using two master and slave combination Ali_Sh OpenFOAM Meshing & Mesh Conversion 0 September 22, 2021 09:35
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38


All times are GMT -4. The time now is 18:02.