|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Felipe Noh
Join Date: Aug 2014
Posts: 8
Rep Power: 12 ![]() |
Dear FOAMers,
If someone could please advise me on the following: I am implementing buoyancy force with the Boussinesq approximation in the momentum equations as a source term in the "fvModels" file. buoyancyBoussinesqForce { type coded; select all; field U; codeInclude #{ #}; codeAddSup #{ Pout<< "**codeAddSup**" << endl; #}; codeAddRhoSup #{ Pout<< "**codeAddRhoSup**" << endl; const scalar T0 = 293.5; const scalar rho0 = 1.20329; const scalar beta = 0.003407155; const volScalarField& T = mesh().lookupObject<volScalarField>("T"); //T field //double buoyancy = -0.001; double buoyancy= -9.81*rho0*(1.0-beta*(T-T0)); //Pout<< "T = "<<T<< endl; vectorField& USource = eqn.source(); USource += vector(0, buoyancy, 0); //, #}; codeAddAlphaRhoSup #{ Pout<< "**codeAddAlphaRhoSup**" << endl; #}; } But, I have the following error: error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ to ‘double’ in initialization make: *** [/opt/openfoam11/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/codedFvModelTemplate.o] Error 1 The error is in: double buoyancy= -9.81*rho0*(1.0-beta*(T-T0)); What is the correct variable type for buoyancy? I'm solving natural convection in a square cavity with OpenFOAM 11. For verification purposes, I want to solve it using the Boussinesq approximation. Thansk a lot Felipe Noh |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
The CoP Does not exist: Validating Aerodynamic forces through a "line of action" | ds4719 | Main CFD Forum | 14 | February 18, 2022 18:05 |
Buoyancy Force | mmd96 | FLUENT | 2 | February 18, 2022 17:26 |
Drag Force Ratio for Flat Plate | Rob Wilk | Main CFD Forum | 40 | May 10, 2020 04:47 |
ActuatorDiskExplicitForce in OF2.1. Help | be_inspired | OpenFOAM Programming & Development | 10 | September 14, 2018 11:12 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 22:03 |