SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
#ifndef rotatingWallVelocityFvPatchVectorField_H
#define rotatingWallVelocityFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*¥
Class rotatingWallVelocityFvPatchVectorField Declaration
¥*---------------------------------------------------------------------------*/
class rotatingWallVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
//- Origin of the rotation
vector origin_;
//- Axis of the rotation
vector axis_;
//- Rotational speed
autoPtr<DataEntry<scalar> > omega_;
public:
 In header file (.H)
• Including “DataEntry.H” file
• Defining time-varying parameter
 In source file (.C)
• Reading the parameter
• Calculating the parameter value
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rotatingWallVelocityFvPatchVectorField::
rotatingWallVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
omega_(DataEntry<scalar>::New("omega", dict))
{
if (dict.found("value"))
{
fvPatchField<vector>::operator=
(
vectorField("value", dict, p.size())
);
}
else
{
// Evaluate the wall velocity
updateCoeffs();
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
const scalar t = this->db().time().timeOutputValue();
scalar om = omega_->value(t);
// Calculate the rotating wall velocity from the specification of the motion
const vectorField Up
(
(-om)*((patch().Cf() - origin_) ^ (axis_/mag(axis_)))
);
// Remove the component of Up normal to the wall
// just in case it is not exactly circular
const vectorField n(patch().nf());
vectorField::operator=(Up - n*(n & Up));
fixedValueFvPatchVectorField::updateCoeffs();
}
Time-Dependent BCs
in OpenFOAM
BCs with time-varying options
Source Code (rotatingWallVelocity)
 Ref.: Release Note Version 2.1.0
 uniformFixedValue
General fixed value condition with time-
varying value (uniformValue)
 rotatingWallVelocity
Velocity condition for a rotating boundary
with time-varying angular velocity [rad/s]
(omega)
 flowRateInletVelocity
Inlet velocity condition with time-varying
flow-rate (volumetricFlowRate or
massFlowRate)
 a good many others
Examples of BC Specification
inlet
{
type uniformFixedValue;
uniformValue table
(
(0 (10 0 0))
(0.1 (12 0 0))
(0.2 (12 0 0))
(0.3 (11 0 0))
);
}
Ux [m/s]
Time [s]
rotatingWallVelocityFvPatchVectorField.H
rotatingWallVelocityFvPatchVectorField.C
1
2
1
2
3
4
3
4

Contenu connexe

En vedette

Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAM
Fumiya Nozaki
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming Tips
Fumiya Nozaki
 
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件についてOpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
Fumiya Nozaki
 
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD softwareOpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
Srinivas Nag H.V
 
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
Fumiya Nozaki
 
OpenFOAM の境界条件をまとめよう!
OpenFOAM の境界条件をまとめよう!OpenFOAM の境界条件をまとめよう!
OpenFOAM の境界条件をまとめよう!
Fumiya Nozaki
 
CAESES Free チュートリアル
CAESES Free チュートリアルCAESES Free チュートリアル
CAESES Free チュートリアル
Fumiya Nozaki
 
Limited Gradient Schemes in OpenFOAM
Limited Gradient Schemes in OpenFOAMLimited Gradient Schemes in OpenFOAM
Limited Gradient Schemes in OpenFOAM
Fumiya Nozaki
 

En vedette (20)

Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAM
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming Tips
 
無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた
 
blockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアルblockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアル
 
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件についてOpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
 
A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...
 
OpenFOAM for beginners: Hands-on training
OpenFOAM for beginners: Hands-on trainingOpenFOAM for beginners: Hands-on training
OpenFOAM for beginners: Hands-on training
 
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD softwareOpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
OpenFoam Simulation of Flow over Ahmed Body using Visual CFD software
 
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
 
Large strain computational solid dynamics: An upwind cell centred Finite Volu...
Large strain computational solid dynamics: An upwind cell centred Finite Volu...Large strain computational solid dynamics: An upwind cell centred Finite Volu...
Large strain computational solid dynamics: An upwind cell centred Finite Volu...
 
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
 
OpenFOAM の境界条件をまとめよう!
OpenFOAM の境界条件をまとめよう!OpenFOAM の境界条件をまとめよう!
OpenFOAM の境界条件をまとめよう!
 
Large strain solid dynamics in OpenFOAM
Large strain solid dynamics in OpenFOAMLarge strain solid dynamics in OpenFOAM
Large strain solid dynamics in OpenFOAM
 
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
 
CAESES Free チュートリアル
CAESES Free チュートリアルCAESES Free チュートリアル
CAESES Free チュートリアル
 
Avinash_PPT
Avinash_PPTAvinash_PPT
Avinash_PPT
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
 
OpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてOpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能について
 
Limited Gradient Schemes in OpenFOAM
Limited Gradient Schemes in OpenFOAMLimited Gradient Schemes in OpenFOAM
Limited Gradient Schemes in OpenFOAM
 
OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Time-Dependent Boundary Conditions in OpenFOAM

  • 1. #ifndef rotatingWallVelocityFvPatchVectorField_H #define rotatingWallVelocityFvPatchVectorField_H #include "fixedValueFvPatchFields.H" #include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*¥ Class rotatingWallVelocityFvPatchVectorField Declaration ¥*---------------------------------------------------------------------------*/ class rotatingWallVelocityFvPatchVectorField : public fixedValueFvPatchVectorField { // Private data //- Origin of the rotation vector origin_; //- Axis of the rotation vector axis_; //- Rotational speed autoPtr<DataEntry<scalar> > omega_; public:  In header file (.H) • Including “DataEntry.H” file • Defining time-varying parameter  In source file (.C) • Reading the parameter • Calculating the parameter value // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::rotatingWallVelocityFvPatchVectorField:: rotatingWallVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<vector>(p, iF), origin_(dict.lookup("origin")), axis_(dict.lookup("axis")), omega_(DataEntry<scalar>::New("omega", dict)) { if (dict.found("value")) { fvPatchField<vector>::operator= ( vectorField("value", dict, p.size()) ); } else { // Evaluate the wall velocity updateCoeffs(); } } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { return; } const scalar t = this->db().time().timeOutputValue(); scalar om = omega_->value(t); // Calculate the rotating wall velocity from the specification of the motion const vectorField Up ( (-om)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))) ); // Remove the component of Up normal to the wall // just in case it is not exactly circular const vectorField n(patch().nf()); vectorField::operator=(Up - n*(n & Up)); fixedValueFvPatchVectorField::updateCoeffs(); } Time-Dependent BCs in OpenFOAM BCs with time-varying options Source Code (rotatingWallVelocity)  Ref.: Release Note Version 2.1.0  uniformFixedValue General fixed value condition with time- varying value (uniformValue)  rotatingWallVelocity Velocity condition for a rotating boundary with time-varying angular velocity [rad/s] (omega)  flowRateInletVelocity Inlet velocity condition with time-varying flow-rate (volumetricFlowRate or massFlowRate)  a good many others Examples of BC Specification inlet { type uniformFixedValue; uniformValue table ( (0 (10 0 0)) (0.1 (12 0 0)) (0.2 (12 0 0)) (0.3 (11 0 0)) ); } Ux [m/s] Time [s] rotatingWallVelocityFvPatchVectorField.H rotatingWallVelocityFvPatchVectorField.C 1 2 1 2 3 4 3 4