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

Error when compiling custom solver for an arc flash simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2024, 09:43
Post Error when compiling custom solver for an arc flash simulation
  #1
New Member
 
Gerald
Join Date: Jun 2024
Posts: 1
Rep Power: 0
geraldnjw is on a distinguished road
Hello all!

I am trying to simulate the pressure distribution in a room due to an arc flash using a custom solver I am modifying from rhoCentralFoam. I am treating the arc flash as a heat source and want to add the energy released as a source term Q, where Q=kp*Warc.

I added this in the createFields.H file:
Code:
IOdictionary arcProperties
(
    IOobject
    (
        "arcProperties",
        runTime.constant(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    )
);

dimensionedScalar kp
(
	"kp",
	dimless,
	arcProperties.lookup("kp"),
);

dimensionedScalar Warc
(
	"kp",
	dimEnergy,
	arcProperties.lookup("Warc"),
);

volScalarField Q
(
    IOobject
    (
        "Q",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    kp*Warc,
);
While compiling the source code i encountered these errors.

Code:
Making dependencies: AFRhoCentralFoam.C
g++ -std=c++14 -m64 -pthread -DOPENFOAM=2406 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3  -DNoRepository -ftemplate-depth-100  -IBCs/lnInclude -I/usr/lib/openfoam/openfoam2406/src/finiteVolume/lnInclude -I/usr/lib/openfoam/openfoam2406/src/meshTools/lnInclude -I/usr/lib/openfoam/openfoam2406/src/transportModels/compressible/lnInclude -I/usr/lib/openfoam/openfoam2406/src/thermophysicalModels/basic/lnInclude -I/usr/lib/openfoam/openfoam2406/src/thermophysicalModels/specie/lnInclude -I/usr/lib/openfoam/openfoam2406/src/TurbulenceModels/turbulenceModels/lnInclude -I/usr/lib/openfoam/openfoam2406/src/TurbulenceModels/compressible/lnInclude -I/usr/lib/openfoam/openfoam2406/src/dynamicFvMesh/lnInclude -iquote. -IlnInclude -I/usr/lib/openfoam/openfoam2406/src/OpenFOAM/lnInclude -I/usr/lib/openfoam/openfoam2406/src/OSspecific/POSIX/lnInclude   -fPIC -c AFRhoCentralFoam.C -o Make/linux64GccDPInt32Opt/AFRhoCentralFoam.o
In file included from /usr/lib/openfoam/openfoam2406/src/OpenFOAM/lnInclude/postProcess.H:147,
                 from AFRhoCentralFoam.C:61:
./createFields.H: In function ‘int main(int, char**)’:
./createFields.H:121:1: error: expected primary-expression before ‘)’ token
  121 | );
      | ^
./createFields.H:128:1: error: expected primary-expression before ‘)’ token
  128 | );
      | ^
./createFields.H:141:1: error: expected primary-expression before ‘)’ token
  141 | );
      | ^
In file included from AFRhoCentralFoam.C:67:
createFields.H:121:1: error: expected primary-expression before ‘)’ token
  121 | );
      | ^
createFields.H:128:1: error: expected primary-expression before ‘)’ token
  128 | );
      | ^
createFields.H:141:1: error: expected primary-expression before ‘)’ token
  141 | );
      | ^
make: *** [/usr/lib/openfoam/openfoam2406/wmake/rules/General/transform:38: Make/linux64GccDPInt32Opt/AFRhoCentralFoam.o] Error 1
Does anyone know the cause of these errors and/or how to resolve them? Any help would be greatly appreciated! I am using openfoam v2406.
geraldnjw is offline   Reply With Quote

Old   Today, 06:02
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Why do you have a trailing comma after each of the last parameters? This is not good.
olesen is offline   Reply With Quote

Reply

Tags
heat source term, rhocentralfoam


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
Divergence detected in AMG solver. VOF. Mr.Mister Fluent Multiphase 5 November 22, 2024 07:32
CPUs vs GPUs for CFD? hami11 Hardware 22 July 23, 2024 16:59
viscosity udf don't use correct temperature and strain rate rezvani Fluent UDF and Scheme Programming 8 May 27, 2021 06:40
[blockMesh] Meshing a circle in a square ChasingNeutrons OpenFOAM Meshing & Mesh Conversion 6 October 11, 2016 21:42
settlingFoam unstable? bendel_boy OpenFOAM Running, Solving & CFD 38 July 8, 2016 06:07


All times are GMT -4. The time now is 14:45.