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

fvOptions CellSet was not declared in this scope

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2025, 01:49
Default fvOptions CellSet was not declared in this scope
  #1
New Member
 
Join Date: Jan 2025
Posts: 1
Rep Power: 0
defeatedUniStudent is on a distinguished road
I am trying to input a momentum source through fvOptions into a cellSet. In topoSetDict i created a CellSet called plasmaCellSet and a cellZone called plasma. When i try to use plasmaCellSet in fvOptions i get an error saying it is not within the scope and suggests smCellSet? How do I get fvOptions to recognize plasmaCellSet? Thank you!!
/home/user1/withTurb/constant/fvOptions/actuatorForceSource/vectorCodedSourceCoeffs: In member function ‘virtual void Foam::fv::actuatorForceSourceFvOptionvectorSource: :addSup(Foam::fvMatrix<Foam::Vector<double> >&, Foam::label)’:
/home/user1/withTurb/constant/fvOptions/actuatorForceSource/vectorCodedSourceCoeffs:47:33: error: ‘plasmaCellSet’ was not declared in this scope; did you mean ‘smCellSet’?
/home/user1/withTurb/constant/fvOptions/actuatorForceSource/vectorCodedSourceCoeffs:60:79: error: ‘class Foam::cellSet’ has no member named ‘V’
make: *** [/usr/lib/openfoam/openfoam2412/wmake/rules/General/transform:38: Make/linuxARM64GccDPInt32Opt/codedFvOptionTemplate.o] Error 1


--> FOAM FATAL IO ERROR: (openfoam-2412)
Failed wmake "dynamicCode/actuatorForceSource/platforms/linuxARM64GccDPInt32Opt/lib/libactuatorForceSource_68faa9f8dc0a8c5f007d185c578 bf4d190b12a44.so"


file: constant/fvOptions/actuatorForceSource/vectorCodedSourceCoeffs at line 27 to 66.

From void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
in file db/dynamicLibrary/codedBase/codedBase.C at line 245.

FOAM exiting

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(

//Plasma
{
name plasmaCellSet;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
//location of plasma, AKA//
//second actuator, use Charlie's point thing to find//
min (0.05 0.005294 0);
max (0.07 0.007994 0.05);
}
}

{
name plasma;
type cellZoneSet;
action new;
source setToCellZone;
sourceInfo
{
set plasmaCellSet;
}
}
);

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "../system/topoSetDict"

actuatorForceSource
{
type vectorCodedSource;
active true;
name actuatorForceSource;

vectorCodedSourceCoeffs
{

selectionMode cellSet;
cellSet plasmaCellSet;

fields (U); //Modify field U

codeInclude
#{
#include "topoSet.H"
#include "cellSetOption.H"
#include "cellSet.H"
#include "fvMesh.H"
#include "volFields.H"
#};

codeCorrect
#{
Pout<< "**codeCorrect**" << endl;
#};

codeAddSup
#{
cellSet selectedCells = (mesh_, plasmaCellSet);
labelList cells = selectedCells.toc ();
const Time& time = mesh().time();

const scalar pi(M_PI);

const scalar f_base = 2e3;//Hz base frequency

const scalar startTime = 2.0;//s
vectorField& Su = eqn.source();

if(time.value() > startTime)
{
UIndirectList<vector>(Su, cells) = vector(0.006705, 0, 0) / selectedCells.V();
eqn.source() += Su * pow(sin(2*pi*f_base*time.value()), 2);
}
#};

codeConstrain
#{
Pout<< "**codeConstrain**" << endl;
#};

}
}

// ************************************************** *********************** //
defeatedUniStudent is offline   Reply With Quote

Old   January 29, 2025, 10:28
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 809
Rep Power: 15
Tobermory will become famous soon enough
You have the following in your fvOptions file

Code:
#include "../system/topoSetDict"
Remove that, run topoSet (which will operate on the topoSetDict and generate the plasmaCellSet and plasma sets under constant/polymesh/sets) and then run your simulation - it will now be able to pick up plasma cellZone set
Tobermory is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 05:53
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 13:34
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 06:07


All times are GMT -4. The time now is 13:42.