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

codedFvModels buoyancy Force

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2024, 13:50
Default codedFvModels buoyancy Force
  #1
New Member
 
Felipe Noh
Join Date: Aug 2014
Posts: 8
Rep Power: 11
fnohpat is on a distinguished road
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
fnohpat 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
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


All times are GMT -4. The time now is 17:10.