timeVaryingAlphaContactAngleFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
31 #include "fvPatchFieldMapper.H"
32 #include "volMesh.H"
33 #include "Time.H"
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
39 (
40  const fvPatch& p,
42 )
43 :
45  t0_(0.0),
46  thetaT0_(0.0),
47  te_(0.0),
48  thetaTe_(0.0)
49 {}
50 
51 
54 (
56  const fvPatch& p,
58  const fvPatchFieldMapper& mapper
59 )
60 :
62  t0_(gcpsf.t0_),
63  thetaT0_(gcpsf.thetaT0_),
64  te_(gcpsf.te_),
65  thetaTe_(gcpsf.te_)
66 {}
67 
68 
71 (
72  const fvPatch& p,
74  const dictionary& dict
75 )
76 :
78  t0_(dict.get<scalar>("t0")),
79  thetaT0_(dict.get<scalar>("thetaT0")),
80  te_(dict.get<scalar>("te")),
81  thetaTe_(dict.get<scalar>("thetaTe"))
82 {
83  evaluate();
84 }
85 
86 
89 (
92 )
93 :
95  t0_(gcpsf.t0_),
96  thetaT0_(gcpsf.thetaT0_),
97  te_(gcpsf.te_),
98  thetaTe_(gcpsf.thetaTe_)
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 
106 (
107  const fvPatchVectorField&,
108  const fvsPatchVectorField&
109 ) const
110 {
111  scalar t = patch().boundaryMesh().mesh().time().value();
112  scalar theta0 = thetaT0_;
113 
114  if (t < t0_)
115  {
116  theta0 = thetaT0_;
117  }
118  else if (t > te_)
119  {
120  theta0 = thetaTe_;
121  }
122  else
123  {
124  theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_);
125  }
126 
127  return tmp<scalarField>::New(size(), theta0);
128 }
129 
130 
132 (
133  Ostream& os
134 ) const
135 {
137  os.writeEntry("t0", t0_);
138  os.writeEntry("thetaT0", thetaT0_);
139  os.writeEntry("te", te_);
140  os.writeEntry("thetaTe", thetaTe_);
141  writeEntry("value", os);
142 }
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 namespace Foam
148 {
150  (
153  );
154 }
155 
156 // ************************************************************************* //
Foam::fvPatchField< vector >
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
volMesh.H
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:68
fvPatchFieldMapper.H
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::timeVaryingAlphaContactAngleFvPatchScalarField
timeVaryingAlphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: timeVaryingAlphaContactAngleFvPatchScalarField.C:39
Foam::alphaContactAngleTwoPhaseFvPatchScalarField
Abstract base class for two-phase alphaContactAngle boundary conditions.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:78
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
timeVaryingAlphaContactAngleFvPatchScalarField.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: timeVaryingAlphaContactAngleFvPatchScalarField.C:132
Time.H
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta
virtual tmp< scalarField > theta(const fvPatchVectorField &Up, const fvsPatchVectorField &nHat) const
Evaluate and return the time-varying equilibrium contact-angle.
Definition: timeVaryingAlphaContactAngleFvPatchScalarField.C:106
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::timeVaryingAlphaContactAngleFvPatchScalarField
A time-varying alphaContactAngle scalar boundary condition (alphaContactAngleTwoPhaseFvPatchScalarFie...
Definition: timeVaryingAlphaContactAngleFvPatchScalarField.H:52
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::stringOps::evaluate
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
Definition: stringOpsEvaluate.C:37