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

How to convert ScalarField into VolScalar Field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2022, 02:25
Default How to convert ScalarField into VolScalar Field
  #1
New Member
 
Join Date: Jun 2022
Posts: 10
Rep Power: 4
AbhishekTAMU is on a distinguished road
I am using a scalarField 'skewness' and assigning it to volScalarField I have created called as 'skewFactor' so that I can calculate 'skewness' run-time and use it as volScalarField for my problem. I have done following changes in my solver. I am using 'interFoam' solver.

//added following files
#include "cellQuality.H"
#include "unitConversion.H"
#include "SubField.H"

//created object to use cellQuality.C file functions
const cellQuality& cQ = mesh;


//custom field which I have created
volScalarField skewFactor
(
IOobject
(
"skewFactor",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("skewFactor", dimless, 0)
);


//assigning skewness calculated from skewness function from cellQuality.C file to volScalar Field skewFactor

skewFactor.internalField()=cQ.skewness();

the error is :

error: no operator "=" matches these operands
operand types are: const Foam:imensionedField<Foam::scalar, Foam::volMesh> = Foam::tmp<Foam::Field<Foam::scalar>>
AbhishekTAMU 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
overPimpleDyMFoam rotating airfoil startup problems jantheron OpenFOAM Running, Solving & CFD 1 May 20, 2020 05:55
funkySetBoundaryFields - Manipulation of existing field jhertel OpenFOAM Pre-Processing 16 May 18, 2020 07:32
[swak4Foam] swakExpression not writing to log alexfells OpenFOAM Community Contributions 3 March 16, 2020 19:19
Access to field which is evaluated at the moment Tobi OpenFOAM Programming & Development 6 April 19, 2017 14:09
How does one convert a scalarField into a volScalarField Marco Kupiainen (Kupiainen) OpenFOAM Running, Solving & CFD 23 August 4, 2016 10:43


All times are GMT -4. The time now is 01:00.