Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
21ca911
Update CHT BuoyantPimpleFoam-Nutils to Python bindings v2 (#58)
BenjaminRodenberg Nov 29, 2019
536b94b
Update HT
uekerman Dec 18, 2019
bc1f462
Update SSI
uekerman Dec 18, 2019
cca9a49
Update heat_exchanger
uekerman Dec 18, 2019
5d79c52
Update flow-over-plate
uekerman Dec 18, 2019
86498e0
Update 3D Tube
uekerman Dec 18, 2019
72995ef
Update CylinderFlap
uekerman Dec 18, 2019
0a7db8b
Update cylinderFlap_2D
uekerman Dec 18, 2019
660629f
Update perpendicular flap
uekerman Dec 18, 2019
323ff2e
Update perp_flap_2D
uekerman Dec 18, 2019
8167118
Remove unnecessary comments
BenjaminRodenberg Dec 18, 2019
0fdbba2
Remove extrapolation-order from configs (#55)
uekerman Dec 18, 2019
6db37f1
Change post-processing to acceleration
uekerman Dec 18, 2019
698e890
Merge branch 'develop' of github.com:precice/tutorials into simplify-…
uekerman Dec 18, 2019
02974bf
Format some cosmetics
uekerman Dec 18, 2019
c40e169
Removes prototype tutorial that accidentally got added in #38
Dec 19, 2019
00bd4a8
flap_perp/OF-CCX: Remove duplicate precice-config_[serial|parallel].xml
MakisH Dec 19, 2019
ff974e7
FSI/3D_Tube: Port to latest OpenFOAM versions.
MakisH Jan 10, 2020
8ef26b6
Remove relics of precice-config[_serial|_parallel].xml
MakisH Jan 10, 2020
8aaeb43
Merge branch 'uekerman-simplify-parallel-config' into develop
MakisH Jan 10, 2020
a019d6a
apply single step initialization (https://github.com/precice/python-b…
BenjaminRodenberg Jan 16, 2020
2422f57
flap_perp_2D/OpenFOAM-deal.II: retain (empty) deal.II output directory
MakisH Jan 20, 2020
30e5acc
Changes timesteps to time-windows in config files
KyleDavisSA Jan 29, 2020
485cf69
Adapt fulfilled_action in Nutils CHT tutorial
uekerman Feb 1, 2020
823c9db
Restrict logger to rank 0 to cope with preCICE v2.0 (#68)
uekerman Feb 6, 2020
51a73c6
Port OpenFOAM tutorials to new OpenFOAM adapter config dictionary
MakisH Feb 8, 2020
cc29cec
Merge pull request #69 from precice/openfoam-config-dict
MakisH Feb 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

61 changes: 61 additions & 0 deletions CHT/flow-over-plate/buoyantPimpleFoam-fenics/precice-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0"?>

<precice-configuration>

<log>
<sink filter="%Severity% > debug and %Rank% = 0" format="---[precice] %ColorizedSeverity% %Message%" enabled="true"/>
</log>

<solver-interface dimensions="3">

<data:scalar name="Temperature"/>
<data:scalar name="Heat-Flux"/>

<mesh name="Fluid-Mesh">
<use-data name="Temperature"/>
<use-data name="Heat-Flux"/>
</mesh>

<mesh name="Solid-Mesh">
<use-data name="Temperature"/>
<use-data name="Heat-Flux"/>
</mesh>

<participant name="Fluid">
<use-mesh name="Fluid-Mesh" provide="yes"/>
<read-data name="Heat-Flux" mesh="Fluid-Mesh"/>
<write-data name="Temperature" mesh="Fluid-Mesh"/>
</participant>

<participant name="Solid">
<use-mesh name="Fluid-Mesh" from="Fluid"/>
<use-mesh name="Solid-Mesh" provide="yes"/>
<read-data name="Temperature" mesh="Solid-Mesh"/>
<write-data name="Heat-Flux" mesh="Solid-Mesh"/>
<mapping:nearest-neighbor direction="read" from="Fluid-Mesh" to="Solid-Mesh" constraint="consistent" timing="initial"/>
<mapping:nearest-neighbor direction="write" from="Solid-Mesh" to="Fluid-Mesh" constraint="consistent" timing="initial"/>
</participant>

<m2n:sockets from="Fluid" to="Solid"/>

<coupling-scheme:serial-implicit>
<time-window-size value="0.01"/>
<max-time value="1"/>
<max-iterations value="200"/>
<participants first="Fluid" second="Solid"/>
<exchange data="Temperature" mesh="Fluid-Mesh" from="Fluid" to="Solid"/>
<exchange data="Heat-Flux" mesh="Fluid-Mesh" from="Solid" to="Fluid"/>
<relative-convergence-measure limit="1.0e-6" data="Temperature" mesh="Fluid-Mesh"/>
<extrapolation-order value="0"/>
<acceleration:IQN-ILS>
<data mesh="Fluid-Mesh" name="Heat-Flux" />
<initial-relaxation value="0.01" />
<max-used-iterations value="80" />
<time-windows-reused value="10" />
<filter type="QR1" limit="1e-8" />
</acceleration:IQN-ILS>
</coupling-scheme:serial-implicit>

</solver-interface>

</precice-configuration>

This file was deleted.

22 changes: 9 additions & 13 deletions CHT/flow-over-plate/buoyantPimpleFoam-nutils/Nutils/cht.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def main(elemsize: 'mesh width in x and y direction' = 0.05,
participantName = "Nutils"
solverProcessIndex = 0
solverProcessSize = 1
interface = precice.Interface(participantName, solverProcessIndex, solverProcessSize)
interface.configure(configFileName)
interface = precice.Interface(participantName, configFileName, solverProcessIndex, solverProcessSize)

# define coupling meshes
meshNameGP = "Nutils-Mesh-GP" # Gauss points
Expand All @@ -51,12 +50,10 @@ def main(elemsize: 'mesh width in x and y direction' = 0.05,
couplingsampleGP = couplinginterface.sample('gauss', degree=degree*2)
couplingsampleCC = couplinginterface.sample('uniform', 4) # number of sub-samples for better mapping

verticesGP = couplingsampleGP.eval(ns.x).ravel()
verticesCC = couplingsampleCC.eval(ns.x).ravel()
dataIndicesGP = numpy.zeros(couplingsampleGP.npoints)
dataIndicesCC = numpy.zeros(couplingsampleCC.npoints)
interface.set_mesh_vertices(meshIDGP, couplingsampleGP.npoints, verticesGP, dataIndicesGP)
interface.set_mesh_vertices(meshIDCC, couplingsampleCC.npoints, verticesCC, dataIndicesCC)
verticesGP = couplingsampleGP.eval(ns.x)
verticesCC = couplingsampleCC.eval(ns.x)
dataIndicesGP = interface.set_mesh_vertices(meshIDGP, verticesGP)
dataIndicesCC = interface.set_mesh_vertices(meshIDCC, verticesCC)

# coupling data
writeData = "Heat-Flux"
Expand Down Expand Up @@ -89,8 +86,7 @@ def main(elemsize: 'mesh width in x and y direction' = 0.05,

# read temperature from interface
if interface.is_read_data_available():
readdata = numpy.zeros(couplingsampleGP.npoints)
interface.read_block_scalar_data(readdataID, couplingsampleGP.npoints, dataIndicesGP, readdata)
readdata = interface.read_block_scalar_data(readdataID, dataIndicesGP)
coupledata = couplingsampleGP.asfunction(readdata)

sqr = couplingsampleGP.integral((ns.u - coupledata)**2)
Expand All @@ -99,7 +95,7 @@ def main(elemsize: 'mesh width in x and y direction' = 0.05,
# save checkpoint
if interface.is_action_required(precice.action_write_iteration_checkpoint()):
lhscheckpoint = lhs0
interface.fulfilled_action(precice.action_write_iteration_checkpoint())
interface.mark_action_fulfilled(precice.action_write_iteration_checkpoint())

# potentially adjust non-matching timestep sizes
dt = min(dt, precice_dt)
Expand All @@ -111,14 +107,14 @@ def main(elemsize: 'mesh width in x and y direction' = 0.05,
if interface.is_write_data_required(dt):
fluxvalues = res.eval(lhs0=lhs0, lhs=lhs, dt=dt)
writedata = couplingsampleCC.eval('-flux' @ ns, fluxdofs=fluxdofs(fluxvalues))
interface.write_block_scalar_data(writedataID, couplingsampleCC.npoints, dataIndicesCC, writedata)
interface.write_block_scalar_data(writedataID, dataIndicesCC, writedata)

# do the coupling
precice_dt = interface.advance(dt)

# read checkpoint if required
if interface.is_action_required(precice.action_read_iteration_checkpoint()):
interface.fulfilled_action(precice.action_read_iteration_checkpoint())
interface.mark_action_fulfilled(precice.action_read_iteration_checkpoint())
lhs0 = lhscheckpoint
else: # go to next timestep and visualize
bezier = domain.sample('bezier', 2)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object preciceDict;
}

preciceConfig "../precice-config.xml";

participant OpenFOAM;

modules (CHT);

interfaces
{
Interface1
{
mesh OpenFOAM-Mesh;
patches (interface);

readData
(
Heat-Flux
);

writeData
(
Temperature
);
};
};
2 changes: 1 addition & 1 deletion CHT/flow-over-plate/buoyantPimpleFoam-nutils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $ pip3 install mkl
For running this tutorial, you further have to install

* **preCICE**, see [preCICE wiki](https://github.com/precice/precice/wiki/Building).
* **Python bindings**, see [bindings readme](https://github.com/precice/precice/tree/develop/src/precice/bindings/python)
* **Python bindings**, see [bindings `README.md`](https://github.com/precice/precice/tree/develop/src/precice/bindings/python)
* **OpenFOAM**, see [Notes on OpenFOAM](https://github.com/precice/openfoam-adapter/wiki/Notes-on-OpenFOAM).
* **OpenFOAM adapter**, see [OpenFOAM adapter wiki](https://github.com/precice/openfoam-adapter/wiki/Building). If you have problems compiling, see the [troubleshooting section](https://github.com/precice/precice/wiki/CHT-with-OpenFOAM-and-FEniCS#troubleshooting) below.

Expand Down
10 changes: 5 additions & 5 deletions CHT/flow-over-plate/buoyantPimpleFoam-nutils/precice-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<precice-configuration>

<log>
<sink filter= "%Severity% > debug" format="---[precice] %ColorizedSeverity% %Message%" enabled="true" />
<sink filter= "%Severity% > debug and %Rank% = 0" format="---[precice] %ColorizedSeverity% %Message%" enabled="true" />
</log>

<solver-interface dimensions="3">
Expand Down Expand Up @@ -40,20 +40,20 @@
<write-data name="Heat-Flux" mesh="Nutils-Mesh-CC" />
</participant>

<m2n:sockets from="OpenFOAM" to="Nutils" exchange-directory=".." distribution-type="gather-scatter"/>
<m2n:sockets from="OpenFOAM" to="Nutils" exchange-directory=".."/>

<coupling-scheme:serial-implicit>
<timestep-length value="0.01"/>
<time-window-size value="0.01"/>
<max-time value="1"/>
<max-iterations value="30"/>
<participants first="OpenFOAM" second="Nutils"/>
<exchange data="Temperature" mesh="OpenFOAM-Mesh" from="OpenFOAM" to="Nutils"/>
<exchange data="Heat-Flux" mesh="OpenFOAM-Mesh" from="Nutils" to="OpenFOAM"/>
<relative-convergence-measure limit="1.0e-5" data="Temperature" mesh="OpenFOAM-Mesh"/>
<post-processing:aitken>
<acceleration:aitken>
<data mesh="OpenFOAM-Mesh" name="Heat-Flux" />
<initial-relaxation value="0.01" />
</post-processing:aitken>
</acceleration:aitken>
</coupling-scheme:serial-implicit>

</solver-interface>
Expand Down
4 changes: 0 additions & 4 deletions CHT/heat_exchanger/buoyantSimpleFoam-CalculiX/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ if [ ! -f Solid/all.msh ]; then
exit
fi

# Link to the precice-config for the serial run
echo "Setting up the preCICE configuration file for a serial simulation"
ln -s -f precice-config_serial.xml precice-config.xml

# Participant 1: Inner-Fluid
Participant1="Inner-Fluid"
Solver1="buoyantSimpleFoam"
Expand Down
4 changes: 0 additions & 4 deletions CHT/heat_exchanger/buoyantSimpleFoam-CalculiX/Allrun_parallel
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ if [ ! -f Solid/all.msh ]; then
exit
fi

# Link to the precice-config for the parallel run
echo "Setting up the preCICE configuration file for a parallel simulation"
ln -s -f precice-config_parallel.xml precice-config.xml

# Participant 1: inner-fluid
Participant1="Inner-Fluid"
Solver1="buoyantSimpleFoam"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object preciceDict;
}

preciceConfig "precice-config.xml";

participant Inner-Fluid;

modules (CHT);

interfaces
{
Interface1
{
mesh Inner-Fluid-to-Solid;
patches (interface);

readData
(
Sink-Temperature-Solid
Heat-Transfer-Coefficient-Solid
);

writeData
(
Sink-Temperature-Inner-Fluid
Heat-Transfer-Coefficient-Inner-Fluid
);
};
};

This file was deleted.

Loading