Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3c85bee4
Commit
3c85bee4
authored
Apr 03, 2013
by
andy
Browse files
ENH: Updated external coupled BC
parent
33c1b274
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C
View file @
3c85bee4
This diff is collapsed.
Click to expand it.
src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H
View file @
3c85bee4
...
...
@@ -29,8 +29,16 @@ Group
Description
This boundary condition provides an interface to an external application.
Values are transferred as plain text files, comprising of the constituent
pieces of the `mixed' condition, i.e.
Values are transferred as plain text files, where OperFOAM data is written
as:
<value1> <surfaceNormalGradient1>
<value2> <surfaceNormalGradient2>
<value3> <surfaceNormalGradient3>
...
<valueN> <surfaceNormalGradientN>
and received as the constituent pieces of the `mixed' condition, i.e.
<value1> <gradient1> <valueFracion1>
<value2> <gradient2> <valueFracion2>
...
...
@@ -63,6 +71,7 @@ Description
Property | Description | Required | Default value
commsDir | communications folder | yes |
fileName | transfer file name | yes |
collate | collate all patch data into single file | yes |
waitInterval | interval [s] between file checks | no | 1
timeOut | time after which error invoked [s] |no |100*waitInterval
calcFrequency | calculation frequency | no | 1
...
...
@@ -76,6 +85,8 @@ Description
type externalCoupled;
commsDir "$FOAM_CASE/comms";
fileName data;
collate yes;
calcFrequency 1;
}
\endverbatim
...
...
@@ -91,6 +102,7 @@ SourceFiles
#define externalCoupledMixedFvPatchField_H
#include
"mixedFvPatchFields.H"
#include
"OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -109,7 +121,7 @@ class externalCoupledMixedFvPatchField
public
mixedFvPatchField
<
Type
>
{
pr
otec
te
d
:
pr
iva
te:
// Private data
...
...
@@ -119,6 +131,9 @@ protected:
//- Name of data file
word
fName_
;
//- Flag to collate all data into single transfer file
bool
collate_
;
//- Interval time between checking for return data [s]
label
waitInterval_
;
...
...
@@ -131,14 +146,21 @@ protected:
//- Log flag
bool
log_
;
//- Master patch flag - controls when to pause/resume execution
// Note: only valid when collate option is selected
bool
master_
;
// Private Member Functions
//- Set the master flag when collate option is selected
void
setMaster
();
//- Return the file path to the base communications folder
fileName
baseDir
()
const
;
fileName
baseDir
(
const
word
&
patchName
=
word
::
null
)
const
;
//- Write the geometry to the comms dir
void
writeGeometry
()
const
;
void
writeGeometry
(
OFstream
&
osPoints
,
OFstream
&
osFaces
)
const
;
//- Return the file path to the lock file
fileName
lockFile
()
const
;
...
...
@@ -149,13 +171,24 @@ protected:
//- Remove lock file
void
removeLockFile
()
const
;
//- Wait and remove lock file
void
writeAndWait
(
const
fileName
&
transferFile
)
const
;
//- Wait for response from external source
void
startWait
()
const
;
//- Wait for response from external source
void
wait
()
const
;
//- Initialise input stream for reading
void
initialiseRead
(
IFstream
&
is
)
const
;
protected:
// Protected Member Functions
//- Write data for external source - calls transferData
void
writeData
(
const
fileName
&
transferFile
)
const
;
public:
//- Runtime type information
...
...
@@ -164,6 +197,9 @@ public:
//- Name of lock file
static
word
lockName
;
//- Name of patch key, e.g. '# Patch:' when looking for start of patch data
static
string
patchKey
;
// Constructors
...
...
@@ -227,13 +263,50 @@ public:
}
//- Destructor
virtual
~
externalCoupledMixedFvPatchField
();
// Member functions
// Access
//- Return the log flag
bool
log
()
const
{
return
log_
;
}
//- Return the collate flag
bool
collate
()
const
{
return
collate_
;
}
//- Return the master flag
bool
master
()
const
{
return
master_
;
}
//- Return the master flag
bool
&
master
()
{
return
master_
;
}
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Transfer data for external source
virtual
void
transferData
(
OFstream
&
os
)
const
;
//- Write the geometry to the comms dir
void
writeGeometry
()
const
;
//- Write
virtual
void
write
(
Ostream
&
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment