|
[Sponsors] |
May 3, 2020, 01:55 |
Issue with codedFixedValue: oldTime()
|
#1 |
New Member
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 7 |
Hello
I'm trying to implement the following BC Code:
type codedFixedValue; value $internalField; redirectType hybridParticleContinuim; code #{ const fvMesh& fluidMeshRef = patch().boundaryMesh().mesh(); const volScalarField& pFluid = db().lookupObject<volScalarField>("p"); const volScalarField& pParticle = db().lookupObject<volScalarField>("p_Mean"); const volScalarField& pFluidOld=pFluid.oldTime(); Info<< "code accessed"; //const scalar t = this->db().time().value(); const label fluidIdx=fluidMeshRef.nCells(); const label particleIdx=1; const scalar w=0.75; operator==(1-w)*pFluidOld[fluidIdx]+w*(0.5*pFluid[fluidIdx]+0.5*pParticle[particleIdx]); #}; Code:
pFluidOld[fluidIdx] Code:
/p.boundaryField.fluidBound:43:28: error: invalid operands of types ‘void’ and ‘const double’ to binary ‘operator*’ /opt/openfoam7/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/fixedValueFvPatchFieldTemplate.o' failed make: *** [Make/linux64GccDPInt32Opt/fixedValueFvPatchFieldTemplate.o] Error 1 --> FOAM FATAL IO ERROR Any help is appreciated thank you! |
|
May 3, 2020, 02:58 |
Resolved Sort of
|
#2 |
New Member
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 7 |
So it turns out my initial guess was way off and I simply had a syntax error in the operator statement, the correct line is
Code:
operator==((1-w)*pFluidOld[fluidIdx]+w*(0.5*pFluid[fluidIdx]+0.5*pParticle[particleIdx])); Code:
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Create mesh for time = 0 Meshes created Reading thermophysical properties Selecting thermodynamics package { type hePsiThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; } Using dynamicCode for patch fluidBound on field p at line 30 in "/home/anthonygay1812/OpenFOAM/Working/finalShockTube/0/fluid/p.boundaryField.fluidBound" |
|
Tags |
boundary condition, codedfixedvalue, time average problem |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issue on zeroGradient BC for system rotation | magnushaese | OpenFOAM Running, Solving & CFD | 2 | January 28, 2022 14:43 |
rhoCentralFoam inviscid airfoil issue (Foam::error::printStack(Foam::Ostream&) at ??) | kmkb21 | OpenFOAM Running, Solving & CFD | 1 | March 1, 2018 02:07 |
Prism Layer - Core Mesh Boundary Issue | InfernoxCJC | STAR-CCM+ | 7 | November 21, 2017 16:46 |
foamToTecplot360 issue with multiregion solvers | manuc | OpenFOAM Post-Processing | 2 | November 21, 2016 14:51 |
Pressure boundary condition issue | Vijay | FLUENT | 0 | April 6, 2012 14:35 |