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

fvOption functionality

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2018, 04:08
Default
  #21
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Quote:
Originally Posted by npatricia View Post
--> FOAM FATAL ERROR:
Attempt to return primitive entry ITstream : /home/tflows/OpenFOAM/OpenFOAM-2.4.0/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/solarPond_1/constant/fvOptions.radiation.sourceTimeCoeffs, line 89, IOstream: Version 2.0, format ASCII, line 0, OPENED, GOOD
primitiveEntry 'sourceTimeCoeffs' comprises
on line 89 the verbatim string "\
"

as a sub-dictionary
That's what you are looking for. I tried to identify the error in your fvOptions post above, but couldnt find the line. Maybe you have more look when looking at your dict file.
My guess would be, that having the \ character there is of no use and/or missplaced.
RobertHB is offline   Reply With Quote

Old   February 26, 2018, 04:22
Default
  #22
Member
 
PATRICIA NAKANWAGI
Join Date: May 2017
Posts: 47
Rep Power: 8
npatricia is on a distinguished road
type scalarCodedSource;
active yes;
name radiativeHeatExchange;
selectionMode all;

scalarCodedSourceCoeffs
{
fieldNames (T);
redirectType sourceTime;

codeInclude
#{
// Need this for Stefan-Boltzmann constant
#include "constants.H"
#};

codeCorrect
#{
#};

codeAddSup
#{
using constant:hysicoChemical::sigma;

if (not isActive())
return;

// Looking up model parameters
scalar Qsm = coeffs().lookupOrDefault<scalar>("Qsm", 164.0);
scalar rhow = coeffs().lookupOrDefault<scalar>("rho", 1000);
scalar Cp = coeffs().lookupOrDefault<scalar>("Cp", 4200);
scalar Rt = coeffs().lookupOrDefault<scalar>("Rt", 0.03);
scalar ew = coeffs().lookupOrDefault<scalar>("ew", 0.97);

// Getting source vector from equation matrix
scalarField& src = eqn.source();
const volScalarField& T = eqn.psi();

// Iterating through patch
word top_patch_name = coeffs().lookupOrDefault<word>("patch", "top");
const fvPatch& pp = mesh().boundary()[top_patch_name];
forAll(pp, i) {
label cell_i = pp.faceCells()[i];
scalar Ai = pp.magSf()[i];
scalar Ts = T[cell_i];

// Heating
src[cell_i] -= Qsm*(1-Rt)*Ai/rhow/Cp;

// Cooling
src[cell_i] -= -sigma.value()*ew*pow4(Ts)*Ai/rhow/Cp;
}
#};

codeSetValue
#{
#};

code
#{
$codeInclude;
$codeCorrect;
$codeAddSup;
$codeSetValue;
#};
}

sourceTimeCoeffs
#{
#};

radiativeHeatExchangeCoeffs
{
selectionMode all;

patch top; // Name of the top patch
Qsm 163.0; // Solar radiative heat flux
Rt 0.03; // Reflectivity of water
ew 0.97; // Emissivity of water
rho 1000.0;
Cp 4200.0;
}
}

I modified my fvOptions file as the above following earlier errors I was getting
npatricia is offline   Reply With Quote

Old   February 26, 2018, 04:28
Default
  #23
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Quote:
Originally Posted by npatricia View Post
sourceTimeCoeffs
#{
#};
Looks fine to me. Whatever the problem, you could try deleting the #{ #}; part and rewriting it by hand. Might fix the problem.

/edit: To add a bit of background to my idea: Your error complains about the string "\ " in the sourceTimeCoeffs. As you can see from your dict, there is no such string. But, to my knowledge, "\ " is used by a few programs to define the beginning of a new line. maybe your OpenFOAM got confused be the editor you use or you copied the content of the dict file from this forum? If yes, simple retyping the above mentioned part might be helpful.
RobertHB is offline   Reply With Quote

Old   February 26, 2018, 07:44
Default
  #24
Member
 
PATRICIA NAKANWAGI
Join Date: May 2017
Posts: 47
Rep Power: 8
npatricia is on a distinguished road
Thanks alot RobertHB, was able to rectify the error with adding a string to my sourceTimeCoeffs. Thanks once again
npatricia is offline   Reply With Quote

Old   April 21, 2018, 06:15
Default
  #25
fcl
New Member
 
Join Date: Oct 2017
Posts: 14
Rep Power: 8
fcl is on a distinguished road
Hello RobertHB,
I can add a heat source in your way, but I need to add
the source in specific time, and limit the duration of the source. Could you please tell me
what should I do to add a 'startTime'.
Thank you in advance.
fcl is offline   Reply With Quote

Old   April 22, 2018, 07:58
Default
  #26
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Hello fcl,
fvOption supports the keywords timeStart and duration. For further instructions see (e.g.) here.
RobertHB is offline   Reply With Quote

Old   April 22, 2018, 09:43
Default
  #27
fcl
New Member
 
Join Date: Oct 2017
Posts: 14
Rep Power: 8
fcl is on a distinguished road
Thanks a lot RobertHB.
I finally found out that, there need a conversion between mesh time and engine time in fvOption,because my simulation is for internal combustion engine
fcl is offline   Reply With Quote

Old   April 22, 2018, 09:49
Default
  #28
Member
 
PATRICIA NAKANWAGI
Join Date: May 2017
Posts: 47
Rep Power: 8
npatricia is on a distinguished road
Hello fcl,

Kindly give me a hand on this. An getting an error in running my case which am failing to understand
Time = 0.1

DILUPBiCGStab: Solving for Ux, Initial residual = 1.50379e-12, Final residual = 1.50379e-12, No Iterations 0
DILUPBiCGStab: Solving for Uy, Initial residual = 2.30853e-12, Final residual = 2.30853e-12, No Iterations 0
DILUPBiCGStab: Solving for Uz, Initial residual = 1.86985e-12, Final residual = 1.86985e-12, No Iterations 0
Using dynamicCode for fvOption:: radiativeHeatExchange at line 29 in "/home/patricia/OpenFoam/OpenFOAM-5.0/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/solarpond/constant/fvOptions.radiation.scalarCodedSourceCoeffs"
Selecting finite volume options model type radiativeHeatExchange
Source: radiativeHeatExchange
- selecting all cells
- selected 4000 cell(s) with volume 4
DILUPBiCGStab: Solving for T, Initial residual = 1, Final residual = 0.0414164, No Iterations 1
DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.00369374, No Iterations 7
time step continuity errors : sum local = 1.64439e+14, global = -0.00620117, cumulative = -0.00620117
ExecutionTime = 0.05 s ClockTime = 0 s

Time = 0.2

DILUPBiCGStab: Solving for Ux, Initial residual = 0.142672, Final residual = 0.00310035, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 0.050394, Final residual = 0.000837148, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.142672, Final residual = 0.00310035, No Iterations 1
DILUPBiCGStab: Solving for T, Initial residual = 0.205486, Final residual = 0.0128, No Iterations 1
DICPCG: Solving for p_rgh, Initial residual = 0.989794, Final residual = 122.425, No Iterations 1001
time step continuity errors : sum local = 6.73093e+17, global = 21, cumulative = 20.9938
ExecutionTime = 0.13 s ClockTime = 0 s

Time = 0.3

DILUPBiCGStab: Solving for Ux, Initial residual = 0.290563, Final residual = 0.0017344, No Iterations 10
DILUPBiCGStab: Solving for Uy, Initial residual = 0.29545, Final residual = 0.00188439, No Iterations 9
DILUPBiCGStab: Solving for Uz, Initial residual = 0.331798, Final residual = 0.00214973, No Iterations 10
DILUPBiCGStab: Solving for T, Initial residual = 0.0995518, Final residual = 0.00073122, No Iterations 1
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam:ICPreconditioner::calcReciprocalD(Foam::Fie ld<double>&, Foam::lduMatrix const&) at ??:?
#4 Foam:ICPreconditioner:ICPreconditioner(Foam::l duMatrix::solver const&, Foam::dictionary const&) at ??:?
#5 Foam::lduMatrix:reconditioner::addsymMatrixConst ructorToTable<Foam:ICPreconditioner>::New(Foam:: lduMatrix::solver const&, Foam::dictionary const&) at ??:?
#6 Foam::lduMatrix:reconditioner::New(Foam::lduMatr ix::solver const&, Foam::dictionary const&) at ??:?
#7 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#8 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) at ??:?
#9 Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#10 Foam::fvMatrix<double>::solve() at ??:?
#11 ? at ??:?
#12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13 ? at ??:?
Floating point exception (core dumped)

What could be the problem here?
Thank you

PATRICIA
npatricia is offline   Reply With Quote

Old   April 22, 2018, 10:05
Default
  #29
fcl
New Member
 
Join Date: Oct 2017
Posts: 14
Rep Power: 8
fcl is on a distinguished road
Hello npatricia,
sorry, I'm a new foamer.
According to me, you case seems failed to converge. Maybe you need to check your condition and the value of time step.
fcl 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
[swak4Foam] swak4foam for fe40: fvOption library don't compile? jf_vt OpenFOAM Community Contributions 7 August 10, 2023 03:00
[General] Paraview crashes using "Find Data" functionality Turbine ParaView 3 May 6, 2020 22:40
reactingFoam fvOption ignition khalifa OpenFOAM Programming & Development 8 January 6, 2019 18:45
fvOption interpolation scheme aghsin OpenFOAM Running, Solving & CFD 0 June 25, 2016 09:01
face functionality for a DynamicList tomislav_maric OpenFOAM Programming & Development 2 November 30, 2011 18:04


All times are GMT -4. The time now is 11:33.